mrnewt Posted July 23, 2010 Share Posted July 23, 2010 Hi there, My knowledge in PHP is not as great, but I enjoy learning it as much as I can. Recently I was thinking of trying and create a website that basically has 4 different templates and based on the time of the year/season, the template should change automatically. I tried to find anything similar but I wansn't able to find anything ... yet. Any help that will take me in the right direction (material to look at, functions to consider, etc). Thanks! Link to comment https://forums.phpfreaks.com/topic/208693-changing-styles-based-on-season/ Share on other sites More sharing options...
AbraCadaver Posted July 23, 2010 Share Posted July 23, 2010 Just work out the season (this is not exact as some years the season starts a day later). Then just use the $season var as a template filename or stylesheet filename, etc. if(time() > strtotime('March 19') && time() < strtotime('June 21')) { $season = 'spring'; } elseif(time() > strtotime('June 20') && time() < strtotime('September 22')) { $season = 'summer'; } elseif(time() > strtotime('September 21') && time() < strtotime('December 21')) { $season = 'autumn'; } else { $season = 'winter'; } Link to comment https://forums.phpfreaks.com/topic/208693-changing-styles-based-on-season/#findComment-1090330 Share on other sites More sharing options...
mrnewt Posted July 23, 2010 Author Share Posted July 23, 2010 Cool! Thanks a lot AbraCadaver! This definitely pushed me in the right direction! Link to comment https://forums.phpfreaks.com/topic/208693-changing-styles-based-on-season/#findComment-1090379 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.