Page 1 of 1

php code in sidebar

Posted: Wed Jan 24, 2007 11:17 pm
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

Re: php code in sidebar

Posted: Thu Jan 25, 2007 12:22 am
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

Posted: Thu Jan 25, 2007 12:48 am
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?

Posted: Thu Jan 25, 2007 12:09 pm
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

Posted: Sun Feb 11, 2007 7:44 pm
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