From 00b5e5345dc44c99340bba932522b6b05b48dab2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 4 Jun 2012 19:19:34 +0200 Subject: [PATCH] [feature/new-tz-handling] Fix displaying of "All times are" string PHPBB3-9558 --- phpBB/includes/functions.php | 10 +++++++++- phpBB/language/en/common.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 55f7f0531c..44346c7795 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4769,6 +4769,14 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 } } + $dt = new phpbb_datetime('now', $user->tz); + $timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset()); + $timezone_name = $user->tz->getName(); + if (isset($user->lang['timezones'][$timezone_name])) + { + $timezone_name = $user->lang['timezones'][$timezone_name]; + } + // The following assigns all _common_ variables that may be used at any point in a template. $template->assign_vars(array( 'SITENAME' => $config['sitename'], @@ -4836,7 +4844,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right', 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left', 'S_CONTENT_ENCODING' => 'UTF-8', - 'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''), + 'S_TIMEZONE' => sprintf($user->lang['ALL_TIMES'], $timezone_offset, $timezone_name), 'S_DISPLAY_ONLINE_LIST' => ($l_online_time) ? 1 : 0, 'S_DISPLAY_SEARCH' => (!$config['load_search']) ? 0 : (isset($auth) ? ($auth->acl_get('u_search') && $auth->acl_getf_global('f_search')) : 1), 'S_DISPLAY_PM' => ($config['allow_privmsg'] && !empty($user->data['is_registered']) && ($auth->acl_get('u_readpm') || $auth->acl_get('u_sendpm'))) ? true : false, diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 023ee2c89f..bbafb54108 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -74,7 +74,7 @@ $lang = array_merge($lang, array( 'ALL_FORUMS' => 'All forums', 'ALL_MESSAGES' => 'All messages', 'ALL_POSTS' => 'All posts', - 'ALL_TIMES' => 'All times are %1$s %2$s', + 'ALL_TIMES' => 'All times are %1$s', 'ALL_TOPICS' => 'All Topics', 'AND' => 'And', 'ARE_WATCHING_FORUM' => 'You have subscribed to be notified of new posts in this forum.',