miniBB Support Forums
|
Forums
|
Register
|
Reply
|
Search
|
Statistics
|
Manual
|
miniBB Support Forums
/
Re-cycled
/
How to use php in template files?
Peter
Registered
#1
|
Posted: 10 Jan 2006 05:42
I've tried to put a php include in main_header.html, but it doesn't work. The include only works when I rename the file to main_header.php, but that of course messes up the system.
Why are the template files called .html? Is there a way to fix this?
If I can't use php includes in the header and footer files, integrating miniBB into my site will become a lot more complicated/cumbersome.
Team
#2
|
Posted: 10 Jan 2006 13:03
You can use including of any file in bb_plugins.php. After that, store all output in some variable, for example, $output. Then provide {$output} in main_header.html.
Florian
Guest
#3
|
Posted: 9 Feb 2006 15:12
hi paul,
i wanted to add a php-include file to templates/main_header.html
it only adds some html-code in front of the main forum. my .htaccess is advised to crawl html files like php files. but the only thing my browser does is showing the php source-code. it doesn't include the html source code... why? minibb . info / minibb.html (i inserted the source manualy)
Team
#4
|
Posted: 16 Mar 2006 12:52
PHP-include will not work in the templates. The only way to display a variable is to give it a value it first within some PHP script, then provide {$variable} tag in the template.
If you want to use dynamic header/footer, look at the options $includeHeader and $includeFooter in setup_options.php.
muz1
Registered
#5
|
Posted: 11 Jul 2006 21:39
Hey there.
I am having the same problems. I have done some test code and understand how I need to redefine variables and call them in the template. My problem is that my code is so technical and to try and string it as a variable would be a nightmare. The header I want to generate also includes javascript functions and heaps of other stuff.
I am already getting a headache trying to work out whatI am going to do.
Any ideas.
Paul
CEO
#6
|
Posted: 12 Jul 2006 06:46
|
Edited by: Paul
Take a look at
this thread
or, as said above, look at the options $includeHeader and $includeFooter, which specify the names of your custom PHP header files.
Overall, we are providing only paid support on custom implementations.
Andrewww
Registered
#7
|
Posted: 13 Jun 2007 18:43
You can use including of any file in bb_plugins.php. After that, store all output in some variable, for example, $output. Then provide {$output} in main_header.html.
I would be very grateful if you can tell me the name of function( and file, where it is ), that makes the substitution in templates. I consider it as very nice solution and I am really curiosus how does it work. I hope it is possible to answer my question. Thank you for any answers.
Paul
CEO
#8
|
Posted: 14 Jun 2007 03:51
bb_functions.php -> ParseTpl()
miniBB Support Forums
/
Re-cycled
/ How to use php in template files?
↑
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
Check-up your forums instantly without missing any new posting
using the
Forums Checker add-on
!