php code in sidebar

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
stifler
Regular
Posts: 14
Joined: Tue Jan 09, 2007 8:57 pm
Location: bavaria, germany

php code in sidebar

Post by stifler »

hey guys,

easy question. prob. hard to work out. what I wanna do is to have a couple of lines of php code in the sidebar. I tried the html nugget sidebar plugin, it is not accepting php.
any ideas?

and another thing, i have a header image, is it possible to add a couple of lines to make a image map out of it? in the header image i wanna have a part of it to be a link to the index page. any ideas as well?

after that i stop customizing my blog ;)

cheers
Oliver
Regular
Posts: 178
Joined: Mon Jan 10, 2005 7:43 pm
Location: Herne, Germany
Contact:

Re: php code in sidebar

Post by Oliver »

stifler wrote:easy question. prob. hard to work out. what I wanna do is to have a couple of lines of php code in the sidebar. I tried the html nugget sidebar plugin, it is not accepting php.
any ideas?
Here you find a PHPbox-Sidebar-PlugIn:

http://board.s9y.org/viewtopic.php?p=2315#2315

:)
Oliver
Image
stifler
Regular
Posts: 14
Joined: Tue Jan 09, 2007 8:57 pm
Location: bavaria, germany

Post by stifler »

thanks for the link, but it is not working I get the error
Fatal error: Call to a member function introspect() on a non-object in /home/httpd/htdocs/xxx/include/admin/plugins.inc.php on line 68
Starting from Line line 68 the script says

Code: Select all


    function generate_content(&$title)
    {
        global $serendipity;

        $title = $this->get_config('title', $title);
        $show_where = $this->get_config('show_where', 'both');

        if ($show_where == 'extended' && (!isset($serendipity['GET']['id']) || !is_numeric($serendipity['GET']['id']))) {
            return false;
        } else if ($show_where == 'overview' && isset($serendipity['GET']['id']) && is_numeric($serendipity['GET']['id'])) {
            return false;
        }

        eval($this->get_config('content')); # Actualy this is the only BIG change to the HTML Block code.
    }
}
?> 
Any idea. Is it perhaps because the script was written for an older version of s9y?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

It sounds as if your PHP code of the file is broken? Can it be your copy+paste for the file was wrong?

Best 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/
stifler
Regular
Posts: 14
Joined: Tue Jan 09, 2007 8:57 pm
Location: bavaria, germany

Post by stifler »

yes u were right. the code was broken. don't know what happende. now i can include php in the sidebar.

one more thing, if somebody uses the php sidebar plugin: when u paste the php-code in the editor make sure u switched to html mode. then paste it from your source without <?php and ?>. then click save and don't change back to the wysiwyg-mode before u didnt click save, otherwise the code will be changed and item like "" get changed into html quotes and so on and u get error messages. the problem is u can not change the code in the editor, u have to change it outside and then paste it every time as described. at least i did not find another way.

otherwise it works fine.
cheers
Post Reply