miniBB Support Forums
|
Forums
|
Register
|
Reply
|
Search
|
Statistics
|
Manual
|
miniBB Support Forums
/
Re-cycled
/
PHP in header and/or footer
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
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?
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
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.
Anonymous
Guest
#5
|
Posted: 24 Sep 2003 05:33
thanks, this makes a lot of sense :)
Loz
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
link92
Registered
#7
|
Posted: 26 Mar 2004 17:44
How can I add PHP in the header/footer
link92
Registered
#8
|
Posted: 7 Apr 2004 17:27
This is what I want to do - include /files/topheader.html in main_header.html
Team
#9
|
Posted: 7 Apr 2004 17:32
|
Edited by: Team
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.
link92
Registered
#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).
Team
#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();
miniBB Support Forums
/
Re-cycled
/ PHP in header and/or footer
↑
Top
Your Reply
Short link for this topic:
?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.
Before posting, make sure your message is compliant with our
forum posting rules
. If not, it may be locked or deleted with no explanation.
News & Announcements
FAQ
How To
Bugs
The Other
Official Addons and Solutions
Custom Tutorials and Modifications
Master Class
Specific
Re-cycled
Suggestions
Testimonials
qwerty
Features
Requirements
Demo
Download
Showcase
Gallery of Arts
Compiler
Premium Extensions
Premium Support
License
Contacts
Worried about forum enemies?
Pre-approve postings and members with the
Premoderation add-on
!