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

reading minibb variables in custom php header / footer

Author Avenir
Registered
#1 | Posted: 5 Jan 2005 07:24 
My problem is that when I try to call a variable like {$title} in my header, the variable's value isn't displayed, but instead just the variable itself. I have my header in the templates directory, if that makes any difference, but I don't know why the variable isn't working properly.

Also, when I copied the miniBB copyright statement into my own footer, the variables in that stopped working as well. I don't have the footer file in my templates directory, if that makes a difference.

What's going on?

Author Team
8-)
#2 | Posted: 5 Jan 2005 10:07 
Probably, if you are using your own header and footer, you also need to handle/parse these variables properly. We are using ParseTpl() function for parsing the template, and makeUp() function for loading the content of the template.

Author Anonymous
Guest
#3 | Posted: 6 Jan 2005 12:00 
I want to share this for you guys, i also faced the same situation, this is that i have done

In your header.php, instead of

{$l_menu[0]}{$l_menu[7]}{$l_menu[3]}{$l_menu[2]}{$l_menu[1]}{$l_menu[4 ]}{$l_menu[5]}{$l_menu[6]}{$l_sepr}

You put

<span id="bbforummenu"></span>

In your footer.php, at the end, before class tag </body>, put this code

<script language="javascript1.2">
var str = '<?php echo $l_menu[0].$l_menu[7].$l_menu[3].$l_menu[2].$l_menu[1].$l_menu[4].$l_m enu[5].$l_menu[6].$l_sepr; ?>';
document.all.bbforummenu.innerHTML=str;
</script>

Explaination:

Those variables only load after the main forum page loaded, before footer.php is called. It's just a javascript, its job is to put back the text to the span id bbforummenu

Author Billy Stardust
Registered
#4 | Posted: 19 Feb 2006 11:37 
you also need to handle/parse these variables properly.

Please elaborate. What's the best way to handle and parse variables?

Author Billy Stardust
Registered
#5 | Posted: 19 Feb 2006 11:38 
Great piece of software by the way! :)

Author Team
8-)
#6 | Posted: 20 Feb 2006 10:13 
Please elaborate. What's the best way to handle and parse variables
we mean by that - if you have your own header and footer, our template variables like {$title} or many others, will not work there, until you handle your header/footer files with our functions like ParseTpl() or makeUp().

Author Anonymous
Guest
#7 | Posted: 25 Apr 2006 20:23 
Hi there,

love your product and it's possibilites to integrate it in an exisiting site.

I've looked through the manual and searched the forum, but can't find a clear answer on the following question:

Is it possible (and what would be best practice) to call some of the minibb php variables (such as $title, $l_meta, $l_menu, ... in my custom (php) header ?

Thanks,

kurdy

Author Team
8-)
#8 | Posted: 26 Apr 2006 08:03 
Pay attention at $includeHeader setting in setup_options.php - you can use any PHP file as your header and produce whatever you want there.

Author Anonymous
Guest
#9 | Posted: 26 Apr 2006 11:11 
Yep, I found that, I'm using a custom header and footer with php code. My question is if I can access the minibb variables that are used in the default header (main_header.html), su as $metaRobots, ... in my custom php header.

Thanks,

kurdy

Author Anonymous
Guest
#10 | Posted: 26 Apr 2006 11:15 
Found it myself :-). Declaring $title, $metaRobots, ... as global in your custom header does the trick.

Kurdy

Author Team
8-)
#11 | Posted: 26 Apr 2006 11:54 
Ok, good. You may also use $GLOBALS array (instead of {$title} there could be $GLOBALS['title'] etc).

Master Class miniBB Support Forums / Master Class / reading minibb variables in custom php header / footer 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
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB