The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#4
|
|||
|
|||
![]()
PHP code doesn't get parsed in templates. The variables you see in templates, outside of the conditionals, hold values to be shown on screen. These variables need to be set before the call to the template if they are to show. Consider this example:
Code:
The PHP file: <?php // some vB prep here $foobar = 5; eval('print_output("' . fetch_template('barfoo') . '");'); ?> The template: <!-- template barfoo --> <html><body> $foobar </body></html> <!-- /template barfoo --> The output: '5' is shown on screen Code:
The PHP file: <?php // some vB prep here $foobar = 5; eval('print_output("' . fetch_template('barfoo') . '");'); ?> The template: <!-- template barfoo --> <html><body> <if condition="in_array($foobar, array(1,2,3,4,5))"> $foobar is in the array <else /> $foobar is not in the array </if> </body></html> <!-- /template barfoo --> The output: '5 is in the array' is shown on screen Code:
PHP functions: in_array, is_array, is_numeric, isset, empty, defined, array vBulletin functions: can_moderate, can_moderate_calendar, exec_switch_bg, is_browser, is_member_of More information can be found here, here, and here. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|