The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#8
|
||||
|
||||
![]()
The template system is a powerful dynamic/expandable type system. It's main power comes from the 'eval()'.
Say you have a little template titled "twoPlusTwo", and it contained : Code:
<table cellpadding="0" cellspacing="0" border="0"> <td align="left" valign="center">2 + 2 = $calc_result</td> </table> PHP Code:
The 'gettemplate()' function returns the contents of 'twoPlusTwo', into the string type variable we've named 'twoPlusTwo', at the start of the 'eval()'. You notice the contents of the template has the bit '$calc_result'.... well, because you've put a value into that variable name, the getting the template in this way, puts your value into the template (your value gets expanded, and your dynamic string is created). It's just like doing this : PHP Code:
With this system, you use the gettemplate() function to retrieve all your little bits of the webpage - they are smaller chunks for easier managment, and for giving you more scope. Once you've retrieved all of your templates into string variables, and the data inside has been expanded, you are then ready for output. This is where you need an over-all page layout template. Like this, called 'testPage', for example : Code:
<html> <head> <title>Test</title> </head> <body bgcolor="#ffffff" text="#000000"> This is our example of how the vB template system works. <p> $twoPlusTwo </html> What you then do, once all your page templates are generated in the above way, is make a call to the 'dooutput()' function, like this : PHP Code:
As you now have all your dynamically created templates inside the computer memory, all your variables get expanded in the dooutput() function, and then the dooutput() function simply uses the "echo" to echo the whole job lot out to the browser. It's very powerful, very simple, very very good. I'm not a great teacher... so hopfully i've helped. ![]() ![]() ![]() That's how the system works anyway, and you can use it in any way you see fit. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|