|
|
|
|
![]() ![]() |
Nov 14 2007, 12:14 AM
Post
#11
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 522 Joined: 9-February 07 Member No.: 38,519 |
Here is another, simpler, method. Serve a different CSS file based on the time of day. Replace your existing link tag with the following php code. You will need 3 CSS files named according to the file names used in the script, of course, with the background image changed in each one according to the preferred design. CODE <?php $hour = date('H'); if ($hour < 12 ) { echo '<link rel="stylesheet" type="text/css" href="morning.css" />; } elseif ($hour < 17 ) { echo '<link rel="stylesheet" type="text/css" href="day.css" />; } else { echo '<link rel="stylesheet" type="text/css" href="night.css" />; } ?> Untested. No example available. That is actually the way I do my styles for different times of years, except because I'm too lazy to test on my website i do it in javascript, but it's almost the exact same code. Thanks for the code though, I can see it now. |
|
|
|
Nov 14 2007, 10:45 PM
Post
#12
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 150 Joined: 9-April 07 From: Nebraska Member No.: 41,301 |
That's pretty friggin sweet! I didn't know you could name a folder with an extension. I wonder what else you could use that for...
|
|
|
|
Jan 2 2008, 04:02 AM
Post
#13
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,966 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
That's pretty friggin sweet! I didn't know you could name a folder with an extension. I wonder what else you could use that for... This technique can also perform Random Image Generators and a Random sig or avatar rotator script. I have another Tutorial around here on the trap that shows the Random Avatar, I think it is... gif's, png's, jpg's or a combined image script. http://www.trap17.com/forums/index.php?s=&...st&p=350113 There it is... |
|
|
|
Jan 2 2008, 11:49 PM
Post
#14
|
|
|
Moderator ![]() Group: [MODERATOR] Posts: 1,332 Joined: 26-December 04 From: Canada Member No.: 2,940 |
I think this is pretty clever. I saw a lot of professional web designers who actually use the day and night difference, because it makes the site look like a place in real life! It also has sounds that correspond with the time of day. Perhaps that could be your next tutorial when you're bored and want to cook up something else that's as brilliant as this one
|
|
|
|
Jul 19 2008, 04:37 AM
Post
#15
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,966 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
Attention!!!
Someone sent me an email a few days ago about this script not working for them, and I somehow misfiled or deleted the e-mail, so if you have a question, please PM or email me. Thanks for your interest in the script. |
|
|
|
Jul 19 2008, 09:55 AM
Post
#16
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 37 Joined: 18-July 08 Member No.: 65,166 |
Hello everyone,
this right can work in any browser? Few make this idea but try, I'm nob in the world of web design ... I hope that you will understand and support if something does not know I should be .. Thanks for the code |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 29th August 2008 - 06:42 AM |