Need a custom WordPress theme? I'm available for freelance WordPress work.

Aaron Robbins Adventures In Php And WordPress

Aaron Robbins Adventures In Php And WordPressSkip To Comments

Aaron Robbins Adventures In Php And WordPressPHP Scripts

Aaron Robbins Adventures In Php And WordPress 

Aaron Robbins Adventures In Php And WordPressSubscribe

September 7th, 2007

PHP Function: Time Based Background

Just like the time changing backgrounds that appear when using themes on iGoogle this simple function dynamically inserts css into the head of any web page to change the background and/or background image of an html tag, class or id based on the time of the day. One function call gets the job done with configuration variables to control server time offset (so the time is set to your local time) and the name of the tag, class or id you wish to add the background to.There are currently 6 times phases supported: midnight, dawn, morning, afternoon, dusk and evening. The zip file contains a working demo with images. The demo can also be accessed here.

Download timebg.zip

Comments

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« Previous Post: PHP Function: Keyword Extract
» Next Post: PHP Function: MySQL Row To Form