Added “Instances moderating this instance”

This commit is contained in:
pezcurrel 2024-08-19 10:43:12 +02:00
parent ba0397cb35
commit 09dd49ab63

View file

@ -734,18 +734,38 @@ while ($if<$il && $row=mysqli_fetch_assoc($res)) {
$out.='</div></div>'.N; $out.='</div></div>'.N;
$out.='<div><div class="idlab">'._('Moderated instances').'</div><div class="idesc">'; $out.='<div><div class="idlab">'._('Moderated instances').'</div><div class="idesc">';
$sevmap=['silence'=>_('limited'), 'suspend'=>_('sospeso')]; if ($row['PublicBlocksList']==1) {
$rres=tquery('SELECT Domain, Severity, Comment FROM InstBlocks WHERE InstID='.$row['ID'],__LINE__); $sevmap=['silence'=>_('limited'), 'suspend'=>_('suspended')];
$rres=tquery('SELECT Domain, Severity, Comment FROM InstBlocks WHERE InstID='.$row['ID'],__LINE__);
if (mysqli_num_rows($rres)>0) {
$out.='<ul class="nobott">'.N;
while ($rrow=mysqli_fetch_assoc($rres)) {
$out.='<li><strong>'.hspech($rrow['Domain']).'</strong>: '.$sevmap[$rrow['Severity']];
if (!is_null($rrow['Comment'])) $out.=' ('._('reason').': '.hspech($rrow['Comment']).')';// no strip, do hspech, because moderated instances comments dont support html nor markdown in mastodon
$out.='</li>'.N;
}
$out.='</ul>'.N;
} else {
$out.='<span class="null">'._('None').'</span>';
}
} else {
$out.='<span class="null">'._('Not available{plural}').'</span>';
}
$out.='</div></div>'.N;
$out.='<div><div class="idlab">'._('Instances moderating this instance').'</div><div class="idesc">';
$sevmap=['silence'=>_('limitation'), 'suspend'=>_('suspension')];
$rres=tquery('SELECT Severity, Comment, URI FROM InstBlocks LEFT JOIN Instances ON ID=InstID WHERE Domain="'.$row['URI'].'"',__LINE__);
if (mysqli_num_rows($rres)>0) { if (mysqli_num_rows($rres)>0) {
$out.='<ul class="nobott">'.N; $out.='<ul class="nobott">'.N;
while ($rrow=mysqli_fetch_assoc($rres)) { while ($rrow=mysqli_fetch_assoc($rres)) {
$out.='<li><strong>'.hspech($rrow['Domain']).'</strong>: '.$sevmap[$rrow['Severity']]; $out.='<li><strong>'.hspech($rrow['URI']).'</strong>: '.$sevmap[$rrow['Severity']].'</li>'.N;
if (!is_null($rrow['Comment'])) $out.=' - '.hspech($rrow['Comment']);// no strip, do hspech, because moderated instances comments dont support html nor markdown in mastodon // if (!is_null($rrow['Comment'])) $out.=' ('._('reason').': '.hspech($rrow['Comment']).')';// no strip, do hspech, because moderated instances comments dont support html nor markdown in mastodon
$out.='</li>'.N; // $out.='</li>'.N;
} }
$out.='</ul>'.N; $out.='</ul>'.N;
} else { } else {
$out.='<span class="null">'._('Not available{plural}').'</span>'; $out.='<span class="null">'._('None').'</span>';
} }
$out.='</div></div>'.N; $out.='</div></div>'.N;