The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need random number in "header" template
I need a random number in the "header" template to randomly show different type of information. I know I can do this with Javascript but since some of the things I want to display is AdSense code I cannot use Javascript as I would have to slightly modify the AdSense code (which Google does not allow).
So I want to use a hook to define a variable and assign a random number between X and y to it. Then in the "header" template I use an <if> statement to evaluate the variable. Questions: - What hook should I use? - What is the syntax of the variable in the hook? - What is the syntax of the variable in the template? You help is appreaciated. |
#2
|
||||
|
||||
use global_start, the rest is very basic php
also i'd recomment using a $var in the template as opposed to conditionals on the template level. |
#3
|
|||
|
|||
Quote:
- I used hook location "parse_templates" and used the following php code: $random_number = rand(1, 8); - I used the following syntax in the template "header" <if condition="$random_number == 1"> code </if> ... |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|