Topic: change css at a specific time of day?
I've been exploring a "day" and "night" version of my style sheet.
In trying to automate it, i am working to integrate this code by applying it to the header:
Line 65 of header.php
<link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
with
<link rel="stylesheet" href="<?php
// Not sure about this part here, trying to establish the root
echo "/";
// Hours difference (+/-) your board is from the server's time
$offsetfromserver = 0;
$thehour = date('G') + $offsetfromserver;
if ($thehour >=6 && $thehour < 19) {
echo 'style/sheet1.css';
} else {
echo 'style/sheet2.css';
}
?>" type="text/css" media="screen" />
in theory it should work. As an if/else condition this works to display an image, or something else between these hours. But for some reason it's not functional for swapping the style sheet code.
What happens is upon application, all the css information is lost.
What am I doing wrong?