MyBB Community Forums

Full Version: Can I change background every 5 minutes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to change the colour of backgroud every five minutes?Wink
Maybe with a plugin. Smile
Ehm..what plugin?
Nothing exists as far as I know.. create a new request thread, maybe someone will make it.
i requires javascript to change the background after a pre requisite interval,
search here www.scriptdungeon.com
Yeah, it's the same as making a logo change every 5 minutes, I think you can use a php file, but I think you can only do it for every refresh, I'll take a look for you. Smile
If it's with MyBB, why not simply check the "lastactive" field/cookie and if it's later than 5 minutes, change the background to something else.

Have a CSS "body" style actually written into the header template:

<style type="text/css">
body {
     background:url({$back_url});
}
</style>

Then somewhere in global.php (preferably hooked into I guess), define the variable {$back_url}.

$threshold = TIME_NOW - 300; // 300 seconds = 5 minutes
$back_array = array(
     1 => "a url",
     2 => "another url"
);
$random = rand(1, 2);
if($mybb->user['lastactive'] < $threshold)
{
     $back_url = $back_array[$rand];
}

Absolutely no idea whether it would work. Just in a "meeeeehh" frame of mind at the moment Toungue
No Tom M , i checked it on local server, it not worked, actually he is asking to change the logo, not the background,
Logo can be changed with a plugin i guess
try searching there http://mods.mybboard.net/mods