phpbb\user_loader::get_avatar PHP Method

get_avatar() public method

Get avatar
public get_avatar ( integer $user_id, boolean $query = false ) : string
$user_id integer User ID of the user you want to retrieve the avatar for
$query boolean 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()
return string
    public function get_avatar($user_id, $query = false)
    {
        if (!($user = $this->get_user($user_id, $query))) {
            return '';
        }
        $row = array('avatar' => $user['user_avatar'], 'avatar_type' => $user['user_avatar_type'], 'avatar_width' => $user['user_avatar_width'], 'avatar_height' => $user['user_avatar_height']);
        return phpbb_get_avatar($row, 'USER_AVATAR');
    }

Usage Example

Esempio n. 1
0
File: pm.php Progetto: MrAdder/phpbb
 /**
  * Get the user's avatar
  */
 public function get_avatar()
 {
     return $this->user_loader->get_avatar($this->get_data('from_user_id'), false, true);
 }
All Usage Examples Of phpbb\user_loader::get_avatar