Moderated instances and instances moderating are now linked to their card only if they run Mastodon and the last successful check on them is after the graceline

This commit is contained in:
pezcurrel 2024-08-25 00:00:08 +02:00
parent 9278bdec3a
commit 833b097f3d

View file

@ -736,14 +736,18 @@ while ($if<$il && $row=mysqli_fetch_assoc($res)) {
$out.='<div><div class="idlab">'._('Moderated instances').'</div><div class="idesc">';
if ($row['PublicBlocksList']==1) {
$sevmap=['silence'=>_('limited'), 'suspend'=>_('suspended')];
$rres=tquery("SELECT Domain, Severity, Comment, ID FROM InstBlocks LEFT JOIN Instances ON URI=Domain WHERE InstID={$row['ID']} ORDER BY Domain ASC",__LINE__);
$rres=tquery("SELECT Domain, Severity, Comment, ID, IsMastodon, LastOkCheckTS FROM InstBlocks LEFT JOIN Instances ON URI=Domain WHERE InstID={$row['ID']} ORDER BY Domain ASC",__LINE__);
if (mysqli_num_rows($rres)>0) {
$out.='<ul class="nobott">'.N;
while ($rrow=mysqli_fetch_assoc($rres)) {
if (!is_null($rrow['ID']))
$out.="<li><a href=\"?id={$rrow['ID']}\" target=\"_blank\"><strong>{$rrow['Domain']}</strong></a>: {$sevmap[$rrow['Severity']]}";
else
$out.="<li><strong>{$rrow['Domain']}</strong>: {$sevmap[$rrow['Severity']]}";
if (!is_null($rrow['ID']) && $rrow['IsMastodon']+0==1 && $rrow['LastOkCheckTS']+0>=$graceline) {
$aopen="<a href=\"?id={$rrow['ID']}\" target=\"_blank\">";
$aclose='</a>';
} else {
$aopen='';
$aclose='';
}
$out.="<li>{$aopen}<strong>{$rrow['Domain']}</strong>{$aclose}: {$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;
}
@ -758,11 +762,18 @@ while ($if<$il && $row=mysqli_fetch_assoc($res)) {
$out.='<div><div class="idlab">'._('Instances certainly moderating this instance').'</div><div class="idesc">';
$sevmap=['silence'=>_('limitation'), 'suspend'=>_('suspension')];
$rres=tquery("SELECT Severity, Comment, ID, URI FROM InstBlocks LEFT JOIN Instances ON ID=InstID WHERE Domain=\"{$row['URI']}\" ORDER BY URI ASC",__LINE__);
$rres=tquery("SELECT Severity, Comment, ID, URI, IsMastodon, LastOkCheckTS FROM InstBlocks LEFT JOIN Instances ON ID=InstID WHERE Domain=\"{$row['URI']}\" ORDER BY URI ASC",__LINE__);
if (mysqli_num_rows($rres)>0) {
$out.='<ul class="nobott">'.N;
while ($rrow=mysqli_fetch_assoc($rres)) {
$out.="<li><a href=\"?id={$rrow['ID']}\" target=\"_blank\"><strong>{$rrow['URI']}</strong></a>: {$sevmap[$rrow['Severity']]}</li>\n";
if ($rrow['IsMastodon']+0==1 && $rrow['LastOkCheckTS']+0>=$graceline) {
$aopen="<a href=\"?id={$rrow['ID']}\" target=\"_blank\">";
$aclose='</a>';
} else {
$aopen='';
$aclose='';
}
$out.="<li>{$aopen}<strong>{$rrow['URI']}</strong>{$aclose}: {$sevmap[$rrow['Severity']]}</li>\n";
// 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;
}