By jorre on
I'm trying to display a different header image, depending on the time of day at the moment a visitor comes to my site
e.g.
from before 10pm -> image1.jpg
after 10pm -> image2.jpg
I was wondering if it's possible to check on time, based on the time format, drupal is using? Or should I uses the webserver time to accomplish this?
any php functions I could use are welcome, also of course code examples will help a lot.
cheers !
Comments
wake up geezers
wake up geezers ;-)
Pakfriet.be
Uzegt.be
Image or Block Based on Time of Day
I stumbled across this post and thought I would subscribe. It is an interesting idea and I can think of a few places I could use such functionality. I will keep this one in mind.
---
Shane Birley
Left Right Minds
http://www.leftrightminds.com
---
Shane Birley
Left Right Minds
https://www.leftrightminds.com
Image of Block Time of Day: Quick Search with Code
I did a quick search and found some code that may be useful. I haven't tested any of the code, I am just passing this along. The first is just a simple "day" vs. "night" implementation.
This version is a more complex idea from a radio station that displays images of their hosts online during their air time:
---
Shane Birley
Left Right Minds
http://www.leftrightminds.com
---
Shane Birley
Left Right Minds
https://www.leftrightminds.com
Additional Time Based Backgrounds
And, in case anyone cares, here is another site with time based background images:
http://www.aaronrobbins.com/092007/php-function-time-based-background/
---
Shane Birley
Left Right Minds
http://www.leftrightminds.com
---
Shane Birley
Left Right Minds
https://www.leftrightminds.com