When server thumb or admin avatar are set to “unavailable”, show an “unavailable” image

This commit is contained in:
pezcurrel 2022-12-28 07:02:17 +01:00
parent 6f5de9730e
commit 9d877986a5

View file

@ -507,7 +507,8 @@ while ($if<$il && $row=mysqli_fetch_assoc($res)) {
$buf=array();
while ($rrow=mysqli_fetch_assoc($rres))
$buf[]=hspech($rrow['Lang']);
$out.='<a href="https://'.hspech($row['URI']).'" title="'._('Go to instance').'"><div class="iimgc"><img class="iimg" src="'.$row['Thumb'].'">';
($row['Thumb']=='unavailable') ? $thumb=$prepath.'imgs/InstThumbUnavailable.svg' : $thumb=$row['Thumb'];
$out.='<a href="https://'.hspech($row['URI']).'" title="'._('Go to instance').'"><div class="iimgc"><img class="iimg" src="'.$thumb.'">';
// if (!is_null($row['Priority'])) $out.='<img src="'.$prepath.'imgs/featured-it.svg" class="ifeat">';
if (!is_null($row['Priority'])) $out.='<div class="dfeat">'._('Recommended').'</div>';
$out.='</div></a>'.N;
@ -605,11 +606,14 @@ while ($if<$il && $row=mysqli_fetch_assoc($res)) {
}
$out.='</div></div>'.N;
if (!is_null($row['AdmAccount']))
if (!is_null($row['AdmAccount'])) {
$admacc='<a href="https://'.hspech($row['URI']).'/@'.hspech($row['AdmAccount']).'">'.hspech($row['AdmAccount']).'@'.hspech($row['URI']).'</a>';
else
($row['AdmAvatar']=='unavailable') ? $thumb=$prepath.'imgs/AdmAccThumbUnavailable.svg' : $thumb=$row['AdmAvatar'];
} else {
$admacc=nully(null);
$out.='<div class="abox"><img class="aimg" src="'.$row['AdmAvatar'].'"><div><span class="ilab">'._('Admin account').'</span> '.$admacc.'</div><div><span class="ilab">'._('Date of creation').'</span> '.nully(ldate($row['AdmCreatedAt'],true)).'</div><div><span class="ilab">'._('Admin name').'</span> '.nully(hspech($row['AdmDisplayName'])).'</div><div><div class="idlab">'._('Admin notes').'</div><div class="inote">'.nullyp(strip(trim(n2es($row['AdmNote'])),$row['URI'])).'</div>'.N;
$thumb=$prepath.'imgs/AdmAccThumbUnavailable.svg';
}
$out.='<div class="abox"><img class="aimg" src="'.$thumb.'"><div><span class="ilab">'._('Admin account').'</span> '.$admacc.'</div><div><span class="ilab">'._('Date of creation').'</span> '.nully(ldate($row['AdmCreatedAt'],true)).'</div><div><span class="ilab">'._('Admin name').'</span> '.nully(hspech($row['AdmDisplayName'])).'</div><div><div class="idlab">'._('Admin notes').'</div><div class="inote">'.nullyp(strip(trim(n2es($row['AdmNote'])),$row['URI'])).'</div>'.N;
$out.='</div></div>';
$out.='<div class="ghost"><div class="idlab">'._('Stats').'</div><div class="istat">';