Fixed AdmAccount showing logic, added string with message when it’s set to “OPTED OUT” special value

This commit is contained in:
pezcurrel 2022-12-28 17:11:17 +01:00
parent 2b37228a1c
commit a970bd81f6

View file

@ -606,12 +606,13 @@ while ($if<$il && $row=mysqli_fetch_assoc($res)) {
}
$out.='</div></div>'.N;
if (!is_null($row['AdmAccount'])) {
$admacc=nully(null);
$thumb=$prepath.'imgs/AdmAccThumbUnavailable.svg';
if (!is_null($row['AdmAccount']) && $row['AdmAccount']!='OPTED OUT') {
$admacc='<a href="https://'.hspech($row['URI']).'/@'.hspech($row['AdmAccount']).'">'.hspech($row['AdmAccount']).'@'.hspech($row['URI']).'</a>';
($row['AdmAvatar']=='unavailable') ? $thumb=$prepath.'imgs/AdmAccThumbUnavailable.svg' : $thumb=$row['AdmAvatar'];
} else {
$admacc=nully(null);
$thumb=$prepath.'imgs/AdmAccThumbUnavailable.svg';
if ($row['AdmAvatar']!='unavailable') $thumb=$row['AdmAvatar'];
} elseif ($row['AdmAccount']=='OPTED OUT') {
$admacc='<span class="null">'._('Opted out of search engines indexing').'</span>';
}
$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>';