MyBB Community Forums

Full Version: Rotative banners
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What type of code do I have to type? I want to everytime the forum refresh the banner change.

Thanks.
I'm testing it but I don't think that it works in the theme that I'm using. You can check it here: http://www.forumanime-pt.com/index.php

I want to make the big banner rotative, not the logo (ForumAnime-PT...etc).
Point the banner location to a PHP file with this content:

<?php
$rand = rand(1,howevermanyimagesyouhave);
$images[1] = "http://www.forumanime-pt.com/images/alphagaming/mainpic.png";
$images[2] = "http://www.forumanime-pt.com/images/alphagaming/mainpic2.png"; //etc


header("Content-Type: image/png");
echo file_get_contents($images[$rand]);
?>
you can use this...

http://community.mybb.com/thread-107892-...#pid785573

and remove <center></center>
Thanks, Paul H, it worked. Smile

The only problem is the loading time, but I guess that it's because of the size of the images.
Hmm, it might be faster if you replace

header("Content-Type: image/png");
echo file_get_contents($images[$rand]);

with
header("Location: {$images[$rand]}");
That way the banner only changes when I refresh the forum with F5, for example. The first code that you gave me it changes when I visit another page, without refreshing it completely, that's what I'm looking for. Smile

But maybe the second option is better...