Log in

View Full Version : New banner on refresh?


Xplorer4x4
08-28-2005, 01:24 PM
I was wodnering how I could make my forums banner change when a page is refreshed?

Bassicly what I am trying to achieve is the same thing that happens here at vbulletin.org. When you refresh or load a new page the forum banner changes randonley.

Could somone please explain how to do this? I would grateley apreciate it. :)

Dan
08-28-2005, 01:52 PM
There are quite a few ways to do it may want to search in google but this is how i accomplish random banner images on my blog.


<?php
$data[] = "image1";
$data[] = "image2";
$data[] = "image3";
$data[] = "image4";
$banner = array_rand($data);
// print out whatever with $banner in it
?>


Put that somewhere torwards the top. (With vBulletin you may need to put this in the php files but I am not sure where it would really go.)


<img href="<?php echo $data["$banner"]; ?>" />


And that would pick the random image!

Xplorer4x4
08-28-2005, 02:09 PM
Thanks anyways but i believe i figuered it out. But suggestions are still welcome :p