PDA

View Full Version : template question


Serge
05-19-2003, 10:32 PM
Ok I just have a real quick question about how vBulletin handels variables in templates. When I say {getserverstats} in a vBulletin template how is it handled. I know that the vairable you are trying to call has to be avalible in the file which is going to call the template but does vBulletin just stick it in there where you have the eval() function that gets the template or is there some kind of phraseing that must go on frist.

I know that was kind of a bad explanation of what I wanted to know but if you can pick up on what I'm saying could you answer it if not I will try to explain more.

Thanks,
Serge

EDIT: would I have to do a switch statement after the query and then take all of the vairables and say something like $post[date]=$date;?

filburt1
05-19-2003, 10:58 PM
{getserverstats} is a replacement.

Here's how eval works in the context of vB. You know that if $somevariable contains "text" and you do:

echo "somevariable = \"$somevariable\"";

...that you'll see somevariable = "text". eval() effectively does the same thing.

Also I have no idea what you're saying.

Serge
05-19-2003, 11:08 PM
Ok bad example I guess. When you are editing vBulletin Templeates and you have a variable inside the template like $hometitle. You call this template inside index.php and the variable is avaible. Would all I have to do is say eval(gettemplate(sometemplate) and it would automactially replace $hometitle with whatever it is defined as inside index.php?