1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-25 04:24:31 +02:00

[ticket/15233] Standardize avatar output variables

PHPBB3-15233
This commit is contained in:
mrgoldy
2019-12-16 20:23:45 +01:00
committed by Marc Alexander
parent 3137070d50
commit 7e3d22063a
16 changed files with 182 additions and 50 deletions

View File

@ -1570,7 +1570,7 @@ function phpbb_get_user_rank($user_data, $user_posts)
*/
function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false, $check_can_receive_pm = true)
{
global $config, $auth, $user, $phpEx, $phpbb_root_path, $phpbb_dispatcher;
global $config, $auth, $user, $phpEx, $phpbb_root_path, $phpbb_dispatcher, $phpbb_container;
$username = $data['username'];
$user_id = $data['user_id'];
@ -1653,6 +1653,11 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl
(($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm'])
);
/** @var \phpbb\avatar\helper $avatar_helper */
$avatar_helper = $phpbb_container->get('avatar.helper');
$avatar = $avatar_helper->get_user_avatar($data);
// Dump it out to the template
$template_data = array(
'AGE' => $age,
@ -1669,7 +1674,14 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl
'A_USERNAME' => addslashes(get_username_string('username', $user_id, $username, $data['user_colour'])),
'AVATAR_IMG' => phpbb_get_user_avatar($data),
'AVATAR_IMG' => $avatar['html'],
'AVATAR_LAZY' => $avatar['lazy'],
'AVATAR_SOURCE' => $avatar['src'],
'AVATAR_TITLE' => $avatar['title'],
'AVATAR_TYPE' => $avatar['type'],
'AVATAR_WIDTH' => $avatar['width'],
'AVATAR_HEIGHT' => $avatar['height'],
'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : (($online) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
'S_ONLINE' => ($config['load_onlinetrack'] && $online) ? true : false,
'RANK_IMG' => $user_rank_data['img'],