Made “Exclude instances not surely suspending Threads” “Include only if Threads is surely suspended”

This commit is contained in:
pezcurrel 2023-12-26 23:59:11 +01:00
parent 7a7bdf97ec
commit e185720a4c

View file

@ -155,8 +155,8 @@ function nocrit() {
sethid("exnox"); sethid("exnox");
document.getElementById("cbexregc").checked=false; document.getElementById("cbexregc").checked=false;
sethid("exregc"); sethid("exregc");
document.getElementById("cbexthf").checked=false; document.getElementById("cbinths").checked=false;
sethid("exthf"); sethid("inths");
document.getElementById("cbexappr").checked=false; document.getElementById("cbexappr").checked=false;
sethid("exappr"); sethid("exappr");
document.getElementById("cbexlcko").checked=false; document.getElementById("cbexlcko").checked=false;
@ -290,13 +290,13 @@ function presub() {
$_GET['exregc']=0; $_GET['exregc']=0;
} }
// if ((array_key_exists('exthf',$_GET) && $_GET['exthf']=='1') || !array_key_exists('exthf',$_GET)) { // if ((array_key_exists('inths',$_GET) && $_GET['inths']=='1') || !array_key_exists('inths',$_GET)) {
if (array_key_exists('exthf',$_GET) && $_GET['exthf']=='1') { if (array_key_exists('inths',$_GET) && $_GET['inths']=='1') {
$_GET['cbexthf']=' checked'; $_GET['cbinths']=' checked';
$_GET['exthf']=1; $_GET['inths']=1;
} else { } else {
$_GET['cbexthf']=''; $_GET['cbinths']='';
$_GET['exthf']=0; $_GET['inths']=0;
} }
if (array_key_exists('exappr',$_GET) && $_GET['exappr']=='1') { if (array_key_exists('exappr',$_GET) && $_GET['exappr']=='1') {
@ -380,7 +380,7 @@ function presub() {
<input name="exregc" type="hidden" value="'.$_GET['exregc'].'"> <input name="exregc" type="hidden" value="'.$_GET['exregc'].'">
<input name="exappr" type="hidden" value="'.$_GET['exappr'].'"> <input name="exappr" type="hidden" value="'.$_GET['exappr'].'">
<input name="exlcko" type="hidden" value="'.$_GET['exlcko'].'"> <input name="exlcko" type="hidden" value="'.$_GET['exlcko'].'">
<input name="exthf" type="hidden" value="'.$_GET['exthf'].'"> <input name="inths" type="hidden" value="'.$_GET['inths'].'">
<input name="lang" type="hidden" value="'.$_GET['lang'].'"> <input name="lang" type="hidden" value="'.$_GET['lang'].'">
<input name="desc" type="hidden" value="'.htmlentities($_GET['desc']).'"> <input name="desc" type="hidden" value="'.htmlentities($_GET['desc']).'">
<input name="minu" type="hidden" value="'.$_GET['minu'].'"> <input name="minu" type="hidden" value="'.$_GET['minu'].'">
@ -451,10 +451,10 @@ function presub() {
</div> </div>
</div> </div>
<div class="sdrow"> <div class="sdrow">
<div class="sdlabel"><label for="cbexthf" title="'._('Exclude instances which might not be <i>suspending</i> Metas Threads').'">'._('Exclude if might not be <i>suspending</i> Threads').'</label></div> <div class="sdlabel"><label for="cbinths" title="'._('Include only instances which surely have Metas Threads *suspended*').'">'._('Include only if Threads is surely <i>suspended</i>').'</label></div>
<div class="sdinput"> <div class="sdinput">
<input type="checkbox" class="sckbox" id="cbexthf" value="1"'.$_GET['cbexthf'].' onchange="sethid(\'exthf\');"> <input type="checkbox" class="sckbox" id="cbinths" value="1"'.$_GET['cbinths'].' onchange="sethid(\'inths\');">
<input type="hidden" id="exthf" name="exthf" value="'.$_GET['exthf'].'"> <input type="hidden" id="inths" name="inths" value="'.$_GET['inths'].'">
</div> </div>
</div> </div>
<div class="sdrow"> <div class="sdrow">
@ -513,7 +513,7 @@ function presub() {
$joins[]='LEFT JOIN InstChecks AS InstChecks ON InstChecks.InstID=Instances.ID AND InstChecks.Time=(SELECT MAX(InstChecks.Time) AS MaxTime FROM InstChecks WHERE InstChecks.InstID=Instances.ID)'; $joins[]='LEFT JOIN InstChecks AS InstChecks ON InstChecks.InstID=Instances.ID AND InstChecks.Time=(SELECT MAX(InstChecks.Time) AS MaxTime FROM InstChecks WHERE InstChecks.InstID=Instances.ID)';
$wheres[]='InstChecks.Status=1'; $wheres[]='InstChecks.Status=1';
}*/ }*/
if ($_GET['exthf']==1) $wheres[]='Instances.Threads="suspended"'; if ($_GET['inths']==1) $wheres[]='Instances.Threads="suspended"';
if ($_GET['lang']>0) { if ($_GET['lang']>0) {
$joins[]='LEFT JOIN InstOurLangs ON InstOurLangs.InstID=Instances.ID'; $joins[]='LEFT JOIN InstOurLangs ON InstOurLangs.InstID=Instances.ID';
$wheres[]='(InstOurLangs.OurLangID='.$_GET['lang'].' AND InstOurLangs.Pos=1)'; $wheres[]='(InstOurLangs.OurLangID='.$_GET['lang'].' AND InstOurLangs.Pos=1)';
@ -658,26 +658,26 @@ while ($if<$il && $row=mysqli_fetch_assoc($res)) {
$out.='<div><div class="idlab">'._('Short description').'</div><div class="idesc">'.nully(strip($row['ShortDesc'],$row['URI'])).'</div></div>'.N; $out.='<div><div class="idlab">'._('Short description').'</div><div class="idesc">'.nully(strip($row['ShortDesc'],$row['URI'])).'</div></div>'.N;
$out.='<div><div class="idlab">'._('Long description').'</div><div class="idesc">'.nully(strip($row['LongDesc'],$row['URI'])).'</div></div>'.N; $out.='<div><div class="idlab">'._('Long description').'</div><div class="idesc">'.nully(strip($row['LongDesc'],$row['URI'])).'</div></div>'.N;
$out.='<div><div class="idlab">'._('Server rules').'</div><div class="idesc">'; $out.='<div><div class="idlab">'._('Instance rules').'</div><div class="idesc">';
$rres=tquery('SELECT Text FROM InstRules WHERE InstID='.$row['ID'],__LINE__); $rres=tquery('SELECT Text FROM InstRules WHERE InstID='.$row['ID'],__LINE__);
if (mysqli_num_rows($rres)>0) { if (mysqli_num_rows($rres)>0) {
$out.='<ol class="nobott">'.N; $out.='<ol class="nobott">'.N;
while ($rrow=mysqli_fetch_assoc($rres)) while ($rrow=mysqli_fetch_assoc($rres))
$out.='<li>'.hspech($rrow['Text']).'</li>'.N;// no strip, do hspech, because server rules dont support html nor markdown in mastodon $out.='<li>'.hspech($rrow['Text']).'</li>'.N;// no strip, do hspech, because instance rules dont support html nor markdown in mastodon
$out.='</ol>'.N; $out.='</ol>'.N;
} else { } else {
$out.='<span class="null">'._('Not available{plural}').'</span>'; $out.='<span class="null">'._('Not available{plural}').'</span>';
} }
$out.='</div></div>'.N; $out.='</div></div>'.N;
$out.='<div><div class="idlab">'._('Moderated servers').'</div><div class="idesc">'; $out.='<div><div class="idlab">'._('Moderated instances').'</div><div class="idesc">';
$sevmap=['silence'=>_('limited'), 'suspend'=>_('sospeso')]; $sevmap=['silence'=>_('limited'), 'suspend'=>_('sospeso')];
$rres=tquery('SELECT Domain, Severity, Comment FROM InstBlocks WHERE InstID='.$row['ID'],__LINE__); $rres=tquery('SELECT Domain, Severity, Comment FROM InstBlocks WHERE InstID='.$row['ID'],__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['Domain']).'</strong>: '.$sevmap[$rrow['Severity']];
if (!is_null($rrow['Comment'])) $out.=' - '.hspech($rrow['Comment']);// no strip, do hspech, because moredated server comments dont support html nor markdown in mastodon if (!is_null($rrow['Comment'])) $out.=' - '.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;