From 0d4968f7356cc177a4a0921eef2853c343798110 Mon Sep 17 00:00:00 2001 From: Crizzo Date: Sat, 15 Mar 2014 15:18:04 +0100 Subject: [PATCH] [ticket/9758] Removed useless if-conditions to include functions.php PHPBB3-9758 --- phpBB/includes/functions_compatibility.php | 7 ------- phpBB/includes/mcp/mcp_notes.php | 4 ---- phpBB/includes/mcp/mcp_warn.php | 4 ---- phpBB/includes/ucp/ucp_pm_viewmessage.php | 5 ----- phpBB/includes/ucp/ucp_profile.php | 4 ---- phpBB/memberlist.php | 7 +------ phpBB/viewtopic.php | 4 ---- 7 files changed, 1 insertion(+), 34 deletions(-) diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index e1539a5493..164dd4cb99 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -39,13 +39,6 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $ 'avatar_height' => $avatar_height, ); - if (!function_exists('phpbb_get_avatar')) - { - global $phpbb_root_path, $phpEx; - - include($phpbb_root_path . 'includes/functions.' . $phpEx); - } - return phpbb_get_avatar($row, $alt, $ignore_config); } diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 9d32467f0f..be8e09b0c3 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -174,10 +174,6 @@ class mcp_notes } // Generate the appropriate user information for the user we are looking at - if (!function_exists('phpbb_get_user_avatar')) - { - include($phpbb_root_path . 'includes/functions.' . $phpEx); - } $rank_title = $rank_img = ''; $avatar_img = phpbb_get_user_avatar($userrow); diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 1d6c71e4c6..418bab4533 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -398,10 +398,6 @@ class mcp_warn } // Generate the appropriate user information for the user we are looking at - if (!function_exists('phpbb_get_user_avatar')) - { - include($phpbb_root_path . 'includes/functions.' . $phpEx); - } get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src); $avatar_img = phpbb_get_user_avatar($user_row); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 0249eee6af..715d99f168 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -338,11 +338,6 @@ function get_user_information($user_id, $user_row) } } - if (!function_exists('phpbb_get_user_avatar')) - { - include($phpbb_root_path . 'includes/functions.' . $phpEx); - } - $user_row['avatar'] = ($user->optionget('viewavatars')) ? phpbb_get_user_avatar($user_row) : ''; get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index a9dec4e2da..76f8988fb9 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -515,10 +515,6 @@ class ucp_profile break; case 'avatar': - if (!function_exists('phpbb_get_user_avatar')) - { - include($phpbb_root_path . 'includes/functions.' . $phpEx); - } add_form_key('ucp_avatar'); diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 905509a7f4..ba4a4372a5 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -547,12 +547,7 @@ switch ($mode) $parse_flags = ($member['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; $member['user_sig'] = generate_text_for_display($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield'], $parse_flags, true); } - - if (!function_exists('phpbb_get_user_avatar')) - { - include($phpbb_root_path . 'includes/functions.' . $phpEx); - } - + $poster_avatar = phpbb_get_user_avatar($member); // We need to check if the modules 'zebra' ('friends' & 'foes' mode), 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index fe0b3dc384..61a28940b1 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -16,10 +16,6 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); include($phpbb_root_path . 'includes/bbcode.' . $phpEx); -if (!function_exists('phpbb_get_user_avatar')) -{ - include($phpbb_root_path . 'includes/functions.' . $phpEx); -} // Start session management $user->session_begin();