1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 01:06:48 +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

@@ -179,9 +179,10 @@ class user_loader
* @param bool $query Should we query the database if this user has not yet been loaded?
* Typically this should be left as false and you should make sure
* you load users ahead of time with load_users()
* @param bool @lazy If true, will be lazy loaded (requires JS)
* @return string
*/
public function get_avatar($user_id, $query = false)
public function get_avatar($user_id, $query = false, $lazy = false)
{
if (!($user = $this->get_user($user_id, $query)))
{
@@ -193,7 +194,7 @@ class user_loader
include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
}
return get_user_avatar($user['user_avatar'], $user['user_avatar_type'], $user['user_avatar_width'], $user['user_avatar_height']);
return get_user_avatar($user['user_avatar'], $user['user_avatar_type'], $user['user_avatar_width'], $user['user_avatar_height'], 'USER_AVATAR', false, $lazy);
}
/**