aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php64
1 files changed, 9 insertions, 55 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index df1a9a58b9..d7b1b56532 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1067,7 +1067,7 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)
$offset_string = phpbb_format_timezone_offset($offset);
$timezones['GMT' . $offset_string . ' - ' . $timezone] = array(
'tz' => $timezone,
- 'offest' => 'GMT' . $offset_string,
+ 'offset' => 'GMT' . $offset_string,
'current' => $current_time,
);
if ($timezone === $default)
@@ -1084,14 +1084,14 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)
foreach ($timezones as $timezone)
{
- if ($opt_group != $timezone['offest'])
+ if ($opt_group != $timezone['offset'])
{
$tz_select .= ($opt_group) ? '</optgroup>' : '';
- $tz_select .= '<optgroup label="' . $timezone['offest'] . ' - ' . $timezone['current'] . '">';
- $opt_group = $timezone['offest'];
+ $tz_select .= '<optgroup label="' . $timezone['offset'] . ' - ' . $timezone['current'] . '">';
+ $opt_group = $timezone['offset'];
- $selected = ($default_offset == $timezone['offest']) ? ' selected="selected"' : '';
- $tz_dates .= '<option value="' . $timezone['offest'] . ' - ' . $timezone['current'] . '"' . $selected . '>' . $timezone['offest'] . ' - ' . $timezone['current'] . '</option>';
+ $selected = ($default_offset == $timezone['offset']) ? ' selected="selected"' : '';
+ $tz_dates .= '<option value="' . $timezone['offset'] . ' - ' . $timezone['current'] . '"' . $selected . '>' . $timezone['offset'] . ' - ' . $timezone['current'] . '</option>';
}
$label = $timezone['tz'];
@@ -1099,7 +1099,7 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)
{
$label = $user->lang['timezones'][$label];
}
- $title = $timezone['offest'] . ' - ' . $label;
+ $title = $timezone['offset'] . ' - ' . $label;
if ($truncate)
{
@@ -4966,7 +4966,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'U_SEARCH_UNREAD' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unreadposts'),
'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),
'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),
- 'U_CONTACT_US' => ($config['contact_admin_form_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') : '',
+ 'U_CONTACT_US' => ($config['contact_admin_form_enable'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') : '',
'U_TEAM' => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team'),
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
@@ -5338,52 +5338,6 @@ function phpbb_to_numeric($input)
}
/**
-* Convert either 3.0 dbms or 3.1 db driver class name to 3.1 db driver class name.
-*
-* If $dbms is a valid 3.1 db driver class name, returns it unchanged.
-* Otherwise prepends phpbb\db\driver\ to the dbms to convert a 3.0 dbms
-* to 3.1 db driver class name.
-*
-* @param string $dbms dbms parameter
-* @return db driver class
-*/
-function phpbb_convert_30_dbms_to_31($dbms)
-{
- // Note: this check is done first because mysqli extension
- // supplies a mysqli class, and class_exists($dbms) would return
- // true for mysqli class.
- // However, per the docblock any valid 3.1 driver name should be
- // recognized by this function, and have priority over 3.0 dbms.
- if (strpos($dbms, 'phpbb\db\driver') === false && class_exists('phpbb\db\driver\\' . $dbms))
- {
- return 'phpbb\db\driver\\' . $dbms;
- }
-
- if (class_exists($dbms))
- {
- // Additionally we could check that $dbms extends phpbb\db\driver\driver.
- // http://php.net/manual/en/class.reflectionclass.php
- // Beware of possible performance issues:
- // http://stackoverflow.com/questions/294582/php-5-reflection-api-performance
- // We could check for interface implementation in all paths or
- // only when we do not prepend phpbb\db\driver\.
-
- /*
- $reflection = new \ReflectionClass($dbms);
-
- if ($reflection->isSubclassOf('phpbb\db\driver\driver'))
- {
- return $dbms;
- }
- */
-
- return $dbms;
- }
-
- throw new \RuntimeException("You have specified an invalid dbms driver: $dbms");
-}
-
-/**
* Get the board contact details (e.g. for emails)
*
* @param \phpbb\config\config $config
@@ -5412,7 +5366,7 @@ function phpbb_get_board_contact(\phpbb\config\config $config, $phpEx)
*/
function phpbb_get_board_contact_link(\phpbb\config\config $config, $phpbb_root_path, $phpEx)
{
- if ($config['contact_admin_form_enable'])
+ if ($config['contact_admin_form_enable'] && $config['email_enable'])
{
return append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin');
}