public static function generateAvatarMarkup($user_id)
    {
        $filetypes = ['jpg', 'gif', 'png'];
        $avatar_markup = '';

        foreach ($filetypes as $cur_type) {
            $path = ForumSettings::get('o_avatars_dir') . '/' . $user_id . '.' . $cur_type;

            if (file_exists(ForumEnv::get('WEB_ROOT') . $path) &&
                $img_size = getimagesize(ForumEnv::get('WEB_ROOT') . $path)
            ) {
                $avatar_markup = '<img class="avatar" src="' .
                    \RunBB\Core\Utils::escape(Container::get('url')->base() . $path . '?m=' .
                        filemtime(ForumEnv::get('WEB_ROOT') . $path)) . '" ' . $img_size[3] . ' alt="" />';
                break;
            }
        }

        return $avatar_markup;
    }
public static function generateAvatarMarkup($user_id)
    {
        $filetypes = ['jpg', 'gif', 'png'];
        $avatar_markup = '';

        foreach ($filetypes as $cur_type) {
            $path = ForumSettings::get('o_avatars_dir') . '/' . $user_id . '.' . $cur_type;

            if (file_exists(ForumEnv::get('WEB_ROOT') . $path) &&
                $img_size = getimagesize(ForumEnv::get('WEB_ROOT') . $path)
            ) {
                $avatar_markup = '<img class="avatar" src="' .
                    \RunBB\Core\Utils::escape(Container::get('url')->base() . $path . '?m=' .
                        filemtime(ForumEnv::get('WEB_ROOT') . $path)) . '" ' . $img_size[3] . ' alt="" />';
                break;
            }
        }

        return $avatar_markup;
    }
public static function generateAvatarMarkup ( $ user_id ) { $ filetypes = [ 'jpg' , 'gif' , 'png' ] ; $ avatar_markup = '' ; foreach ( $ filetypes as $ cur_type ) { $ path = ForumSettings :: get ( 'o_avatars_dir' ) . '/' . $ user_id . '.' . $ cur_type ; if ( file_exists ( ForumEnv :: get ( 'WEB_ROOT' ) . $ path ) && $ img_size = getimagesize ( ForumEnv :: get ( 'WEB_ROOT' ) . $ path ) ) { $ avatar_markup = '<img class="avatar" src="' . \ RunBB \ Core \ Utils :: escape ( Container :: get ( 'url' ) -> base ( ) . $ path . '?m=' . filemtime ( ForumEnv :: get ( 'WEB_ROOT' ) . $ path ) ) . '" ' . $ img_size [ 3 ] . ' alt="" />' ; break ; } } return $ avatar_markup ; }
Outputs markup to display a user's avatar
@param $user_id
@return string
Outputs markup to display a user s avatar