From 79356f54415f901a8ff743817121216cbefb16ee Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 22 Jan 2013 17:21:49 +0100 Subject: [feature/avatars] Add compatibility function for get_user_avatar() PHPBB3-10018 --- phpBB/includes/functions_compatibility.php | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 phpBB/includes/functions_compatibility.php (limited to 'phpBB/includes/functions_compatibility.php') diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php new file mode 100644 index 0000000000..68298449c1 --- /dev/null +++ b/phpBB/includes/functions_compatibility.php @@ -0,0 +1,41 @@ + $avatar, + 'avatar_type' => $avatar_type, + 'avatar_width' => $avatar_width, + 'avatar_height' => $avatar_height, + ); + + return phpbb_get_avatar($row, $alt, $ignore_config); +} -- cgit v1.2.1 From e841453d03003ff0f2c932f5936c17739476ef4f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 22 Jan 2013 21:05:31 +0100 Subject: [feature/avatars] Add note about when compatibility function was added PHPBB3-10018 --- phpBB/includes/functions_compatibility.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_compatibility.php') diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 68298449c1..11ef982a40 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -17,7 +17,8 @@ if (!defined('IN_PHPBB')) /** * Get user avatar -* +* Added in phpBB 3.1.0-A1 +* * @param string $avatar Users assigned avatar name * @param int $avatar_type Type of avatar * @param string $avatar_width Width of users avatar -- cgit v1.2.1 From 869de98f52e636fd5b9f2a9f5b75d665e7009463 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Jan 2013 00:23:45 +0100 Subject: [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(-) (limited to 'phpBB/includes/functions_compatibility.php') 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); } -- cgit v1.2.1 From f322f4eac923a960e6b6ff44c27783000affb3ee Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 3 Feb 2013 23:02:35 +0100 Subject: [feature/avatars] Correct license, copyright and package info PHPBB3-10018 --- phpBB/includes/functions_compatibility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_compatibility.php') diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 4f96e46417..b0655ff291 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -2,7 +2,7 @@ /** * * @package phpBB3 -* @copyright (c) 2005 phpBB Group +* @copyright (c) 2013 phpBB Group * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ -- cgit v1.2.1 From 11aff559d4fcde5c2935aa6ebdfcfbe162d91f64 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 3 Feb 2013 23:06:30 +0100 Subject: [feature/avatars] Use deprecated for compatibility function Also moved use of global variables inside the only if statement they are used in. PHPBB3-10018 --- phpBB/includes/functions_compatibility.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_compatibility.php') diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index b0655ff291..2197815087 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -17,8 +17,9 @@ if (!defined('IN_PHPBB')) /** * Get user avatar -* Compatibility function added: phpBB 3.1.0-A1 -* +* +* @deprecated 3.1.0-a1 (To be removed: 3.3.0) +* * @param string $avatar Users assigned avatar name * @param int $avatar_type Type of avatar * @param string $avatar_width Width of users avatar @@ -30,8 +31,6 @@ 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, @@ -42,6 +41,8 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $ if (!function_exists('phpbb_get_avatar')) { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); } -- cgit v1.2.1