miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Master Class miniBB Support Forums / Master Class /   

Using {$...} tags in custom header.php and footer.php?

Author Anonymous
Guest
#1 | Posted: 22 Nov 2004 02:11 
Is it possible to make the {$l_menu[0]} etc. tags in the custom header.php and footer.php files work? I have a page with a quite long header and I wouldn't want to have almost the same long code in both ./inc/header.php and in ./forum/template/main_header.html ..

Author Team
8-)
#2 | Posted: 22 Nov 2004 10:50 
Use $GLOBALS['l_menu'][0] etc.

Example (from the working site):

<?php include("include/head.php"); ?>

<table width="100%" cellpadding=0 cellspacing=0 border=0>
<tr><td style="border-bottom: 1px solid #000000" align=center><span class=txtNr><b><?=$GLOBALS['l_menu'][0];?><?=$GLOBALS['l_menu'][7]?><? =$GLOBALS['l_menu'][3]?><?=$GLOBALS['l_menu'][2]?><?=$GLOBALS['l_menu' ][1]?><?=$GLOBALS['l_menu'][5]?><?=$GLOBALS['l_sepr']?></b></span>
</td></tr></table>
<div align=center>

Author marti
Registered
#3 | Posted: 22 Nov 2004 11:01 
thank you very much!

Author Anonymous
Guest
#4 | Posted: 4 Oct 2006 00:05 
How can I keep the existing look and feel of my website by using the header/footer in my php pages?

Currently the code in place produces a header abnd footer, but no menu (navigation bar).



<? include("/pathto.../templates/main_header.php") ?>

Content here

<? include("/pathto.../templates/main_footer.php") ?>

Everything displays fine but the menu is missing.

How can I fix this?

Author Paul
Lead Developer
#5 | Posted: 4 Oct 2006 03:09 
I think, you need to use {$GLOBALS['l_menu'][0]} for example instead of $l_menu[0] and so on for all menu items. I.e. use $GLOBALS array of variables instead of simple vars.

Author Anonymous
Guest
#6 | Posted: 4 Oct 2006 09:09 
Actually, I used this, but not displaying menu. Displays everything else.

<?=$GLOBALS['l_menu'][0];?>

What else should I try?

Author Team
8-)
#7 | Posted: 4 Oct 2006 09:48 
Try

<?php echo $GLOBALS['l_menu'][0]; ?>

and for other items, too. [l_menu][0]; index is not displayed on the first page, but only on internal pages.

Author Anonymous
Guest
#8 | Posted: 5 Oct 2006 11:16 
That still didn't work. I am able to pull the header and footer just fine, using include tags. But when I place the menu links as described above, they do not display.

Do I need to add anything to the pages so it knows what to look for concerning the Global menu?

Author Paul
Lead Developer
#9 | Posted: 6 Oct 2006 02:40 
So, are they simply not displayed, or the script gives some error? It should give some error or Notice, which you can see if your php.ini's error_reporting setting set to E_ALL.

Without noticing the error, we can not determine the problem.

Author Anonymous
Guest
#10 | Posted: 4 Nov 2006 22:45 
what i did was just copied all the visual header portion and copied it onto a template i use for all my other pages. it's entirely seamless this way.

Master Class miniBB Support Forums / Master Class / Using {$...} tags in custom header.php and footer.php? Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB