From 869de98f52e636fd5b9f2a9f5b75d665e7009463 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Jan 2013 00:23:45 +0100 Subject: [PATCH] [feature/avatars] Add include of functions_display.php in BC function The needed function phpbb_get_avatar() is defined in includes/functions_display.php. Include that file in the backwards compatible function get_user_avatar(). PHPBB3-10018 --- phpBB/includes/functions_compatibility.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 11ef982a40..4f96e46417 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -17,7 +17,7 @@ if (!defined('IN_PHPBB')) /** * Get user avatar -* Added in phpBB 3.1.0-A1 +* Compatibility function added: phpBB 3.1.0-A1 * * @param string $avatar Users assigned avatar name * @param int $avatar_type Type of avatar @@ -30,6 +30,8 @@ if (!defined('IN_PHPBB')) */ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false) { + global $phpbb_root_path, $phpEx; + // map arguments to new function phpbb_get_avatar() $row = array( 'avatar' => $avatar, @@ -38,5 +40,10 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $ 'avatar_height' => $avatar_height, ); + if (!function_exists('phpbb_get_avatar')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + return phpbb_get_avatar($row, $alt, $ignore_config); }