miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Re-cycled miniBB Support Forums / Re-cycled /  
 

PHP in header and/or footer

 
Author Anonymous
Guest
#1 | Posted: 14 Sep 2003 02:46 
hello,

would it be possible to have header.html and footer.html as header.php and footer.php instead? This way I can get includes to work.

Ciao,

Loz

Author Anonymous
Guest
#2 | Posted: 14 Sep 2003 04:04 
if you added a call to your other code in bb_plugins.php - then had your other code output to $mycontent, you could add {$mycontent} to main_header.html and main_footer.html. it'd be included along with everything else.

Read these threads for more:

PHP code / variables in templates
Using {$...} tags in custom header.php and footer.php?

Author Anonymous
Guest
#3 | Posted: 23 Sep 2003 02:32 
thanks.. but I didn't understand a thing :(

can you repeat all bearing in mind i have a limited understanding of anything beyond easy HTML?

Ciao,

Loz

Author Anonymous
Guest
#4 | Posted: 23 Sep 2003 23:01 
what do you need to include?

anyway - here's an example. add this to bb_plugins.php:

$mycontenttop = 'appears in the header';
$mycontentbottom = 'appears in the footer';

now add this to the end of templates/main_header.html (or anywhere you like):

{$mycontenttop}

and add this to the end (or anywhere you like) of main_footer.html

{$mycontentbottom}

now, when you visit your site - it'll say 'appears in the header' somewhere near the top of the page and 'appears in the footer' somewhere near the bottom.

you could use an include instead (which is what bb_plugins.php is for) and add whatever custom dynamic content you like to the header and footer.

Author Anonymous
Guest
#5 | Posted: 24 Sep 2003 05:33 
thanks, this makes a lot of sense :)

Loz

Author Anonymous
Guest
#6 | Posted: 28 Oct 2003 19:39 
hi again...

I did this and it works. problem is that what I want to include... is an include:

<?php $path = "";
include("../sondaggio/poll.php");
?>

but it will not work as footer file is .html (i think).

any ideas,

Loz

Author link92
Partaker
#7 | Posted: 26 Mar 2004 17:44 
How can I add PHP in the header/footer

Author link92
Partaker
#8 | Posted: 7 Apr 2004 17:27 
This is what I want to do - include /files/topheader.html in main_header.html

Author Team
8-)
#9 | Posted: 7 Apr 2004 17:32 
You need to read contents of this file into variable (for example, from bb_plugins.php) and then simply to include this variable in main_header.html

For example:

$my_variable='Content Content Content Content etc.';

Then paste {$my_variable} into main_header.html... $my_variable can have any content you want, of course.

Author link92
Partaker
#10 | Posted: 7 Apr 2004 17:47 
I think I got my head around this in the end, and I forgot to say, this is for my CMS, which uses miniBB for the forum modual, currently in alpha (should be in beta by the end of today).

Author Team
8-)
#11 | Posted: 17 Jul 2008 06:17 
Use ob_start/ob_end directives to achieve that, and still, read output to the variable which you may paste later.

ob_start();
include("../sondaggio/poll.php");
$flushed=ob_get_contents();
ob_end_clean();

Re-cycled miniBB Support Forums / Re-cycled /
 PHP in header and/or footer
 Share Topic's Link

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


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑