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
Plugin: Phpbox.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
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
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
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
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
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
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
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