minibb®
Fight the automated spam - protect your miniBB-forums,
getting the Captcha addon! Click here to read more.
Captcha Addon for miniBB
Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Master Class miniBB Community Forum / Master Class /

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

 
Anonymous
Guest
#1 | Posted: 22 Nov 2004 02:11
Reply 
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 ..
Team
8-)
#2 | Posted: 22 Nov 2004 10:50
Reply 
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>
marti
Forums Member
#3 | Posted: 22 Nov 2004 11:01
Reply 
thank you very much!
Anonymous
Guest
#4 | Posted: 4 Oct 2006 00:05
Reply 
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?
Paul
CEO
#5 | Posted: 4 Oct 2006 03:09
Reply 
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.
Anonymous
Guest
#6 | Posted: 4 Oct 2006 09:09
Reply 
Actually, I used this, but not displaying menu. Displays everything else.

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

What else should I try?
Team
8-)
#7 | Posted: 4 Oct 2006 09:48
Reply 
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.
Anonymous
Guest
#8 | Posted: 5 Oct 2006 11:16
Reply 
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?
Paul
CEO
#9 | Posted: 6 Oct 2006 02:40
Reply 
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.
Anonymous
Guest
#10 | Posted: 4 Nov 2006 22:45
Reply 
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.
 
Your reply
Bold Style  Italic Style  Image Link  URL Link 


» Username  » Password 
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, be sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
Online now: Guests - 28
Members - 0
Most users ever online: 191 [24 Dec 2007 14:33]
Guests - 191 / Members - 0

Forums are powered by miniBB®