From 9ebee7de323eae3ac86f025f44429d2d4bc995b1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 17 Sep 2014 14:15:16 +0200 Subject: [PATCH 1/8] [ticket/12858] Generate timezone selects with template loop PHPBB3-12858 --- phpBB/includes/acp/acp_board.php | 4 +-- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/functions.php | 25 +++++++++++++++---- phpBB/includes/functions_compatibility.php | 4 +-- phpBB/includes/ucp/ucp_prefs.php | 4 +-- phpBB/includes/ucp/ucp_register.php | 4 +-- .../prosilver/template/timezone_option.html | 14 ++++++++--- 7 files changed, 38 insertions(+), 19 deletions(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index f2707f15ca..160a52a1bf 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -904,9 +904,9 @@ class acp_board */ function timezone_select($value, $key) { - global $user; + global $template, $user; - $timezone_select = phpbb_timezone_select($user, $value, true); + $timezone_select = phpbb_timezone_select($template, $user, $value, true); $timezone_select['tz_select']; return ''; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 40d8218a07..1874bca7fc 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1661,7 +1661,7 @@ class acp_users ${'s_sort_' . $sort_option . '_dir'} .= ''; } - $timezone_selects = phpbb_timezone_select($user, $data['tz'], true); + $timezone_selects = phpbb_timezone_select($template, $user, $data['tz'], true); $user_prefs_data = array( 'S_PREFS' => true, 'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true, diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 7dfaea6f48..7ee8c49161 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1040,13 +1040,14 @@ function phpbb_get_timezone_identifiers($selected_timezone) /** * Options to pick a timezone and date/time * +* @param \phpbb\template\template $template phpBB template object * @param \phpbb\user $user Object of the current user * @param string $default A timezone to select * @param boolean $truncate Shall we truncate the options text * -* @return array Returns an array, also containing the options for the time selector. +* @return array Returns an array containing the options for the time selector. */ -function phpbb_timezone_select($user, $default = '', $truncate = false) +function phpbb_timezone_select($template, $user, $default = '', $truncate = false) { static $timezones; @@ -1078,18 +1079,26 @@ function phpbb_timezone_select($user, $default = '', $truncate = false) uksort($timezones, 'phpbb_tz_select_compare'); } - $tz_select = $tz_dates = $opt_group = ''; + $tz_select = $opt_group = ''; foreach ($timezones as $timezone) { if ($opt_group != $timezone['offset']) { + // Generate tz_select for backwards compatibility $tz_select .= ($opt_group) ? '' : ''; $tz_select .= ''; $opt_group = $timezone['offset']; + $template->assign_block_vars('tz_select', array( + 'LABEL' => $timezone['offset'] . ' - ' . $timezone['current'], + )); $selected = ($default_offset == $timezone['offset']) ? ' selected="selected"' : ''; - $tz_dates .= ''; + $template->assign_block_vars('tz_date', array( + 'VALUE' => $timezone['offset'] . ' - ' . $timezone['current'], + 'SELECTED' => $selected, + 'TITLE' => $timezone['offset'] . ' - ' . $timezone['current'], + )); } $label = $timezone['tz']; @@ -1104,14 +1113,20 @@ function phpbb_timezone_select($user, $default = '', $truncate = false) $label = truncate_string($label, 50, 255, false, '...'); } + // Also generate tz_select for backwards compatibility $selected = ($timezone['tz'] === $default) ? ' selected="selected"' : ''; $tz_select .= ''; + $template->assign_block_vars('tz_select.tz_options', array( + 'TITLE' => $title, + 'VALUE' => $timezone['tz'], + 'SELECTED' => $timezone['tz'] === $default, + 'LABEL' => $label, + )); } $tz_select .= ''; return array( 'tz_select' => $tz_select, - 'tz_dates' => $tz_dates, ); } diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 093cb19538..6db23d9f65 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -133,9 +133,9 @@ function phpbb_clean_path($path) */ function tz_select($default = '', $truncate = false) { - global $user; + global $template, $user; - $timezone_select = phpbb_timezone_select($user, $default, $truncate); + $timezone_select = phpbb_timezone_select($template, $user, $default, $truncate); return $timezone_select['tz_select']; } diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 3ff8fe9ada..6486ca9438 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -154,7 +154,7 @@ class ucp_prefs } $dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . ''; - $timezone_selects = phpbb_timezone_select($user, $data['tz'], true); + $timezone_selects = phpbb_timezone_select($template, $user, $data['tz'], true); // check if there are any user-selectable languages $sql = 'SELECT COUNT(lang_id) as languages_count @@ -208,8 +208,6 @@ class ucp_prefs 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['user_style']), - 'S_TZ_OPTIONS' => $timezone_selects['tz_select'], - 'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'], 'S_CAN_HIDE_ONLINE' => ($auth->acl_get('u_hideonline')) ? true : false, 'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false) ); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 06baf7e5f2..9a15967bae 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -452,7 +452,7 @@ class ucp_register break; } - $timezone_selects = phpbb_timezone_select($user, $data['tz'], true); + $timezone_selects = phpbb_timezone_select($template, $user, $data['tz'], true); $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', 'USERNAME' => $data['username'], @@ -465,8 +465,6 @@ class ucp_register 'L_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])), 'S_LANG_OPTIONS' => language_select($data['lang']), - 'S_TZ_OPTIONS' => $timezone_selects['tz_select'], - 'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'], 'S_TZ_PRESELECT' => !$submit, 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false, 'S_REGISTRATION' => true, diff --git a/phpBB/styles/prosilver/template/timezone_option.html b/phpBB/styles/prosilver/template/timezone_option.html index fc0579bffd..291283c7ca 100644 --- a/phpBB/styles/prosilver/template/timezone_option.html +++ b/phpBB/styles/prosilver/template/timezone_option.html @@ -1,10 +1,12 @@
- + @@ -12,7 +14,13 @@
From 3dbac0f88ba056b19b29fdcabd76074a8dd250d5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 10 Aug 2014 14:12:36 +0200 Subject: [PATCH 2/8] [ticket/12858] Use UTC for time info in footer and hide offset if it's 0 PHPBB3-12858 --- phpBB/includes/functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 7ee8c49161..d5a7bd925b 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -945,6 +945,11 @@ function phpbb_format_timezone_offset($tz_offset) $sign = ($tz_offset < 0) ? '-' : '+'; $time_offset = abs($tz_offset); + if ($time_offset == 0) + { + return ''; + } + $offset_seconds = $time_offset % 3600; $offset_minutes = $offset_seconds / 60; $offset_hours = ($time_offset - $offset_seconds) / 3600; @@ -4913,7 +4918,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = } $dt = $user->create_datetime(); - $timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset()); + $timezone_offset = $user->lang('UTC') . phpbb_format_timezone_offset($dt->getOffset()); $timezone_name = $user->timezone->getName(); if (isset($user->lang['timezones'][$timezone_name])) { From 9a3aeb8a99e7edeb38b5791adf71cfd13059957b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 17 Sep 2014 15:54:00 +0200 Subject: [PATCH 3/8] [ticket/12858] Remove hardcoded language entries from timezone selects PHPBB3-12858 --- phpBB/assets/javascript/core.js | 6 +-- phpBB/includes/functions.php | 30 ++++++----- phpBB/language/en/common.php | 52 ++++++++++--------- .../prosilver/template/timezone_option.html | 2 +- 4 files changed, 47 insertions(+), 43 deletions(-) diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index b5187991f9..6ddbba7515 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -786,7 +786,7 @@ phpbb.timezoneSwitchDate = function(keepSelection) { } if ($tzDate.val() !== '') { - $timezone.children('optgroup').remove(':not([label="' + $('#tz_date').val() + '"])'); + $timezone.children('optgroup').remove(':not([data-tz-value="' + $('#tz_date').val() + '"])'); } if ($tzDate.val() === $tzSelectDateSuggest.attr('data-suggested-tz')) { @@ -795,7 +795,7 @@ phpbb.timezoneSwitchDate = function(keepSelection) { $tzSelectDateSuggest.css('display', 'inline'); } - var $tzOptions = $timezone.children('optgroup[label="' + $tzDate.val() + '"]').children('option'); + var $tzOptions = $timezone.children('optgroup[data-tz-value="' + $tzDate.val() + '"]').children('option'); if ($tzOptions.length === 1) { // If there is only one timezone for the selected date, we just select that automatically. @@ -849,7 +849,7 @@ phpbb.timezonePreselectSelect = function(forceSelector) { minutes = minutes.toString(); } - var prefix = 'GMT' + sign + hours + ':' + minutes; + var prefix = 'UTC' + sign + hours + ':' + minutes; var prefixLength = prefix.length; var selectorOptions = $('option', '#tz_date'); var i; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index d5a7bd925b..0678ea7fda 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -937,15 +937,16 @@ function style_select($default = '', $all = false) * Format the timezone offset with hours and minutes * * @param int $tz_offset Timezone offset in seconds +* @param bool $show_null Whether null offsets should be shown * @return string Normalized offset string: -7200 => -02:00 * 16200 => +04:30 */ -function phpbb_format_timezone_offset($tz_offset) +function phpbb_format_timezone_offset($tz_offset, $show_null = false) { $sign = ($tz_offset < 0) ? '-' : '+'; $time_offset = abs($tz_offset); - if ($time_offset == 0) + if ($time_offset == 0 && $show_null == false) { return ''; } @@ -1068,15 +1069,15 @@ function phpbb_timezone_select($template, $user, $default = '', $truncate = fals $dt = $user->create_datetime('now', $tz); $offset = $dt->getOffset(); $current_time = $dt->format($user->lang['DATETIME_FORMAT'], true); - $offset_string = phpbb_format_timezone_offset($offset); - $timezones['GMT' . $offset_string . ' - ' . $timezone] = array( + $offset_string = phpbb_format_timezone_offset($offset, true); + $timezones['UTC' . $offset_string . ' - ' . $timezone] = array( 'tz' => $timezone, - 'offset' => 'GMT' . $offset_string, + 'offset' => $offset_string, 'current' => $current_time, ); if ($timezone === $default) { - $default_offset = 'GMT' . $offset_string; + $default_offset = 'UTC' . $offset_string; } } unset($unsorted_timezones); @@ -1086,23 +1087,24 @@ function phpbb_timezone_select($template, $user, $default = '', $truncate = fals $tz_select = $opt_group = ''; - foreach ($timezones as $timezone) + foreach ($timezones as $key => $timezone) { if ($opt_group != $timezone['offset']) { // Generate tz_select for backwards compatibility $tz_select .= ($opt_group) ? '' : ''; - $tz_select .= ''; + $tz_select .= ''; $opt_group = $timezone['offset']; $template->assign_block_vars('tz_select', array( - 'LABEL' => $timezone['offset'] . ' - ' . $timezone['current'], + 'LABEL' => $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $timezone['current']), + 'VALUE' => $key . ' - ' . $timezone['current'], )); - $selected = ($default_offset == $timezone['offset']) ? ' selected="selected"' : ''; + $selected = (!empty($default_offset) && strpos($key, $default_offset) !== false) ? ' selected="selected"' : ''; $template->assign_block_vars('tz_date', array( - 'VALUE' => $timezone['offset'] . ' - ' . $timezone['current'], - 'SELECTED' => $selected, - 'TITLE' => $timezone['offset'] . ' - ' . $timezone['current'], + 'VALUE' => $key . ' - ' . $timezone['current'], + 'SELECTED' => !empty($selected), + 'TITLE' => $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $timezone['current']), )); } @@ -1124,7 +1126,7 @@ function phpbb_timezone_select($template, $user, $default = '', $truncate = fals $template->assign_block_vars('tz_select.tz_options', array( 'TITLE' => $title, 'VALUE' => $timezone['tz'], - 'SELECTED' => $timezone['tz'] === $default, + 'SELECTED' => !empty($selected), 'LABEL' => $label, )); } diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 83e1f4eaa1..79d504a67d 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -937,32 +937,34 @@ $lang = array_merge($lang, array( // Timezones can be translated. We use this for the Etc/GMT timezones here, // because they are named invers to their offset. 'timezones' => array( - 'UTC' => 'UTC', + 'UTC' => 'UTC', + 'UTC_OFFSET' => 'UTC%1$s', + 'UTC_OFFSET_CURRENT' => 'UTC%1$s - %2$s', - 'Etc/GMT-12' => 'GMT+12', - 'Etc/GMT-11' => 'GMT+11', - 'Etc/GMT-10' => 'GMT+10', - 'Etc/GMT-9' => 'GMT+9', - 'Etc/GMT-8' => 'GMT+8', - 'Etc/GMT-7' => 'GMT+7', - 'Etc/GMT-6' => 'GMT+6', - 'Etc/GMT-5' => 'GMT+5', - 'Etc/GMT-4' => 'GMT+4', - 'Etc/GMT-3' => 'GMT+3', - 'Etc/GMT-2' => 'GMT+2', - 'Etc/GMT-1' => 'GMT+1', - 'Etc/GMT+1' => 'GMT-1', - 'Etc/GMT+2' => 'GMT-2', - 'Etc/GMT+3' => 'GMT-3', - 'Etc/GMT+4' => 'GMT-4', - 'Etc/GMT+5' => 'GMT-5', - 'Etc/GMT+6' => 'GMT-6', - 'Etc/GMT+7' => 'GMT-7', - 'Etc/GMT+8' => 'GMT-8', - 'Etc/GMT+9' => 'GMT-9', - 'Etc/GMT+10' => 'GMT-10', - 'Etc/GMT+11' => 'GMT-11', - 'Etc/GMT+12' => 'GMT-12', + 'Etc/GMT-12' => 'UTC+12', + 'Etc/GMT-11' => 'UTC+11', + 'Etc/GMT-10' => 'UTC+10', + 'Etc/GMT-9' => 'UTC+9', + 'Etc/GMT-8' => 'UTC+8', + 'Etc/GMT-7' => 'UTC+7', + 'Etc/GMT-6' => 'UTC+6', + 'Etc/GMT-5' => 'UTC+5', + 'Etc/GMT-4' => 'UTC+4', + 'Etc/GMT-3' => 'UTC+3', + 'Etc/GMT-2' => 'UTC+2', + 'Etc/GMT-1' => 'UTC+1', + 'Etc/GMT+1' => 'UTC-1', + 'Etc/GMT+2' => 'UTC-2', + 'Etc/GMT+3' => 'UTC-3', + 'Etc/GMT+4' => 'UTC-4', + 'Etc/GMT+5' => 'UTC-5', + 'Etc/GMT+6' => 'UTC-6', + 'Etc/GMT+7' => 'UTC-7', + 'Etc/GMT+8' => 'UTC-8', + 'Etc/GMT+9' => 'UTC-9', + 'Etc/GMT+10' => 'UTC-10', + 'Etc/GMT+11' => 'UTC-11', + 'Etc/GMT+12' => 'UTC-12', 'Africa/Abidjan' => 'Africa/Abidjan', 'Africa/Accra' => 'Africa/Accra', diff --git a/phpBB/styles/prosilver/template/timezone_option.html b/phpBB/styles/prosilver/template/timezone_option.html index 291283c7ca..8f9017b2ef 100644 --- a/phpBB/styles/prosilver/template/timezone_option.html +++ b/phpBB/styles/prosilver/template/timezone_option.html @@ -15,7 +15,7 @@ - {S_TZ_DATE_OPTIONS} + + +
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 1874bca7fc..c9239e534a 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1700,8 +1700,6 @@ class acp_users 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_STYLE_OPTIONS' => style_select($data['style']), - 'S_TZ_OPTIONS' => $timezone_selects['tz_select'], - 'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'], ); /** From ad596f43909983ab5c61ee9b15838119081d9a2c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 17 Sep 2014 16:04:17 +0200 Subject: [PATCH 5/8] [ticket/12858] Fix timezone select display in subsilver2 PHPBB3-12858 --- .../subsilver2/template/timezone_option.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/subsilver2/template/timezone_option.html b/phpBB/styles/subsilver2/template/timezone_option.html index 0f27719f86..1bb2967855 100644 --- a/phpBB/styles/subsilver2/template/timezone_option.html +++ b/phpBB/styles/subsilver2/template/timezone_option.html @@ -1,18 +1,26 @@ {L_BOARD_TIMEZONE}{L_COLON} - + From 9c310f789ffad41af46b36128f197176dc1f12e3 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 17 Sep 2014 17:52:48 +0200 Subject: [PATCH 6/8] [ticket/12858] Rename tz_ prefixed block variables to timezone_ prefix PHPBB3-12858 --- phpBB/adm/style/timezone_option.html | 20 +++++++++---------- phpBB/includes/functions.php | 10 +++++----- .../prosilver/template/timezone_option.html | 20 +++++++++---------- .../subsilver2/template/timezone_option.html | 20 +++++++++---------- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/phpBB/adm/style/timezone_option.html b/phpBB/adm/style/timezone_option.html index 9b44585ff2..acfff30184 100644 --- a/phpBB/adm/style/timezone_option.html +++ b/phpBB/adm/style/timezone_option.html @@ -1,25 +1,25 @@
- +
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 0678ea7fda..d280ab0f37 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1095,13 +1095,13 @@ function phpbb_timezone_select($template, $user, $default = '', $truncate = fals $tz_select .= ($opt_group) ? '' : ''; $tz_select .= ''; $opt_group = $timezone['offset']; - $template->assign_block_vars('tz_select', array( + $template->assign_block_vars('timezone_select', array( 'LABEL' => $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $timezone['current']), 'VALUE' => $key . ' - ' . $timezone['current'], )); $selected = (!empty($default_offset) && strpos($key, $default_offset) !== false) ? ' selected="selected"' : ''; - $template->assign_block_vars('tz_date', array( + $template->assign_block_vars('timezone_date', array( 'VALUE' => $key . ' - ' . $timezone['current'], 'SELECTED' => !empty($selected), 'TITLE' => $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $timezone['current']), @@ -1113,17 +1113,17 @@ function phpbb_timezone_select($template, $user, $default = '', $truncate = fals { $label = $user->lang['timezones'][$label]; } - $title = $timezone['offset'] . ' - ' . $label; + $title = $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $label); if ($truncate) { $label = truncate_string($label, 50, 255, false, '...'); } - // Also generate tz_select for backwards compatibility + // Also generate timezone_select for backwards compatibility $selected = ($timezone['tz'] === $default) ? ' selected="selected"' : ''; $tz_select .= ''; - $template->assign_block_vars('tz_select.tz_options', array( + $template->assign_block_vars('timezone_select.timezone_options', array( 'TITLE' => $title, 'VALUE' => $timezone['tz'], 'SELECTED' => !empty($selected), diff --git a/phpBB/styles/prosilver/template/timezone_option.html b/phpBB/styles/prosilver/template/timezone_option.html index 8f9017b2ef..b8be456489 100644 --- a/phpBB/styles/prosilver/template/timezone_option.html +++ b/phpBB/styles/prosilver/template/timezone_option.html @@ -1,12 +1,12 @@
- + @@ -14,13 +14,13 @@
diff --git a/phpBB/styles/subsilver2/template/timezone_option.html b/phpBB/styles/subsilver2/template/timezone_option.html index 1bb2967855..3fc7467d16 100644 --- a/phpBB/styles/subsilver2/template/timezone_option.html +++ b/phpBB/styles/subsilver2/template/timezone_option.html @@ -1,26 +1,26 @@ {L_BOARD_TIMEZONE}{L_COLON} - + From f4761b5e0847a95944aaf9b00057eaa059995b81 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 17 Sep 2014 19:07:24 +0200 Subject: [PATCH 7/8] [ticket/12858] Directly return and use timezone selects PHPBB3-12858 --- phpBB/includes/acp/acp_board.php | 3 +-- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/functions.php | 4 +--- phpBB/includes/functions_compatibility.php | 3 +-- phpBB/includes/ucp/ucp_prefs.php | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 160a52a1bf..9c9e32b57c 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -907,9 +907,8 @@ class acp_board global $template, $user; $timezone_select = phpbb_timezone_select($template, $user, $value, true); - $timezone_select['tz_select']; - return ''; + return ''; } /** diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index c9239e534a..31b033604d 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1661,7 +1661,7 @@ class acp_users ${'s_sort_' . $sort_option . '_dir'} .= ''; } - $timezone_selects = phpbb_timezone_select($template, $user, $data['tz'], true); + phpbb_timezone_select($template, $user, $data['tz'], true); $user_prefs_data = array( 'S_PREFS' => true, 'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true, diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index d280ab0f37..4cb4170ac6 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1132,9 +1132,7 @@ function phpbb_timezone_select($template, $user, $default = '', $truncate = fals } $tz_select .= ''; - return array( - 'tz_select' => $tz_select, - ); + return $tz_select; } // Functions handling topic/post tracking/marking diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 6db23d9f65..ea092c83bc 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -135,8 +135,7 @@ function tz_select($default = '', $truncate = false) { global $template, $user; - $timezone_select = phpbb_timezone_select($template, $user, $default, $truncate); - return $timezone_select['tz_select']; + return phpbb_timezone_select($template, $user, $default, $truncate); } /** diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 6486ca9438..2195500b57 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -154,7 +154,7 @@ class ucp_prefs } $dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . ''; - $timezone_selects = phpbb_timezone_select($template, $user, $data['tz'], true); + phpbb_timezone_select($template, $user, $data['tz'], true); // check if there are any user-selectable languages $sql = 'SELECT COUNT(lang_id) as languages_count From 457e13634e3b371fbb5fbf1116c761311a683957 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 19 Sep 2014 23:45:03 +0200 Subject: [PATCH 8/8] [ticket/12858] Properly format UTC offset in footer PHPBB3-12858 --- phpBB/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4cb4170ac6..9bafb48f6b 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4918,7 +4918,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = } $dt = $user->create_datetime(); - $timezone_offset = $user->lang('UTC') . phpbb_format_timezone_offset($dt->getOffset()); + $timezone_offset = $user->lang(array('timezones', 'UTC_OFFSET'), phpbb_format_timezone_offset($dt->getOffset())); $timezone_name = $user->timezone->getName(); if (isset($user->lang['timezones'][$timezone_name])) {