By masanori oyama on Wednesday, 01 April 2015
Posted in General Issues
Replies 3
Likes 0
Views 816
Votes 0
Hi,

I have been using plugin like below with K2 to put php code in the articles.

http://extensions.joomla.org/extensions/extension/core-enhancements/coding-a-scripts-integration/directphp

It seems EasyBlog removes php codes on my site, even I enable coding integration plugins.
How can I use php code with EasyBlog?

p.s. site is a members only site.
Hello Masanori Oyama,

I am sorry for the delay of this reply.

In current version of easyblog, the php tag will actually strip the script content within the tag. The only possible way to display the php code is by using the code insert element without the php tag or you can use any third party plugin to display it.

I've tested out the plugin that you suggest in your post and it seems like DirectPHP is actually run the php script inside the blog, not actually displaying them. Basically it will display the output of the php script that you wrote.

By the way this issue is already addressed with the upcoming release of easyblog 5. You can test it out in our demo site here, http://easyblog5.stackideas.com/
·
Wednesday, 01 April 2015 17:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Ezrul,

Thank you for your reply.
Due to my poor English skill, I do not understand your noted,
""I've tested out the plugin that you suggest in your post and it seems like DirectPHP is actually run the php script inside the blog, not actually displaying them. Basically it will display the output of the php script that you wrote.""

When I wrote <?php echo "Hello World"; ?> in EB with DirectPHP, EB strip the tags.
I appreciate it if you could let me know which 3rd party extension should I use to keep php tags in EB....
·
Sunday, 05 April 2015 20:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Masanori,

EasyBlog actually sends the "posted" data to Joomla for filtering and we explicitly disable the ability to inject php codes. This is to avoid users trying to exploit your system. I know that your site is a member only site but it's still too risky to allow people to inject PHP codes (believe me, I am able to hack your site within 5 minutes if I was given the privilege to execute php scripts)

However, if you really need this, you might want to take a look at the file /components/com_easyblog/tables/blog.php under the @store method.
·
Sunday, 05 April 2015 21:00
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post