miniBB ® 

miniBB

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

Debugging templates

 
Author 4days
Champi0n
#1 | Posted: 25 Feb 2004 00:32 
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));

with:


#--
# $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>
<tr>
<td class=tbTransparent><span class=txtSm>Logged as: <b>4days</b> » <a href="index.php?mode=logout">Logout</a></span></td>
</tr>
</table><!-- END user_logged_in.html -->

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

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

Author fruitfly
Partaker
#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
8-)
#5 | Posted: 1 Mar 2004 10:25 
Humm, probably good idea for our next release :)

Author Anonymous
Guest
#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
Partaker
#7 | Posted: 1 Jul 2004 17:58 
it in the root directory of your forum

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

Author _Marco
Partaker
#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.

_Marco

Author Team
8-)
#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
Partaker
#11 | Posted: 5 Dec 2005 21:20 
Thank you! This works very well :-)

_Marco

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


  ⇑