1
faucess
How to change css depending on the time??
  • 2010/8/15 12:31

  • faucess

  • Just popping in

  • Posts: 2

  • Since: 2010/4/26


Hello,

First, apologize for my English hehe.

I'm trying to change the css of a theme depending on time of day. I entered the following code on theme.html but I get errors.
Someone could help me?

date('H');  
if ((
$hour >= 6) and ($hour <= 19))  
{
echo 
"<{$xoops_imageurl}>css/blue.css"
}  
else  
{     
echo 
"<{$xoops_imageurl}>css/red.css"
?> 
" />


I tried to do work in several ways, but I can not.

Thank you very much for your time.

2
playsome
Re: How to change css depending on the time??
  • 2010/8/15 13:44

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hello,

Interesting idea, change the theme depending on time of day.

Although I do not know how you would do this in PHP I have found a javascript which may do it.

<SCRIPT LANGUAGE="JavaScript">

}
script>
<
script language="javascript">getCSS();script>


The code is from this website http://www.katgal.com/2007/03/time-sensitive-css-switcher-change.html.

I hope you get it working.

3
faucess
Re: How to change css depending on the time??
  • 2010/8/15 14:04

  • faucess

  • Just popping in

  • Posts: 2

  • Since: 2010/4/26


Great!

It works perfectly, thank you very much! You took the headache of several days hehe.

Greetings!

Login

Who's Online

794 user(s) are online (79 user(s) are browsing Support Forums)


Members: 0


Guests: 794


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits