Page 2 of 2

Posted: Mon Jun 13, 2005 3:08 pm
by garvinhicking
You can try to use "?><?php" at the beginning, I think that is propper.

Apart frmo this, your code does not evaluate here in my eval() tests at well. It is not suitable for a code to be executed in a PHP Box environment. It is very much suggested that you make a plugin out of this. Also your code would not run because it tries to include wrong files and creates a new DB connection which would kill the s9y db connection. Check the changes I have made below.

This is very easy using the template "serendipity_plugin_gallery_menalto_random": http://nopaste.php-q.net/140741

Regards,
Garvin

Posted: Mon Jun 13, 2005 4:03 pm
by JulianDE
Thank you Garvin,

I've pasted the code into a new and empty plugin file but calling it from plugin installer menu is not possible:
Fehler: serendipity_plugin_recent_posts

Do I have to adapt something in the code?
When reffering to a path - which is the relative position the plugin is referring from? the root?

I thought if the file runs on its own and display the 5 recent topics there is a chance to simply have the output in the sidebar, but I guess this is not as easy as I expected.

thanks a lot,
Julian

Posted: Mon Jun 13, 2005 4:30 pm
by garvinhicking
Julian, sadly that code was not crafted to be included in a page with other content. If the file just fails, try if it contains parse errors. "php -l" with the binary can check that, or any decent PHP Editor...

Regards,
Garvin

Posted: Thu Jun 16, 2005 12:12 am
by JulianDE
didn't want to accept it as there are several sites around with recent topics integrated in some kind of php blog software. I've tried 'include' and it works now! :-)

I guess I just was too stupid and you guys already assumed I had used 'include'. So I understand the code doesn't work when pasted into the php box plugin in the editor but does work when called with include :-)

thanks a lot Garvin,

yours happy Julian :-)

Posted: Sat Aug 23, 2008 12:13 am
by deiszner
you should say to the users of your fantastic (really fantastic) plugin, that they are not allowed to use the wysiwyg editor for editing the "inserted php code" - i needed 2 hours to recognize this fact !

but the plugin is very good :D :D :D :D