miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Master Class miniBB Support Forums / Master Class /  
 

Integration with Smarty

 
Author speck44
Partaker
#1 | Posted: 4 Jul 2003 18:07 
Hi,
My site is built using the Smarty template system. I can't seem to plug miniBB into my Smarty templates, although this seems pretty simple.

The solution I would like to use is:

1. Change index.php to index_minibb.php

2. Create index.php with only the following:
require("../Classes/Core/TemplateClass.php");

$Template = new Template;

$Template->display("Forum/Index.tpl");

3. Create Forum/Index.tpl with only the following:
{include file="Header.tpl"}

{php}
include("index_minibb.php");
{/php}

{include file="Footer.tpl"}

This almost works, in the sense that it does not generate an error. Unfortunately, only the miniBB logo appears. It seems that something is confusing the paths in miniBB.

Your suggestions would be greatly appreciated.

Thank you in advance.

Author Team
8-)
#2 | Posted: 4 Jul 2003 18:51 
Don't know why do you need Smarty if miniBB has built-in templates parser? It will additionally slow down your system...

Author speck44
Partaker
#3 | Posted: 4 Jul 2003 20:42 
Thank you for your response.

Navigation options and roles-based access are built into our Smarty templates...which is a convenient and easily extensible way to manage these things.

MiniBB is just a small feature of our overall system and I would like it to be integrated into the rules for everything else.

Finally, performance is not a major criteria for our project (an intranet management system). Nevertheless, Smarty performs very well, particularly when you use its caching features...even more so with PhpAccelerator.

So, any suggestions as to why the miniBB content does not appear when wrapped into a Smarty template?

Thanks in advance.

Author Team
8-)
#4 | Posted: 7 Jul 2003 10:31 
Personally, I don't know how Smarty works, so I can not give any recommendations...

Author Anonymous
Guest
#5 | Posted: 6 Aug 2003 01:08 
it is possible to add Minibb to Smarty! but you have to change all include pathes!

We tried it 4 mounth ago! But it is too much work! Change the templates of minibb to your style ! This is quiet easier!

Bye

Author Vitani
Partaker
#6 | Posted: 17 Nov 2009 06:48 
Try this.

Edit minibb's setup_options.php file and set:
$includeHeader='inc_header.php';
$includeFooter='inc_footer.php';

Then create two files, inc_header.php & inc_footer.php in the minibb folder with the contents:
<?php
// put full path to Smarty.class.php
require_once('/full/path/to/smarty/libs/Smarty.class.php');
$smarty = new Smarty();

$smarty->template_dir = '/full/path/to/smarty-instance/templates';
$smarty->compile_dir = '/full/path/to/smarty-instance/templates_c';
$smarty->cache_dir = '/full/path/to/smarty-instance/cache';
$smarty->config_dir = '/full/path/to/smarty-instance/configs';

$smarty->display('header-or-footer.tpl');
?>

Make sure you change anything in italic to suit your setup, then when you browse to your forum it will show your Smarty header & footer templates.

Not ideal, but it's the only fully working solution I've found.

Master Class miniBB Support Forums / Master Class /
 Integration with Smarty
 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.


  ⇑