1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 05:20:56 +02:00

[ticket/13882] Lazy load the notification avatars.

This moves them further down the waterfall, making the page load
quicker.

PHPBB3-13882
This commit is contained in:
Callum Macrae
2015-05-28 18:05:07 +02:00
parent 44fcdd007f
commit be1d1c7d05
13 changed files with 48 additions and 15 deletions

View File

@@ -30,10 +30,11 @@ if (!defined('IN_PHPBB'))
* @param string $avatar_height Height of users avatar
* @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 image
*/
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, $lazy = false)
{
// map arguments to new function phpbb_get_avatar()
$row = array(
@@ -43,7 +44,7 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
'avatar_height' => $avatar_height,
);
return phpbb_get_avatar($row, $alt, $ignore_config);
return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
}
/**