Skip to content

Commit

Permalink
Added lazy loading
Browse files Browse the repository at this point in the history
  • Loading branch information
GodMod committed Jul 11, 2020
1 parent 9da1a81 commit c211d5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guildnews_portal.class.php
Expand Up @@ -28,7 +28,7 @@ class guildnews_portal extends portal_generic {
protected static $path = 'guildnews';
protected static $data = array(
'name' => 'Guildnews',
'version' => '0.3.0',
'version' => '0.3.1',
'author' => 'GodMod',
'contact' => EQDKP_PROJECT_URL,
'description' => 'Show Guildnews from WoW Armory',
Expand Down Expand Up @@ -68,7 +68,7 @@ public function output() {
chartooltip_js();

//Guildnews
//$arrNews = $this->pdc->get('portal.module.guildnews.'.$this->user->lang_name);
$arrNews = $this->pdc->get('portal.module.guildnews.'.$this->user->lang_name);
if (!$arrNews){
if ($this->config('options')) {
$arrOptions = $this->config('options');
Expand All @@ -86,7 +86,7 @@ public function output() {
$out = '<table class="table fullwidth noborder colorswitch hoverrows">';

foreach ($arrNews as $news){
$icon = (strlen($news['icon'])) ? '<div class="user-avatar-small user-avatar-border"><img src="'.$news['icon'].'" alt="" class="user-avatar small" /></div>' : '';
$icon = (strlen($news['icon'])) ? '<div class="user-avatar-small user-avatar-border"><img src="'.$news['icon'].'" alt="" class="user-avatar small" loading="lazy"/></div>' : '';

if ($this->position == 'middle' || $this->position == 'bottom'){
$out .= '<tr><td width="30">'.$icon.'</td><td>'.$news['text'].'</td><td width="80" class="nowrap">'.$this->time->nice_date($news['date'], 60*60*24*7).'</td></tr>';
Expand Down

0 comments on commit c211d5d

Please sign in to comment.