This topic is locked

New Menu in lheader

7/18/2008 12:05:39 PM
PHPRunner General questions
H
horsey_kim author

This is kind of a sequel to one I had written earlier. But I decided to go with using just the default template and I am not including a header file. Instead I am putting the header info into the lheader.htm template page so it shows up on every page. But I have different levels of access. so....
What kind of code would I use to show menus based on group id.
I am not that good at code so can someone help me come up with maybe a PHP insert to put in the htm template that would be some kind of if statement? So that it can pick the best menu based on group id.
Does that sound doable?
I am pretty good with html and picking my way thru php, but have not a good knowledge base to do something like this with out help.
Kim <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=9031&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />

H
horsey_kim author 7/18/2008

My hosting just told me that they feel that php scripting in side of html code is not a good thing. Does anyone else do that and do you have problems?
Kim

J
Jane 7/21/2008

Kim,
use smarty variables instead of PHP.

Here is a sample:

{if $show_menu}

Menu

...

{/if}


Fill $show_menu variable with correct value on the Before display event:

if ($_SESSION["GroupID"]=="admin")

$smarty->assign("show_menu",1);//show menu
if ($_SESSION["GroupID"]=="user")

$smarty->assign("show_menu",0);//hide menu