![]() |
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. |
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); I use this in my header: HTML Code:
<img alt="" src="/forums/images/header/$fb_header_random.jpg" height="94" width="899" /> |
Thanks! That worked just fine.
|
All times are GMT. The time now is 10:47 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|