diff --git a/upload/ajax.php b/upload/ajax.php index b2f5da778..ec5d46bd9 100644 --- a/upload/ajax.php +++ b/upload/ajax.php @@ -82,7 +82,9 @@ class ajax_common 'posts' => array('guest'), 'birthday_list' => array('guest'), 'get_forum_mods' => array('guest'), - ); + + 'change_tz' => array('user'), +); var $action = null; @@ -498,5 +500,19 @@ class ajax_common { require(AJAX_DIR .'topic_tpl.php'); } -} + function change_tz() + { + global $bb_cfg, $userdata; + $tz = (int) $this->request['tz']; + if ($tz < -12) $tz = -12; + if ($tz > 13) $tz = 13; + if ($tz != $bb_cfg['board_timezone']) + { + // Set current user timezone + DB()->query("UPDATE ". BB_USERS ." SET user_timezone = $tz WHERE user_id = ". $userdata['user_id'] ." LIMIT 1"); + $bb_cfg['board_timezone'] = $tz; + cache_rm_user_sessions ($userdata['user_id']); + } + } +} diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index 470bc6071..09b949529 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -328,6 +328,26 @@ function OpenInEditor ($file, $line) + + +
diff --git a/upload/templates/default/usercp_register.tpl b/upload/templates/default/usercp_register.tpl index 6f3e6bd80..2cec45127 100644 --- a/upload/templates/default/usercp_register.tpl +++ b/upload/templates/default/usercp_register.tpl @@ -15,6 +15,15 @@ ajax.callback.user_register = function(data){ + + + + +
@@ -130,10 +139,6 @@ ajax.callback.gen_passkey = function(data){ - - - -
{LANGUAGE_SELECT}
{L_TIMEZONE}:{TIMEZONE_SELECT}
{L_PREFERENCES}