MyBB Community Forums

Full Version: Cycling though Background Images.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I was wondering it would be possible to scroll though background images like you would with this Mod

http://mods.mybb.com/view/mybbanners

But instead of banners it would be backgrounds. I attempted to edit the mybbanners, but I failed because I am not sure how to force it to edit CSS file instead of a template file.
Please help me out.
1) Download and install this: http://mybbhacks.zingaburga.com/showthread.php?tid=464

In your headerinclude template (Ungrouped Templates > headerinclude), add this:

<setvar random>rand(1,5)</setvar>
<if $tplvars['random'] == 1 then>
<style>
body {
background: url('path_to_image');
}
</style>
<elseif $tplvars['random'] == 2 then>
<style>
body {
background: url('path_to_image');
}
</style>
<elseif $tplvars['random'] == 3 then>
<style>
body {
background: url('path_to_image');
}
</style>
<elseif $tplvars['random'] == 4 then>
<style>
body {
background: url('path_to_image');
}
</style>
<elseif $tplvars['random'] == 5 then>
<style>
body {
background: url('path_to_image');
}
</style>
</if>

Replace path_to_image with the path to each image. Smile