2007-11-21, 11:40 AM
Code's a little long
I don't like referring to another PHP file - it's just extra overhead. If you don't mind some file editing, edit your /global.php (what I do):
FIND:
As a bonus, with this method, the images are also cached on the client's computer, so it reduces useless hits and makes their browsing faster
I don't like referring to another PHP file - it's just extra overhead. If you don't mind some file editing, edit your /global.php (what I do):
FIND:
if(!preg_match("#^(\/|\.\.|\.|([a-z0-9]+)://)#i", $theme['logo']))
{
$theme['logo'] = $mybb->settings['bburl']."/".$theme['logo'];
}
REPLACE WITH:$logos = array('picture1.jpg', 'picture2.jpg');
$theme['logo'] = $mybb->settings['bburl']."/images/logo/".$logos[mt_rand(0,count($logos))];
You'll need to upload all your banners into your /images/logo/ folder. All you have to do with the above code is change the first line.As a bonus, with this method, the images are also cached on the client's computer, so it reduces useless hits and makes their browsing faster