The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
php code in templates
I'm a programmer by profession, but I am still trying to get the hang of Vbulletin.
here is what I am trying to do: I'd like to place a snippet of code in the footer template that creates an array which israndom sorted then spits it out the resultants... basically I'm randomize the display order of ~ 50 images. The code works perfectly in a standalone php page... however when I insert it into the footer template, it obviously does not. so my question is, what is the easiest way of achieving my result? here's a snippet of the php code structure: PHP Code:
|
#2
|
||||
|
||||
The easiest way? Creating a plugin. You can't put PHP code into vBulletin's templates for security purposes. (((Though with the new plugin system this is kind of oxymoronic))).
Put your code in a global_start plugin and assign the output to a variable. Then put that variable in your footer template. |
#3
|
|||
|
|||
Quote:
except I put the php code in the global.php page and instead of echo(ing) the result I'll load it into a variable and up the variable in the footer template my method with global.php did not work. but your plugin method sure did. thanks a million :up: |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|