Made “Threads stats” show better
This commit is contained in:
parent
5ca035757c
commit
734f33dd48
1 changed files with 6 additions and 9 deletions
|
@ -110,11 +110,11 @@ function swmetastats() {
|
|||
let msswitch=document.getElementById("msswitch");
|
||||
if (msshow) {
|
||||
msdiv.style.height="0px";
|
||||
msswitch.innerText="Show Threads suspension / limitation stats";
|
||||
msswitch.innerText="'._('Show Threads suspension / limitation stats').'";
|
||||
msshow=false;
|
||||
} else {
|
||||
msdiv.style.height=msdiv.scrollHeight+"px";
|
||||
msswitch.innerText="Hide Threads suspension / limitation stats";
|
||||
msswitch.innerText="'._('Hide Threads suspension / limitation stats').'";
|
||||
msshow=true;
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ function presub() {
|
|||
$res=mysqli_query($link,'SELECT COUNT(ID) AS tinsts, SUM(UserCount) AS tusers, SUM(StatusCount) AS tstatuses, SUM(ActiveUsersMonth) AS tactusers FROM Instances WHERE Instances.IsMastodon=1 AND Instances.LastOkCheckTS>='.$graceline) or muorimeglio(__LINE__.': '.mysqli_error($link),true);
|
||||
$row=mysqli_fetch_assoc($res);
|
||||
echo(_('<div id="help" class="hiddiv"><p class="intro">This search engine for Mastodon instances is based on a database that gets updated by our crawler every night (CET). Instances are considered new for 30 days after they are discovered. When an instance has not responded to our daily checks for more than 30 days it’s no longer considered in statistics and searches and it gets checked only on the first of the month, rather than daily, until it possibly responds again. “Random ordering” of results varies daily.</p><p class="intro">Default search criteria reflect our fondness for a decentralized and egalitarian Fediverse and our attempt to exclude instances accepting fascist, racist, sexist, ableist or sovereignist contents by marking them as noxious.</p></div>').N);
|
||||
printf(_('<p class="intro">We currently count <span class="statd">%s</span> Mastodon instances, with <span class="statd">%s</span> users (<span class="statd">%s</span> active during last month) and <span class="statd">%s</span> published statuses.</p>').N, fnum($row['tinsts'],0,$dlang), fnum($row['tusers'],0,$dlang), fnum($row['tactusers'],0,$dlang), fnum($row['tstatuses'],0,$dlang));
|
||||
printf(_('<p class="intro">We currently count <span class="statd">%s</span> Mastodon instances, with <span class="statd">%s</span> users (<span class="statd">%s</span> active during last month) and <span class="statd">%s</span> published statuses. <a id="msswitch" onclick="swmetastats();" style="cursor:pointer;">Show Threads suspension / limitation stats</a>.</p>').N, fnum($row['tinsts'],0,$dlang), fnum($row['tusers'],0,$dlang), fnum($row['tactusers'],0,$dlang), fnum($row['tstatuses'],0,$dlang));
|
||||
|
||||
$metastats['known']=[
|
||||
'instances'=>$row['tinsts']-$metastats['unknown']['instances'],
|
||||
|
@ -197,12 +197,8 @@ function presub() {
|
|||
$metastats['suspsil']['kiperc']=100/$metastats['known']['instances']*$metastats['suspsil']['instances'];
|
||||
$metastats['suspsil']['kuperc']=100/$metastats['known']['users']*$metastats['suspsil']['users'];
|
||||
|
||||
//printf(_('<p class="introe">Threads is neither suspended nor limited by <span class="statd">%s</span> instances (<span class="statd">%s</span>%%) with <span class="statd">%s</span> users (<span class="statd">%s</span>%%); it is suspended or limited by <span class="statd">%s</span> instances (<span class="statd">%s</span>%%) with <span class="statd">%s</span> users (<span class="statd">%s</span>%%); it is suspended by <span class="statd">%s</span> instances (<span class="statd">%s</span>%%) with <span class="statd">%s</span> users (<span class="statd">%s</span>%%); it is limited by <span class="statd">%s</span> instances (<span class="statd">%s</span>%%) with <span class="statd">%s</span> users (<span class="statd">%s</span>%%); it is impossible to access the list of moderated instances on <span class="statd">%s</span> instances (<span class="statd">%s</span>%%) with <span class="statd">%s</span> users (<span class="statd">%s</span>%%).</p>').N, $metastats['notsuspsil']['instances'], $metastats['notsuspsil']['iperc'], $metastats['notsuspsil']['users'], $metastats['notsuspsil']['uperc'], $metastats['suspsil']['instances'], $metastats['suspsil']['iperc'], $metastats['suspsil']['users'], $metastats['suspsil']['uperc'], $metastats['suspending']['instances'], $metastats['suspending']['iperc'], $metastats['suspending']['users'], $metastats['suspending']['uperc'], $metastats['silencing']['instances'], $metastats['silencing']['iperc'], $metastats['silencing']['users'], $metastats['silencing']['uperc'], $metastats['unknown']['instances'], $metastats['unknown']['iperc'], $metastats['unknown']['users'], $metastats['unknown']['uperc']);
|
||||
|
||||
echo
|
||||
'<h4><a id="msswitch" onclick="swmetastats();" style="cursor:pointer;">Show Threads suspension / limitation stats</a></h4>
|
||||
|
||||
<div id="metastats" class="hiddiv">
|
||||
'<div id="metastats" class="hiddiv">
|
||||
|
||||
<script language="JavaScript">swmetastats();</script>
|
||||
|
||||
|
@ -328,7 +324,8 @@ function presub() {
|
|||
$p=1;
|
||||
if (array_key_exists('p',$_GET) && preg_match('#^[0-9]+$#',$_GET['p'])===1) $p=$_GET['p']+0;
|
||||
|
||||
echo('<form method="get" id="curvf" name="curvf">
|
||||
echo('<h4>'._('Search instances').'</h4>
|
||||
<form method="get" id="curvf" name="curvf">
|
||||
<input name="exnox" type="hidden" value="'.$_GET['exnox'].'">
|
||||
<input name="exregc" type="hidden" value="'.$_GET['exregc'].'">
|
||||
<input name="exappr" type="hidden" value="'.$_GET['exappr'].'">
|
||||
|
|
Loading…
Reference in a new issue