miniBB Support Forums | 16 years on The Web
miniBB ®


 | Begin | Register | Reply | Search | Statistics | File Bank | Manual |
Master Class miniBB Support Forums / Master Class /   

Debugging templates

Author 4days
#1 | Posted: 25 Feb 2004 00:32 | Edited by: 4days 
been meaning to get around to making a list of the templates and exactly which bit of the page they're all for.. but never seem to get around to it, so here's a quick and dirty alternative:

1) make a backup copy of bb_functions.php and put it somewhere safe (so you can put it back when you're done playing with the templates).

2) open up bb_functions.php and replace:

$tpl = fread ($fd, filesize ('./templates/'.$name.'.'.$ext));


# $tpl = fread ($fd, filesize ('./templates/'.$name.'.'.$ext));
$tpl = '<!-- BEGIN '.$name.'.'.$ext.' -->'.fread ($fd, filesize ('./templates/'.$name.'.'.$ext)).'<!-- END '.$name.'.'.$ext.' -->';

3 ) upload it to your server, visit your forum and take a look at the page source. each time a template is parsed, the beginning and end will appear commented in the html, e.g:

<!-- BEGIN user_logged_in.html --><table class=tbTransparent>
<td class=tbTransparent><span class=txtSm>Logged as: <b>4days</b> » <a href="index.php?mode=logout">Logout</a></span></td>
</table><!-- END user_logged_in.html -->

Author mb
#2 | Posted: 25 Feb 2004 03:37 
Ah, that is really handy! Thanks for sharing, 4days.
- mb

Author Mirsky
#3 | Posted: 28 Feb 2004 21:59 
i have been wonderin' what all the templates were used for...

Author fruitfly
#4 | Posted: 29 Feb 2004 01:50 
YAY!! You have no idea how much headache this has saved me. Thank you very much

Author Team
#5 | Posted: 1 Mar 2004 10:25 
Humm, probably good idea for our next release :)

Author Anonymous
#6 | Posted: 1 Jul 2004 03:11 
i've got v1.7d running, and i can't find the line in the bb_functions.php.

can someone tell me what the new line to edit would be, or somethin?

Author mickeyckm
#7 | Posted: 1 Jul 2004 17:58 
it in the root directory of your forum

Author Anonymous
#8 | Posted: 1 Jul 2004 21:37 
nvm. looked harder, and i found it.

Author _Marco
#9 | Posted: 3 Dec 2005 02:02 
Is there a way to make this work in v2.0 ?
It seems the code has changed and I don't see how to use this.


Author Team
#10 | Posted: 4 Dec 2005 17:10 
The idea for 2.0 is the same - instead of

return $tpl;

you need to paste

return '<!--BEGIN '.$name.'-->'.$tpl.'<!--END '.$name.'-->';

Author _Marco
#11 | Posted: 5 Dec 2005 21:20 
Thank you! This works very well :-)


Master Class miniBB Support Forums / Master Class /
 Debugging templates
 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 our forum posting rules. If not, it may be locked or deleted 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.