1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-08 07:36:32 +02:00

Lazy loading added to bbcode images and avatar images by default.

This commit is contained in:
Cameron
2021-10-26 14:57:01 -07:00
parent 723974a0ba
commit 038d88aa2a
3 changed files with 12 additions and 6 deletions

View File

@@ -4109,9 +4109,10 @@ class e_parse
$class = !empty($options['class']) ? $options['class'] : $shape . ' user-avatar';
$style = !empty($options['style']) ? " style='" . $options['style'] . "'" : '';
$loading = !empty($options['loading']) ? " loading='".$options['loading']."'" : " loading='lazy'"; // default to lazy.
$text = $linkStart;
$text .= '<img ' . $id . "class='" . $class . $classOnline . "' alt=\"" . $title . "\" src='" . $url . "' width='" . $width . "' " . $heightInsert . $style . ' />';
$text .= '<img ' . $id . "class='" . $class . $classOnline . "' alt=\"" . $title . "\" src='" . $url . "' width='" . $width . "' " . $heightInsert . $style . $loading . ' />';
$text .= $linkEnd;
// return $url;