The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Want to randomly select a header image for each session
I have some experience with PHP, but none with vB. I've just been reskinning my first forum, and would like to be able to randomly select a different header image for each session. I know how I would do this in PHP, but am hoping someone can help me translate it to PHP.
Here's how I would approach the top of each page in PHP: PHP Code:
Where do I put this code in my forum to set the variable, and how do I successfully retrieve the variable in the header template? Thanks for your help. |
#2
|
||||
|
||||
If you're using a version of vBulletin before 3.5.x, I can't help you. For 3.5.x and up, create a plugin at the global_start hook and place your code there.
I generate a random number to grab a random header on my site. Here's the code I use in my plugin: Code:
mt_srand((double)microtime()*1000000); $fb_header_random = mt_rand(1, 9); I use this in my header: HTML Code:
<img alt="" src="/forums/images/header/$fb_header_random.jpg" height="94" width="899" />
|
#3
|
|||
|
|||
Thanks! That worked just fine.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|