miniBB Support Forums | 15 years on The Web
miniBB ®

miniBB

®
 
 | Forums | Register | Reply | Search | Statistics | Manual |
Re-cycled miniBB Support Forums / Re-cycled /   
 

how to use '<?php require 'templates/info.html';?> in templates/main_modern_layout.html ?

 
Author gezgin
Partaker
#1 | Posted: 22 Jun 2014 15:46 
I want to embed templates/info.html in templates/main_modern_layout.html

I have put <?php require 'templates/info.html';?> in templates/main_modern_layout.html , on the right column,
but nothing shows up?

how can I solve this?

Author Paul
Lead Developer
#2 | Posted: 22 Jun 2014 16:01 
Direct PHP code won't work in miniBB templates.

You will need to assign some PHP variable with the value and then put it into the table regular way like it happens with all other variables. For example, in your case, you might need to read the contents of the file

$tplInfo=file_get_contents('templates/info.html');

then put {$tplInfo} in templates/main_modern_layout.html.

Author Paul
Lead Developer
#3 | Posted: 22 Jun 2014 16:01 

Author gezgin
Partaker
#4 | Posted: 22 Jun 2014 16:44 | Edited by: gezgin 
Okay, I need to put this into templates/main_modern_layout.html:

{$tplInfo}

But where should I put this?? Should I put this into bb_plugins.php:

<?php
$tplInfo = "test";
?>

Author gezgin
Partaker
#5 | Posted: 22 Jun 2014 16:50 
it works like charm!!!

Now I can use $tplInfo in all templates in templates folder, am I right?

MiniBB is great!!

Author Paul
Lead Developer
#6 | Posted: 22 Jun 2014 18:27 
gezgin:
Now I can use $tplInfo in all templates in templates folder, am I right?

This approach could be used for any template, any add-on as well.
Thanks, and have success while experimenting :)

Re-cycled miniBB Support Forums / Re-cycled /
 how to use '<?php require 'templates/info.html';?> in templates/main_modern_layout.html ?
 Share Topic's Link

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


 ?
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.

 
 
miniBB Support Forums Powered by Forum Software miniBB ® 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.
↑ TOP