03
<?php // Copyright Dane Hidden 2008 // this reads the time from the server so if your expecting it to be // the morning on your background just because it's morning where you // happen to be don't tell me the script is broken. Your Servers time // may be set in a different Time Zone or set to UTC which may be // offset from your present location. You may have to play around // with adding something to the number your server comes up with.a $hour = date('H'); /* // this is the decisioning system it changes the image in the body // background based on the time of day. you can change the times // they are based on 24 hour time. you can also change the image type // or the name even if you are so inclined. This snippet can be used // in any file as long as the images are in the same directory. another // way to implement this that would eventually give a considerable time // savings would be to put the php code snip in a seperate file // named time.php in a subdirectory called time. and call it as an // include per the following example. // <body background="<?PHP echo /time/; include './time/time.php'; ?>" > // play with it a little and see what you can come up with. // also please be honorable and if you use this code for commercial gains // please donate some money to the Leukemia or Cancer Society. // I am a survivor of Leukemia and they helped me out a when I was diagnosed // and throughout my treatments. So Please if you are going to use this code // keep this section intact and help me help others. */ if ($hour > 5 && $hour < 11) { // choose the morning picture echo "morning.png"; } elseif ($hour > 11 && $hour < 18) { // choose the day/afternoon picture echo "day.png"; } else { // choose the night picture echo "night.png"; } ?>