miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | 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 
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


  ?
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
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑