PDA

View Full Version : phrases-what is the template engine?


MamboCube
09-19-2005, 08:41 AM
what exactly is the template engine and how do i use it?

i want to use vb phrases on my non vb pages and was told that u can use the template engine, but i have no idea wat thta is lol

any replies would b great

thnx

Andreas
09-19-2005, 08:49 AM
vBulletin has it's own Template Engine, but that does not have thaat much to do with Phrases.
If you want to use the vBulletin Backend, just require global.php and you will be able to use its Template Engine, Language System, etc.

MamboCube
09-19-2005, 09:27 AM
i have required global.php and the phrases work when i use
<?php echo "$bbuserinfo[username]" ;?>

but i want to use the phrase tags so that i can use values from forms (database) for example

<phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase>

but when i use phrase tags i just get $vbphrase[welcome_x] as text

i tried making a custom phrase but i cant get it to work with php variables

does anyone know how to either use the phrase tags or to include php variables in custom phrases (if its even possible)

??

Marco van Herwaarden
09-19-2005, 09:33 AM
1. Set the 4 required arrays ($phrasegroups, $specialtemplates, $globaltemplates & $actiontemplates), require global.php

2. echo "Phrase: $vbphrase[phrasename]";

3. echo "Phrase with parameters: " . construct_phrase($vbphrase['phrasename'], $myparameter);

MamboCube
09-19-2005, 09:49 AM
like this ?

<?php echo "$vbphrase[welcome_x]";
echo "$bbuserinfo[username]".contsruct_phrase($vbphrase[welcome_x],$bbuserinfo[username]); ?>

because i get this error message

Fatal error: Call to undefined function: contsruct_phrase() in /home/****/public_html/*****/header.php on line 81

have i done something wrong or is it all wrong ?

----------------------------------------------------------------------





right i found out the reason i was getting an error message, it was because i was spelling construct wrong lol, but................ when i put this

<?php
echo "$bbuserinfo[username]".construct_phrase($vbphrase[welcome_x],$bbuserinfo[username]);
?>

i get this

MambocubeWelcome, Mambocube

i cant seem to get rid of the username in front

any ideas?

-------------------------------------------------------------------------
ok i managed to do it by doing this

echo "".construct_phrase($vbphrase['welcome_x'],$bbuserinfo[username]);



thnx for the help guys