#23 functions.inc enhancement

closed-fixed
Joe Stewart
None
5
2002-01-15
2001-10-04
Luis M
No

the getHeader function ( slashhead(); ) should allow
people to specify different navbar templates for
different pages. Meaning, the index.php3 page might
have a navbar that's different from the navbar you as
an amin would like to see. I implemented an experiment
that assigns a navbar using a different template than
the usual navbar.tpl (using navbarIndex.tpl for all
the substr($pagetitle,0,4) == "Home" pages ). That
means that whenever a regular user goes to the page.
Him/her will see a consistent Navigation bar that
applies to all Sections of a given website. But,
whenever an admin logs in, he/she is going to see all
the usual controls that an administrator (root or not)
needs. Basically, in the functions.inc file there
should be these changes (this is for phpSlash 0.65):
$baseTitle = substr($pagetitle,0,4);

if ($baseTitle == "Home") {
$templ->set_var(array(
ROOTDIR => $_PSL[rooturl],
IMAGEDIR => $_PSL[imageurl],
SITETITLE => $title,
SEARCH_ACTION_URL => $action_url,
XSITEOBJECT => $metaobject,
NAVBAR => $navbar->getNavBar
("navbarIndex",""),
TOPICBAR => $topicbar->getTopicBar(),
BLOCKS_COLUMN => $allblocks
));
} else {
$templ->set_var(array(
ROOTDIR => $_PSL[rooturl],
IMAGEDIR => $_PSL[imageurl],
SITETITLE => $title,
SEARCH_ACTION_URL => $action_url,
XSITEOBJECT => $metaobject,
NAVBAR => $navbar->getNavBar(),
TOPICBAR => $topicbar->getTopicBar(),
BLOCKS_COLUMN => $allblocks
));

so if the current $pagetitle starts with the keyword
Home, you will get a navBar for all the Home -
$section pages...

I attached the files to this post, plus the template
that I'm using for www.latinomixed.com ...

Enjoy

Luis M
lems1@users.sorceforge.com

Discussion

  • Luis M
    Luis M
    2001-10-04

    functions.inc enhanced ++

     
    Attachments
  • Luis M
    Luis M
    2001-10-04

    • assigned_to: nobody --> joestewart
     
  • Joe Stewart
    Joe Stewart
    2001-11-14

    Logged In: YES
    user_id=77269

    Thank you for point out that the navbar template couldn't be
    assigned from the index page.

    As of 11/14/2001, getHeader contains a more general solution.

    To accomplish the above all it would take in index.php3 is
    the lines:

    $baseTitle = substr($pagetitle,0,4);
    if ($baseTitle == "Home") {
    $navbar_ary['tpl'] = "navbarIndex";
    $_PSL['metaobject']['navbar_ary'] = $navbar_ary;
    }

    or the equivalent:

    $baseTitle = substr($pagetitle,0,4);
    if ($baseTitle == "Home") {
    $_PSL['metaobject']['navbar_ary']['tpl'] = "navbarIndex";
    }

    Please try this and let me know your thoughts.

    Joe

     
  • Joe Stewart
    Joe Stewart
    2002-01-15

    Logged In: YES
    user_id=77269

    fixed in cvs.

     
  • Joe Stewart
    Joe Stewart
    2002-01-15

    • status: open --> closed-fixed