#135 Problems if NavBar or TopicBar are false

closed-fixed
nobody
None
5
2002-01-05
2002-01-04
Anonymous
No

There's a bug in getHeader - it fails if
$_PSL[module][TopicBar] or $_PSL[module][NavBar] are
set to "false" - ie you do not want a topic bar or
navbar to be displayed.

Here's a code snippet which fixes the problem in
getHeader. Similar principle applies to getFooter:

function getHeader($title,$metaobject, $section='',
$tpl='') {

/* unchanged code ommitted */

/* CHANGED CODE: Get Topic and Nav bars if required */

if ($_PSL[module][TopicBar]) {
$topicbar = new TopicBar;
$topicbarcontent = $topicbar->getTopicBar();
} else {
$topicbarcontent = "";
}

if ($_PSL[module][NavBar]) {
$navbar = new NavBar;
$navbarcontent =
$navbar->getNavBar($navbar_ary[tpl],$navbar_ary[menu_ary]);
} else {
$navbarcontent = "";
}

$templ->set_var(array(
SITE_NAME => $_PSL[site_name],
SITE_OWNER => $_PSL[site_owner],
SITE_SLOGAN => $_PSL[site_slogan],
SITE_TITLE => $_PSL[site_title],
SECTION => $_PSL[section],
ROOTDIR => $_PSL[rooturl],
IMAGEDIR => $_PSL[imageurl],
SITETITLE => $title,
SEARCH_ACTION_URL => $action_url,
NAVBAR => $navbarcontent,
TOPICBAR => $topicbarcontent,
BLOCKS_COLUMN => $allblocks,
SKIN => $_PSL[skin]
));

/* END CHANGED CODE */

$templ->parse(OUT, "header" );
return $templ->get(OUT);
}

Discussion

  • Joe Stewart

    Joe Stewart - 2002-01-05
    • status: open --> closed-fixed
     
  • Joe Stewart

    Joe Stewart - 2002-01-05

    Logged In: YES
    user_id=77269

    This problem has been corrected in the CVS. Please update your
    copy of PHPSlash, or wait for the next release.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks