MyBB Community Forums

Full Version: Is there?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is there a way where the background, header, and logo image can change automatically every hour of the day?
There isn't plugin to do it. It is possible, but logo change is not easy to do
How can I do it?
there is a tutorial - at least I used it for changing logo (night and day according to the local time).
(2016-09-07, 07:41 PM)Eldenroot Wrote: [ -> ]there is a tutorial - at least I used it for changing logo (night and day according to the local time).

Where is it
The easiest way would be create PHP files:
  • PHP to generate CSS, and @include that in your main.css file
  • PHP to output the desired logo (include the proper Content-Type header!)
Simple jQuery:
var dt = new Date(),
var currentHour = dt.getHours();
$("#logo img").attr("src", "/images/logo_" + currentHour + ".png");

and upload logos in your images forder with naming like 'logo_1.png', 'logo_2.png' and so on ...
(2016-09-07, 09:01 PM)effone Wrote: [ -> ]Simple jQuery:
var dt = new Date(),
var currentHour = dt.getHours();
$("#logo img").attr("src", "/images/logo_" + currentHour + ".png");

and upload logos in your images forder with naming like 'logo_1.png', 'logo_2.png' and so on ...
Thanks but how do I apply this to the background image and background header as well
$('body').css('background', '#000 url(/images/bg_'+currentHour+'.jpg) repeat');

and upload backgrounds in your images forder with naming like 'bg_1.jpg', 'bg_2.jpg' and so on ...
Where will I insert this jquery and what if I have certain CSS for the background? Also, it updates every hour, right?
Pages: 1 2