The pages you see making up the user-side of vBulletin are generated using a number of templates. Templates are fragments of XHTML code interspersed with PHP variables. These combine together to form complete XHTML pages that are served up to visitors.
A simple example template might look like this:
<table class="tborder">
<tr>
<td class="tcat" colspan="2">My Table</td>
</tr>
$tablebits
</table>
The
$tablebits PHP variable represents an area of the template that will be replaced with either some data, or additional template contents.
For example, we may have another template that looks like this:
<tr>
<td class="alt1">$username</td>
<td class="alt2">$message</td>
</tr>
This template would have the
$username and
$message variables substituted with the appropriate username and message.
<tr>
<td class="alt1">Mister User</td>
<td class="alt2">This is my message</td>
</tr>
The template would then be repeated as many times as necessary, replacing the variables with the username and message for each repetition. Finally, this completed block of XHTML would be inserted into the first template, replacing the
$tablebits variable, resulting in a complete block of code like this:
<table class="tborder">
<tr>
<td class="tcat" colspan="2">My Table</td>
</tr>
<tr>
<td class="alt1">Mister User</td>
<td class="alt2">This is my message</td>
</tr>
<tr>
<td class="alt1">Another Person</td>
<td class="alt2">This message is in reply to that posted above.</td>
</tr>
<tr>
<td class="alt1">Mister User</td>
<td class="alt2">Hey, thanks for responding to my message!</td>
</tr>
</table>
This resulting code can then be passed on to the visitor's web browser for display.
Copyright ©2000 - 2008 Jelsoft Enterprises Limited. All rights reserved. vBulletin® is a registered trademark.