Page 1 of 1

1.1 theme config sidebar bug

Posted: Thu Feb 22, 2007 7:01 pm
by abdussamad
Hi

I noticed a bug in line 368 of include/admin/plugins.inc.php Basically it doesn't correctly allocate sidebars if you assign them to $serendipity["sidebars"] in config.inc.php. To correct it you need to replace this line:

Code: Select all

$sidebars = $serendipity['sidebars'];
with this

Code: Select all


$sidebars = explode(",",$serendipity['sidebars']);
Sincerely,

Re: 1.1 theme config sidebar bug

Posted: Fri Feb 23, 2007 9:43 am
by garvinhicking
HI!

You are not allow to set $serendipity['sidebars'] with a comma seperated list. You are only allowed to set $template_config['sidebars'].

So that's not a bug, you are just using the wrong variable. $serendipity['sidebars'] is expected to be an array.

Thanks for reporting this, though! :)

Best regards,
Garvin

Posted: Fri Feb 23, 2007 11:34 am
by abdussamad
HI!

You are not allow to set $serendipity['sidebars'] with a comma seperated list. You are only allowed to set $template_config['sidebars'].

So that's not a bug, you are just using the wrong variable. $serendipity['sidebars'] is expected to be an array.

Thanks for reporting this, though! Smile

Best regards,
Garvin
Maybe I am missing something but thats not what it says here:
If you do not want to make the sidebar names configurable by the users, you can also set $serendipity['sidebars'] = 'left,right,hide' in your template's config.inc.php file.

Posted: Fri Feb 23, 2007 11:40 am
by garvinhicking
Hi!

Ah, thank you. The $serendipity was wrong in that context, you're right. I fixed that. The header of that section though explains the use of $template_config, so at least it was partially right :-D

Thanks,
Garvin

Posted: Fri Feb 23, 2007 12:21 pm
by abdussamad
garvinhicking wrote:Hi!

Ah, thank you. The $serendipity was wrong in that context, you're right. I fixed that. The header of that section though explains the use of $template_config, so at least it was partially right :-D

Thanks,
Garvin
Unfortunately setting $template_config['sidebars'] does not work either. The additional sidebars do not show up in config plugins and in manage styles I get this error:

Warning: Invalid argument supplied for foreach() in E:\Documents and Settings\Abdussamad\My Documents\My Webs\myweb2\s9y11\include\admin\templates.inc.php on line 19

Posted: Fri Feb 23, 2007 1:00 pm
by garvinhicking
Hi!

Try this in config.inc.php:

Code: Select all

$template_config = array(
  array(
        'var'           => 'sidebars',
        'title'         => 'Sidebars',
        'description'   => 'Enter the names of sidebars. Dont change if you dont know what this is :-)',
        'type'          => 'string',
        'default'       => 'left,right,top,bottom'
    ),
);
HTH,
Garvin