From: konrad Date: Sun, 11 Jul 2010 17:24:44 +0000 (+0000) Subject: check timezone settings and fallback to server local on error X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=9cfa9735a75685df5834ec42fdd454f9200d9eee;p=web%2Fkonrad%2Fsmoke.git check timezone settings and fallback to server local on error git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@558 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- diff --git a/www/inc/wext/format.php b/www/inc/wext/format.php index 3458db3..683c1d6 100644 --- a/www/inc/wext/format.php +++ b/www/inc/wext/format.php @@ -21,6 +21,14 @@ class WOServerFormat extends WOServerFormatAbstract $this->loadConfig($template."/format.cfg"); if($lang!="" && preg_match('/^[a-zA-Z0-9_-]+$/',$lang)) $this->loadConfig($template."/".$lang."/format.cfg"); + //check timezone + $tz=$this->gettimezone(); + if($tz==null || $tz==false || $tz==""){ + $this->settimezone(date_default_timezone_get()); + }else{ + if(@timezone_open($tz)===false) + $this->settimezone(date_default_timezone_get()); + } } /**load a configuration file and amend internal state by its definitions*/ diff --git a/www/template/format.cfg b/www/template/format.cfg index c3b5e0b..61aa718 100644 --- a/www/template/format.cfg +++ b/www/template/format.cfg @@ -88,8 +88,10 @@ currencysymbol "Euro" # character 2: the character placed between number and currency symbol moneynegative "-" -#Time Zone in Olsen DB notation +#Time Zone in Olson DB notation # THIS VALUE SHOULD NOT BE CHANGED IN LANGUAGE FOLDERS -# a change of this value directs MagicSmoke to show times for different time zonez -# this value should be set to the zone where the theater is located -timezone "Europe/Berlin" +# a change of this value directs MagicSmoke to show times for different time zones +# this value should be set to the zone where the theater is located; +# if unset the system detects the local time zone on the server +#timezone "Europe/Berlin" +#timezone "America/New_York"