diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index b2440a7cf3..2568eb20b2 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3541,91 +3541,6 @@ function phpbb_quoteattr($data, $entities = null) return $data; } -/** -* Get avatar -* -* @deprecated 4.0.0 Use \phpbb\avatar\helper::get_avatar() instead -* -* @param array $row Row cleaned by \phpbb\avatar\manager::clean_row -* @param string $alt Optional language string for alt tag within image, can be a language key or text -* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP -* @param bool $lazy If true, will be lazy loaded (requires JS) -* -* @return string Avatar html -*/ -function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false) -{ - global $user, $config; - global $phpbb_container, $phpbb_dispatcher; - - if (!$config['allow_avatar'] && !$ignore_config) - { - return ''; - } - - $avatar_data = array( - 'src' => $row['avatar'], - 'width' => $row['avatar_width'], - 'height' => $row['avatar_height'], - ); - - /* @var $phpbb_avatar_manager \phpbb\avatar\manager */ - $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); - $driver = $phpbb_avatar_manager->get_driver($row['avatar_type'], !$ignore_config); - $html = ''; - - if ($driver) - { - $html = $driver->get_custom_html($user, $row, $alt); - $avatar_data = $driver->get_data($row); - } - else - { - $avatar_data['src'] = ''; - } - - if (empty($html) && !empty($avatar_data['src'])) - { - if ($lazy) - { - // This path is sent with the base template paths in the assign_vars() - // call below. We need to correct it in case we are accessing from a - // controller because the web paths will be incorrect otherwise. - $phpbb_path_helper = $phpbb_container->get('path_helper'); - $web_path = $phpbb_path_helper->get_web_root_path(); - - $theme = "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme'; - - $src = 'src="' . $theme . '/images/no_avatar.gif" data-src="' . $avatar_data['src'] . '"'; - } - else - { - $src = 'src="' . $avatar_data['src'] . '"'; - } - - $html = ''; - } - - /** - * Event to modify HTML tag of avatar - * - * @event core.get_avatar_after - * @var array row Row cleaned by \phpbb\avatar\manager::clean_row - * @var string alt Optional language string for alt tag within image, can be a language key or text - * @var bool ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP - * @var array avatar_data The HTML attributes for avatar tag - * @var string html The HTML tag of generated avatar - * @since 3.1.6-RC1 - */ - $vars = array('row', 'alt', 'ignore_config', 'avatar_data', 'html'); - extract($phpbb_dispatcher->trigger_event('core.get_avatar_after', compact($vars))); - - return $html; -} - /** * Generate page header */