[feature/avatars] Use deprecated for compatibility function

Also moved use of global variables inside the only if statement they are
used in.

PHPBB3-10018
This commit is contained in:
Marc Alexander 2013-02-03 23:06:30 +01:00
parent f322f4eac9
commit 11aff559d4

View file

@ -17,7 +17,8 @@ if (!defined('IN_PHPBB'))
/** /**
* Get user avatar * 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 string $avatar Users assigned avatar name
* @param int $avatar_type Type of avatar * @param int $avatar_type Type of 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) 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() // map arguments to new function phpbb_get_avatar()
$row = array( $row = array(
'avatar' => $avatar, 'avatar' => $avatar,
@ -42,6 +41,8 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
if (!function_exists('phpbb_get_avatar')) if (!function_exists('phpbb_get_avatar'))
{ {
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_display.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
} }