[geeklog-cvs] geeklog: Check timezone cookie and date_default_timezone_get for...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Nov 1 04:05:50 EST 2009


changeset 7430:a053d9023368
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/a053d9023368
user: Dirk Haun <dirk at haun-online.de>
date: Sun Sep 20 13:37:16 2009 +0200
description:
Check timezone cookie and date_default_timezone_get for the user's preferred time zone

diffstat:

 system/classes/timezoneconfig.class.php |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (21 lines):

diff -r 01f95a3e4545 -r a053d9023368 system/classes/timezoneconfig.class.php
--- a/system/classes/timezoneconfig.class.php	Sun Sep 20 11:14:25 2009 +0200
+++ b/system/classes/timezoneconfig.class.php	Sun Sep 20 13:37:16 2009 +0200
@@ -86,10 +86,17 @@
     {
         global $_CONF, $_USER;
 
+        // handle like the theme cookie, i.e. use if user is not logged in
+        if (isset($_COOKIE[$_CONF['cookie_tzid']]) && empty($_USER['tzid'])) {
+            $_USER['tzid'] = $_COOKIE[$_CONF['cookie_tzid']];
+        }
+
         if (! empty($_USER['tzid'])) {
             $timezone = $_USER['tzid'];
         } elseif (! empty($_CONF['timezone'])) {
             $timezone = $_CONF['timezone'];
+        } elseif (function_exists('date_default_timezone_get')) {
+            $timezone = @date_default_timezone_get();
         } else {
             require_once 'Date/TimeZone.php';
 



More information about the geeklog-cvs mailing list