vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   phrases-what is the template engine? (https://vborg.vbsupport.ru/showthread.php?t=96547)

MamboCube 09-19-2005 08:41 AM

phrases-what is the template engine?
 
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
Code:

<?php echo "$bbuserinfo[username]" ;?>
but i want to use the phrase tags so that i can use values from forms (database) for example

Code:

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

Code:

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

Code:

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

Code:

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


thnx for the help guys


All times are GMT. The time now is 11:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01118 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete