diff options
Diffstat (limited to 'phpBB/includes')
22 files changed, 121 insertions, 68 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 76da43341d..8f9c155ffc 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -90,7 +90,7 @@ class acp_database $time = time(); $filename = 'backup_' . $time . '_' . unique_id(); - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'mysqli': case 'mysql4': @@ -133,7 +133,7 @@ class acp_database else { // We might wanna empty out all that junk :D - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'sqlite': case 'sqlite3': @@ -320,7 +320,7 @@ class acp_database break; } - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'mysql': case 'mysql4': @@ -365,10 +365,10 @@ class acp_database { trigger_error($user->lang['RESTORE_FAILURE'] . adm_back_link($this->u_action), E_USER_WARNING); } - pg_put_line($db->db_connect_id, $sub . "\n"); + pg_put_line($db->get_db_connect_id(), $sub . "\n"); } - pg_put_line($db->db_connect_id, "\\.\n"); - pg_end_copy($db->db_connect_id); + pg_put_line($db->get_db_connect_id(), "\\.\n"); + pg_end_copy($db->get_db_connect_id()); } } break; @@ -623,7 +623,7 @@ class mysql_extractor extends base_extractor if ($new_extract === null) { - if ($db->sql_layer === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>=')) + if ($db->get_sql_layer() === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>=')) { $new_extract = true; } @@ -646,7 +646,7 @@ class mysql_extractor extends base_extractor function write_data($table_name) { global $db; - if ($db->sql_layer === 'mysqli') + if ($db->get_sql_layer() === 'mysqli') { $this->write_data_mysqli($table_name); } @@ -661,7 +661,7 @@ class mysql_extractor extends base_extractor global $db; $sql = "SELECT * FROM $table_name"; - $result = mysqli_query($db->db_connect_id, $sql, MYSQLI_USE_RESULT); + $result = mysqli_query($db->get_db_connect_id(), $sql, MYSQLI_USE_RESULT); if ($result != false) { $fields_cnt = mysqli_num_fields($result); @@ -740,7 +740,7 @@ class mysql_extractor extends base_extractor global $db; $sql = "SELECT * FROM $table_name"; - $result = mysql_unbuffered_query($sql, $db->db_connect_id); + $result = mysql_unbuffered_query($sql, $db->get_db_connect_id()); if ($result != false) { @@ -993,11 +993,11 @@ class sqlite_extractor extends base_extractor { global $db; - $col_types = sqlite_fetch_column_types($db->db_connect_id, $table_name); + $col_types = sqlite_fetch_column_types($db->get_db_connect_id(), $table_name); $sql = "SELECT * FROM $table_name"; - $result = sqlite_unbuffered_query($db->db_connect_id, $sql); + $result = sqlite_unbuffered_query($db->get_db_connect_id(), $sql); $rows = sqlite_fetch_all($result, SQLITE_ASSOC); $sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES ('; foreach ($rows as $row) @@ -1553,11 +1553,11 @@ class mssql_extractor extends base_extractor { global $db; - if ($db->sql_layer === 'mssql') + if ($db->get_sql_layer() === 'mssql') { $this->write_data_mssql($table_name); } - else if($db->sql_layer === 'mssqlnative') + else if($db->get_sql_layer() === 'mssqlnative') { $this->write_data_mssqlnative($table_name); } diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index b2a6820461..aba9caaece 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -137,7 +137,7 @@ class acp_extensions trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); } - if ($phpbb_extension_manager->enabled($ext_name)) + if ($phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -162,7 +162,7 @@ class acp_extensions trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); } - if ($phpbb_extension_manager->enabled($ext_name)) + if ($phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -194,7 +194,7 @@ class acp_extensions break; case 'disable_pre': - if (!$phpbb_extension_manager->enabled($ext_name)) + if (!$phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -209,7 +209,7 @@ class acp_extensions break; case 'disable': - if (!$phpbb_extension_manager->enabled($ext_name)) + if (!$phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -234,7 +234,7 @@ class acp_extensions break; case 'delete_data_pre': - if ($phpbb_extension_manager->enabled($ext_name)) + if ($phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -248,7 +248,7 @@ class acp_extensions break; case 'delete_data': - if ($phpbb_extension_manager->enabled($ext_name)) + if ($phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index f8c463e158..adf5de44f5 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1827,7 +1827,7 @@ class acp_forums } $db->sql_freeresult($result); - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'mysql4': case 'mysqli': diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index b9a6ef17ce..028025b547 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -538,7 +538,7 @@ class acp_icons // The user has already selected a smilies_pak file if ($current == 'delete') { - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'sqlite': case 'sqlite3': diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 247460ec8e..0d0d49774c 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -269,7 +269,7 @@ class acp_main break; case 'db_track': - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'sqlite': case 'sqlite3': @@ -374,7 +374,7 @@ class acp_main foreach ($tables as $table) { - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'sqlite': case 'sqlite3': diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index 9715b9bce8..cd3616208d 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -253,7 +253,7 @@ class acp_permission_roles { $sql = 'SELECT auth_option_id, auth_option FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . " + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . " AND auth_option <> '{$permission_type}' ORDER BY auth_option_id"; $result = $db->sql_query($sql); @@ -315,7 +315,7 @@ class acp_permission_roles // We need to fill the auth options array with ACL_NO options ;) $sql = 'SELECT auth_option_id, auth_option FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . " + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . " AND auth_option <> '{$permission_type}' ORDER BY auth_option_id"; $result = $db->sql_query($sql); @@ -519,7 +519,7 @@ class acp_permission_roles // Get complete auth array $sql = 'SELECT auth_option, auth_option_id FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char); + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()); $result = $db->sql_query($sql); $auth_settings = array(); diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 6540173433..cb408e304f 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -1238,7 +1238,7 @@ class acp_permissions $sql = 'SELECT auth_option_id FROM ' . ACL_OPTIONS_TABLE . ' - WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->any_char); + WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->get_any_char()); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index c291ee43c8..fda6ef25ec 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -112,7 +112,7 @@ class acp_profile $db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id"); $db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id"); - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'sqlite': case 'sqlite3': @@ -1196,7 +1196,7 @@ class acp_profile { global $db; - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'mysql': case 'mysql4': diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 2ddda28afc..a10b248324 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -436,8 +436,8 @@ class acp_prune $sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit'); $where_sql = ''; - $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : ''; - $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : ''; + $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : ''; + $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $email)) . ' ' : ''; $where_sql .= $joined_sql; $where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : ''; diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 9cb5efdbe0..3d7ccf422c 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -219,7 +219,7 @@ class acp_reasons $other_reason_id = (int) $db->sql_fetchfield('reason_id'); $db->sql_freeresult($result); - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { // The ugly one! case 'mysqli': diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index d07120a65f..71880c2267 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2384,7 +2384,7 @@ class acp_users // Select auth options $sql = 'SELECT auth_option, is_local, is_global FROM ' . ACL_OPTIONS_TABLE . ' - WHERE auth_option ' . $db->sql_like_expression($db->any_char . '_') . ' + WHERE auth_option ' . $db->sql_like_expression($db->get_any_char() . '_') . ' AND is_global = 1 ORDER BY auth_option'; $result = $db->sql_query($sql); @@ -2404,7 +2404,7 @@ class acp_users { $sql = 'SELECT auth_option, is_local, is_global FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option " . $db->sql_like_expression($db->any_char . '_') . " + WHERE auth_option " . $db->sql_like_expression($db->get_any_char() . '_') . " AND is_local = 1 ORDER BY is_global DESC, auth_option"; $result = $db->sql_query($sql); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 7bb8e824d6..7ff3212b72 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -1024,7 +1024,7 @@ class auth_admin extends \phpbb\auth\auth // Get permission type $sql = 'SELECT auth_option, auth_option_id FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char); + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()); $result = $db->sql_query($sql); $auth_id_ary = array(); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 32acb0c9ff..9d5770069d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -21,6 +21,37 @@ if (!defined('IN_PHPBB')) // Common global functions /** +* Load the autoloaders added by the extensions. +* +* @param string $phpbb_root_path Path to the phpbb root directory. +*/ +function phpbb_load_extensions_autoloaders($phpbb_root_path) +{ + $iterator = new \RecursiveIteratorIterator( + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator( + $phpbb_root_path . 'ext/', + \FilesystemIterator::SKIP_DOTS + ) + ), + \RecursiveIteratorIterator::SELF_FIRST + ); + $iterator->setMaxDepth(2); + + foreach ($iterator as $file_info) + { + if ($file_info->getFilename() === 'vendor' && $iterator->getDepth() === 2) + { + $filename = $file_info->getRealPath() . '/autoload.php'; + if (file_exists($filename)) + { + require $filename; + } + } + } +} + +/** * Casts a variable to the given type. * * @deprecated @@ -3998,7 +4029,7 @@ function obtain_guest_count($item_id = 0, $item = 'forum') // Get number of online guests - if ($db->sql_layer === 'sqlite' || $db->sql_layer === 'sqlite3') + if ($db->get_sql_layer() === 'sqlite' || $db->get_sql_layer() === 'sqlite3') { $sql = 'SELECT COUNT(session_ip) as num_guests FROM ( @@ -4881,6 +4912,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = 'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0, 'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data), + 'CURRENT_USERNAME_SIMPLE' => get_username_string('no_profile', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'CURRENT_USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'UNREAD_NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', 'NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', @@ -5064,7 +5096,7 @@ function phpbb_generate_debug_output(phpbb\db\driver\driver_interface $db, \phpb if (isset($GLOBALS['starttime'])) { $totaltime = microtime(true) - $GLOBALS['starttime']; - $debug_info[] = sprintf('<abbr title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</abbr>', $db->sql_time, ($totaltime - $db->sql_time), $totaltime); + $debug_info[] = sprintf('<abbr title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</abbr>', $db->get_sql_time(), ($totaltime - $db->get_sql_time()), $totaltime); } $debug_info[] = sprintf('<abbr title="Cached: %d">Queries: %d</abbr>', $db->sql_num_queries(true), $db->sql_num_queries()); diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 6bf8ce2c81..accc8a6a83 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1435,7 +1435,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { case 'topic_moved': $db->sql_transaction('begin'); - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'mysql4': case 'mysqli': @@ -2441,7 +2441,7 @@ function phpbb_cache_moderators($db, $cache, $auth) $cache->destroy('sql', MODERATOR_CACHE_TABLE); // Clear table - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'sqlite': case 'sqlite3': @@ -2491,7 +2491,7 @@ function phpbb_cache_moderators($db, $cache, $auth) AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . " AND ug.user_pending = 0 - AND o.auth_option " . $db->sql_like_expression('m_' . $db->any_char), + AND o.auth_option " . $db->sql_like_expression('m_' . $db->get_any_char()), ); $sql = $db->sql_build_query('SELECT', $sql_ary_deny); $result = $db->sql_query($sql); @@ -2697,11 +2697,11 @@ function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false) return; } - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'mysqli': case 'mysql4': - $sql = 'DELETE ' . (($db->sql_layer === 'mysqli' || version_compare($db->sql_server_info(true), '4.1', '>=')) ? 'z.*' : ZEBRA_TABLE) . ' + $sql = 'DELETE ' . (($db->get_sql_layer() === 'mysqli' || version_compare($db->sql_server_info(true), '4.1', '>=')) ? 'z.*' : ZEBRA_TABLE) . ' FROM ' . ZEBRA_TABLE . ' z, ' . USER_GROUP_TABLE . ' ug WHERE z.zebra_id = ug.user_id AND z.foe = 1 @@ -2854,7 +2854,7 @@ function get_database_size() $database_size = false; // This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0 - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'mysql': case 'mysql4': @@ -2870,7 +2870,7 @@ function get_database_size() if (preg_match('#(3\.23|[45]\.)#', $version)) { - $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->dbname}`" : $db->dbname; + $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name(); $sql = 'SHOW TABLE STATUS FROM ' . $db_name; @@ -2946,7 +2946,7 @@ function get_database_size() if ($row['proname'] == 'pg_database_size') { - $database = $db->dbname; + $database = $db->get_db_name(); if (strpos($database, '.') !== false) { list($database, ) = explode('.', $database); diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 5794d2f403..a00613c26b 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -64,9 +64,10 @@ function phpbb_bootstrap_table_prefix($config_file) * * @param string $config_file * @param string $phpbb_root_path +* @param \phpbb\db\driver\driver_interface $db The generated connection * @return array enabled extensions */ -function phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path) +function phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path, &$db) { $db = phpbb_bootstrap_db_connection($config_file); $table_prefix = phpbb_bootstrap_table_prefix($config_file); @@ -133,7 +134,7 @@ function phpbb_create_install_container($phpbb_root_path, $php_ext) $container->setParameter('core.php_ext', $php_ext); $container->setParameter('core.table_prefix', ''); - $container->register('dbal.conn')->setSynthetic(true); + $container->register('dbal.conn.driver')->setSynthetic(true); $container->setAlias('cache.driver', 'cache.driver.install'); @@ -259,9 +260,10 @@ function phpbb_create_dumped_container_unless_debug($config_file, array $extensi function phpbb_create_default_container($phpbb_root_path, $php_ext) { $config_file = $phpbb_root_path . 'config.' . $php_ext; - $installed_exts = phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path); + $db = null; + $installed_exts = phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path, $db); - return phpbb_create_dumped_container_unless_debug( + $container = phpbb_create_dumped_container_unless_debug( $config_file, array( new \phpbb\di\extension\config($config_file), @@ -275,6 +277,10 @@ function phpbb_create_default_container($phpbb_root_path, $php_ext) $phpbb_root_path, $php_ext ); + + $container->get('dbal.conn')->set_driver($db); + + return $container; } /** diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 74b3e0c70f..ee78364083 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -174,8 +174,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list $template->assign_block_vars('jumpbox_forums', array( 'FORUM_ID' => ($select_all) ? 0 : -1, 'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'], - 'S_FORUM_COUNT' => $iteration) - ); + 'S_FORUM_COUNT' => $iteration, + 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)), + )); $iteration++; $display_jumpbox = true; @@ -188,8 +189,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list 'S_FORUM_COUNT' => $iteration, 'S_IS_CAT' => ($row['forum_type'] == FORUM_CAT) ? true : false, 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, - 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false) - ); + 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false, + 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])), + )); for ($i = 0; $i < $padding; $i++) { @@ -1334,9 +1336,9 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', global $phpbb_root_path, $phpEx; $_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u={USER_ID}'); - $_profile_cache['tpl_noprofile'] = '{USERNAME}'; + $_profile_cache['tpl_noprofile'] = '<span class="username">{USERNAME}</span>'; $_profile_cache['tpl_noprofile_colour'] = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>'; - $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}">{USERNAME}</a>'; + $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}" class="username">{USERNAME}</a>'; $_profile_cache['tpl_profile_colour'] = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>'; } @@ -1452,16 +1454,19 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', /** * Add an option to the quick-mod tools. * + * @param string $url The recepting URL for the quickmod actions. * @param string $option The language key for the value of the option. * @param string $lang_string The language string to use. */ -function phpbb_add_quickmod_option($option, $lang_string) +function phpbb_add_quickmod_option($url, $option, $lang_string) { - global $template, $user; + global $template, $user, $phpbb_path_helper; + $lang_string = $user->lang($lang_string); $template->assign_block_vars('quickmod', array( - 'VALUE' => $option, - 'TITLE' => $lang_string, + 'VALUE' => $option, + 'TITLE' => $lang_string, + 'LINK' => $phpbb_path_helper->append_url_params($url, array('action' => $option)), )); } diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 864a43c6e7..9d480692e9 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1647,7 +1647,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO) switch ($sql_type) { case 'insert': - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'mysql': case 'mysql4': @@ -2041,7 +2041,7 @@ function update_topics_posted() { global $db, $config; - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'sqlite': case 'sqlite3': diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index b5d1573d12..06f49e4b50 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -290,7 +290,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, switch ($dbms_details['DRIVER']) { case 'phpbb\db\driver\mysqli': - if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<')) + if (version_compare(mysqli_get_server_info($db->get_db_connect_id()), '4.1.3', '<')) { $error[] = $lang['INST_ERR_DB_NO_MYSQLI']; } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index d11193e4b0..d39be50251 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1137,7 +1137,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas // Update log $log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_'; - // Add to moderator log, admin log and user notes + // Add to admin log, moderator log and user notes add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log); add_log('mod', 0, 0, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log); if ($mode == 'user') diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 8d926ec70a..da27d8900d 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1350,7 +1350,7 @@ class parse_message extends bbcode_firstpass // NOTE: obtain_* function? chaching the table contents? // For now setting the ttl to 10 minutes - switch ($db->sql_layer) + switch ($db->get_sql_layer()) { case 'mssql': case 'mssql_odbc': diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index f42200d249..94383b935f 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -85,7 +85,16 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Editing information if ($message_row['message_edit_count'] && $config['display_last_edited']) { - $l_edited_by = '<br /><br />' . $user->lang('EDITED_TIMES_TOTAL', (int) $message_row['message_edit_count'], (!$message_row['message_edit_user']) ? $message_row['username'] : $message_row['message_edit_user'], $user->format_date($message_row['message_edit_time'], false, true)); + if (!$message_row['message_edit_user']) + { + $display_username = get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour']); + } + else + { + $edit_user_info = get_user_information($message_row['message_edit_user'], false); + $display_username = get_username_string('full', $message_row['message_edit_user'], $edit_user_info['username'], $edit_user_info['user_colour']); + } + $l_edited_by = '<br /><br />' . $user->lang('EDITED_TIMES_TOTAL', (int) $message_row['message_edit_count'], $display_username, $user->format_date($message_row['message_edit_time'], false, true)); } else { diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 5ba5f1e830..a315b167d7 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -393,8 +393,9 @@ class ucp_profile } $template->assign_vars(array( - 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', - 'JABBER' => $data['jabber'], + 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', + 'S_JABBER_ENABLED' => $config['jab_enable'], + 'JABBER' => $data['jabber'], )); // Get additional profile fields and assign them to the template block var 'profile_fields' |