Integrated Anti-Meta Fedi Pact’s list; optimized debug; some more little changes
This commit is contained in:
parent
9d3230877e
commit
2e5a1619df
1 changed files with 117 additions and 56 deletions
|
@ -19,9 +19,10 @@ $dtzbl=['ca'=>'Europe/Madrid','en'=>'Europe/London','es'=>'Europe/Madrid','fr'=>
|
|||
date_default_timezone_set($dtzbl[$dlang]);*/
|
||||
|
||||
$debug='';
|
||||
$debug.='REQUEST_URI: '.$_SERVER['REQUEST_URI'].N;
|
||||
$debug.='$_GET: '.print_r($_GET,1);
|
||||
$debug.='LOCALE: '.$locale.N;
|
||||
|
||||
debug('REQUEST_URI: '.$_SERVER['REQUEST_URI'].N,$debug);
|
||||
debug('$_GET: '.print_r($_GET,1),$debug);
|
||||
debug('LOCALE: '.$locale.N,$debug);
|
||||
|
||||
// an instance is displayed as "New" if its age, relative to the InsertTS field, is less or equal than this (currently 30 days)
|
||||
$oldline=30*24*60*60;
|
||||
|
@ -110,11 +111,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 moderation statistics').'";
|
||||
msshow=false;
|
||||
} else {
|
||||
msdiv.style.height=msdiv.scrollHeight+"px";
|
||||
msswitch.innerText="'._('Hide Threads suspension / limitation stats').'";
|
||||
msswitch.innerText="'._('Hide Threads moderation statistics').'";
|
||||
msshow=true;
|
||||
}
|
||||
}
|
||||
|
@ -170,26 +171,67 @@ function presub() {
|
|||
</script>
|
||||
'.N);
|
||||
|
||||
$res=tquery('SELECT COUNT(Instances.ID) AS Unknown, SUM(Instances.UserCount) AS UnknownU FROM Instances WHERE Instances.IsMastodon=1 AND Instances.Threads IS NULL AND Instances.LastOkCheckTS>='.$graceline,__LINE__);
|
||||
$fedipactfp='../clitools/fedipact.list';
|
||||
$buf=@file($fedipactfp,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
|
||||
if (!is_array($buf)) {
|
||||
debug('WARNING: could not open «'.$fedipactfp.'».'.N,$debug);
|
||||
$buf=[];
|
||||
}
|
||||
$cfedipact=count($buf);
|
||||
$fedipact['uris']=$buf;
|
||||
foreach ($buf as $val)
|
||||
$fedipact['uris_me'][]=myesc($link,$val);
|
||||
$fedipact['uris_me']='"'.implode('", "',$fedipact['uris_me']).'"';
|
||||
//echo '<pre>'.print_r($fedipact,true).'</pre>'.N;
|
||||
|
||||
$que='SELECT COUNT(ID) AS Unknown, SUM(UserCount) AS UnknownU FROM Instances WHERE IsMastodon=1 AND LastOkCheckTS>='.$graceline.' AND Threads IS NULL';
|
||||
if ($cfedipact>0)
|
||||
$que.=' AND URI NOT IN ('.$fedipact['uris_me'].')';
|
||||
$res=tquery($que,__LINE__);
|
||||
$row=mysqli_fetch_assoc($res);
|
||||
$metastats['unknown']=['instances'=>$row['Unknown'], 'users'=>nulltozero($row['UnknownU'])];
|
||||
|
||||
$res=tquery('SELECT COUNT(Instances.ID) AS Suspending, SUM(Instances.UserCount) AS SuspendingU FROM Instances WHERE Instances.IsMastodon=1 AND Instances.Threads="suspended" AND Instances.LastOkCheckTS>='.$graceline,__LINE__);
|
||||
$que='SELECT COUNT(ID) AS Suspending, SUM(UserCount) AS SuspendingU FROM Instances WHERE IsMastodon=1 AND LastOkCheckTS>='.$graceline;
|
||||
if ($cfedipact>0)
|
||||
$que.=' AND (Threads="suspended" OR URI IN ('.$fedipact['uris_me'].'))';
|
||||
else
|
||||
$que.=' AND Threads="suspended"';
|
||||
$res=tquery($que,__LINE__);
|
||||
$row=mysqli_fetch_assoc($res);
|
||||
$metastats['suspending']=['instances'=>$row['Suspending'], 'users'=>nulltozero($row['SuspendingU'])];
|
||||
|
||||
$res=tquery('SELECT COUNT(Instances.ID) AS Silencing, SUM(Instances.UserCount) AS SilencingU FROM Instances WHERE Instances.IsMastodon=1 AND Instances.Threads="limited" AND Instances.LastOkCheckTS>='.$graceline,__LINE__);
|
||||
$res=tquery('SELECT COUNT(ID) AS Silencing, SUM(UserCount) AS SilencingU FROM Instances WHERE IsMastodon=1 AND LastOkCheckTS>='.$graceline.' AND Threads="limited"',__LINE__);
|
||||
$row=mysqli_fetch_assoc($res);
|
||||
$metastats['silencing']=['instances'=>$row['Silencing'], 'users'=>nulltozero($row['SilencingU'])];
|
||||
$metastats['limiting']=['instances'=>$row['Silencing'], 'users'=>nulltozero($row['SilencingU'])];
|
||||
|
||||
$res=tquery('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,__LINE__);
|
||||
$metastats['fpsuspending']['instances']=0;
|
||||
$metastats['fpsuspending']['users']=0;
|
||||
$metastats['fpliars']['instances']=0;
|
||||
$metastats['fpliars']['users']=0;
|
||||
$metastats['fpliars']['instlist']=[];
|
||||
if ($cfedipact>0) {
|
||||
$res=tquery('SELECT COUNT(ID) AS FPSuspending, SUM(UserCount) AS FPSuspendingU FROM Instances WHERE IsMastodon=1 AND LastOkCheckTS>='.$graceline.' AND URI IN ('.$fedipact['uris_me'].')',__LINE__);
|
||||
$row=mysqli_fetch_assoc($res);
|
||||
$metastats['fpsuspending']['instances']=$row['FPSuspending'];
|
||||
$metastats['fpsuspending']['users']=nulltozero($row['FPSuspendingU']);
|
||||
$res=tquery('SELECT URI, UserCount FROM Instances WHERE IsMastodon=1 AND LastOkCheckTS>='.$graceline.' AND Threads="accessible" AND URI IN ('.$fedipact['uris_me'].')',__LINE__);
|
||||
while ($row=mysqli_fetch_assoc($res)) {
|
||||
$metastats['fpliars']['instances']++;
|
||||
$metastats['fpliars']['users']+=nulltozero($row['UserCount']);
|
||||
$metastats['fpliars']['instlist'][]=['uri'=>$row['URI'], 'usercount'=>nulltozero($row['UserCount'])];
|
||||
}
|
||||
}
|
||||
|
||||
$res=tquery('SELECT COUNT(ID) AS tinsts, SUM(UserCount) AS tusers, SUM(StatusCount) AS tstatuses, SUM(ActiveUsersMonth) AS tactusers FROM Instances WHERE IsMastodon=1 AND LastOkCheckTS>='.$graceline,__LINE__);
|
||||
$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. [<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));
|
||||
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.'<h4><a id="msswitch" onclick="swmetastats();" style="cursor:pointer;">Show Threads moderation statistics</a></h4>'), fnum($row['tinsts'],0,$dlang), fnum($row['tusers'],0,$dlang), fnum($row['tactusers'],0,$dlang), fnum($row['tstatuses'],0,$dlang));
|
||||
|
||||
//echo '<pre>'.print_r($metastats,true).'</pre>'.N;
|
||||
|
||||
$metastats['known']=[
|
||||
'instances'=>$row['tinsts']-$metastats['unknown']['instances'],
|
||||
'users'=>$row['tusers']-$metastats['unknown']['users'],
|
||||
'users'=>$row['tusers']-$metastats['unknown']['users']
|
||||
];
|
||||
$metastats['known']['iperc']=$metastats['known']['instances']*100/$row['tinsts'];
|
||||
$metastats['known']['uperc']=$metastats['known']['users']*100/$row['tusers'];
|
||||
|
@ -202,71 +244,85 @@ function presub() {
|
|||
$metastats['suspending']['kiperc']=$metastats['suspending']['instances']*100/$metastats['known']['instances'];
|
||||
$metastats['suspending']['kuperc']=$metastats['suspending']['users']*100/$metastats['known']['users'];
|
||||
|
||||
$metastats['silencing']['iperc']=$metastats['silencing']['instances']*100/$row['tinsts'];
|
||||
$metastats['silencing']['uperc']=$metastats['silencing']['users']*100/$row['tusers'];
|
||||
$metastats['silencing']['kiperc']=$metastats['silencing']['instances']*100/$metastats['known']['instances'];
|
||||
$metastats['silencing']['kuperc']=$metastats['silencing']['users']*100/$metastats['known']['users'];
|
||||
$metastats['fpsuspending']['iperc']=$metastats['fpsuspending']['instances']*100/$row['tinsts'];
|
||||
$metastats['fpsuspending']['uperc']=$metastats['fpsuspending']['users']*100/$row['tusers'];
|
||||
$metastats['fpsuspending']['kiperc']=$metastats['fpsuspending']['instances']*100/$metastats['known']['instances'];
|
||||
$metastats['fpsuspending']['kuperc']=$metastats['fpsuspending']['users']*100/$metastats['known']['users'];
|
||||
|
||||
$metastats['notsuspsil']=[
|
||||
'instances'=>$row['tinsts']-$metastats['unknown']['instances']-$metastats['suspending']['instances']-$metastats['silencing']['instances'],
|
||||
'users'=>$row['tusers']-$metastats['unknown']['users']-$metastats['suspending']['users']-$metastats['silencing']['users']
|
||||
];
|
||||
$metastats['notsuspsil']['iperc']=$metastats['notsuspsil']['instances']*100/$row['tinsts'];
|
||||
$metastats['notsuspsil']['uperc']=$metastats['notsuspsil']['users']*100/$row['tusers'];
|
||||
$metastats['notsuspsil']['kiperc']=$metastats['notsuspsil']['instances']*100/$metastats['known']['instances'];
|
||||
$metastats['notsuspsil']['kuperc']=$metastats['notsuspsil']['users']*100/$metastats['known']['users'];
|
||||
$metastats['limiting']['iperc']=$metastats['limiting']['instances']*100/$row['tinsts'];
|
||||
$metastats['limiting']['uperc']=$metastats['limiting']['users']*100/$row['tusers'];
|
||||
$metastats['limiting']['kiperc']=$metastats['limiting']['instances']*100/$metastats['known']['instances'];
|
||||
$metastats['limiting']['kuperc']=$metastats['limiting']['users']*100/$metastats['known']['users'];
|
||||
|
||||
$metastats['suspsil']=[
|
||||
'instances'=>$metastats['suspending']['instances']+$metastats['silencing']['instances'],
|
||||
'users'=>$metastats['suspending']['users']+$metastats['silencing']['users']
|
||||
$metastats['notsusporlim']=[
|
||||
'instances'=>$row['tinsts']-$metastats['unknown']['instances']-$metastats['suspending']['instances']-$metastats['limiting']['instances'],
|
||||
'users'=>$row['tusers']-$metastats['unknown']['users']-$metastats['suspending']['users']-$metastats['limiting']['users']
|
||||
];
|
||||
$metastats['suspsil']['iperc']=$metastats['suspsil']['instances']*100/$row['tinsts'];
|
||||
$metastats['suspsil']['uperc']=$metastats['suspsil']['users']*100/$row['tusers'];
|
||||
$metastats['suspsil']['kiperc']=$metastats['suspsil']['instances']*100/$metastats['known']['instances'];
|
||||
$metastats['suspsil']['kuperc']=$metastats['suspsil']['users']*100/$metastats['known']['users'];
|
||||
$metastats['notsusporlim']['iperc']=$metastats['notsusporlim']['instances']*100/$row['tinsts'];
|
||||
$metastats['notsusporlim']['uperc']=$metastats['notsusporlim']['users']*100/$row['tusers'];
|
||||
$metastats['notsusporlim']['kiperc']=$metastats['notsusporlim']['instances']*100/$metastats['known']['instances'];
|
||||
$metastats['notsusporlim']['kuperc']=$metastats['notsusporlim']['users']*100/$metastats['known']['users'];
|
||||
|
||||
$metastats['susporlim']=[
|
||||
'instances'=>$metastats['suspending']['instances']+$metastats['limiting']['instances'],
|
||||
'users'=>$metastats['suspending']['users']+$metastats['limiting']['users']
|
||||
];
|
||||
$metastats['susporlim']['iperc']=$metastats['susporlim']['instances']*100/$row['tinsts'];
|
||||
$metastats['susporlim']['uperc']=$metastats['susporlim']['users']*100/$row['tusers'];
|
||||
$metastats['susporlim']['kiperc']=$metastats['susporlim']['instances']*100/$metastats['known']['instances'];
|
||||
$metastats['susporlim']['kuperc']=$metastats['susporlim']['users']*100/$metastats['known']['users'];
|
||||
|
||||
debug('fpsuspending: instances: '.$metastats['fpsuspending']['instances'].'; users: '.$metastats['fpsuspending']['users'].N.'fpliars: instances: '.$metastats['fpliars']['instances'].'; users: '.$metastats['fpliars']['users'].N,$debug);
|
||||
if (count($metastats['fpliars']['instlist'])>0)
|
||||
foreach ($metastats['fpliars']['instlist'] as $val)
|
||||
debug($val['uri'].': '.$val['usercount'].N,$debug);
|
||||
|
||||
echo
|
||||
'<div id="metastats" class="hiddiv">
|
||||
|
||||
<script language="JavaScript">swmetastats();</script>
|
||||
|
||||
<h5>'._('Stats relative to instances with accessible list of moderated instances').'</h5>
|
||||
<div class="sep"></div>
|
||||
|
||||
<p class="introe">'._('These statistics on the status of Threads moderation are based on the list of moderated instances, which is accessible only on some instances, and on the list of instances adhering to the <a href="https://fedipact.online/" target="_blank">Anti-Meta Fedi Pact</a>.').'</p>
|
||||
|
||||
<h4>'._('Statistics on instances whose<br>Threads moderation status is known').'</h4>
|
||||
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending"></td><td class="ms_leg_td"> '._('Instances suspending Threads').': '.fnum($metastats['suspending']['instances'],0,$dlang).' / '.fnum($metastats['known']['instances'],0,$dlang).' ('.fnum($metastats['suspending']['kiperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_silencing"></td><td class="ms_leg_td"> '._('Instances limiting Threads').': '.fnum($metastats['silencing']['instances'],0,$dlang).' / '.fnum($metastats['known']['instances'],0,$dlang).' ('.fnum($metastats['silencing']['kiperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending"></td><td class="ms_leg_td">+</td><td class="ms_silencing"></td><td class="ms_leg_td"> '._('Instances suspending or limiting Threads').': '.fnum($metastats['suspending']['instances']+$metastats['silencing']['instances'],0,$dlang).' / '.fnum($metastats['known']['instances'],0,$dlang).' ('.fnum($metastats['suspending']['kiperc']+$metastats['silencing']['kiperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_notsuspsil"></td><td class="ms_leg_td"> '._('Instances not suspending or limiting Threads').': '.fnum($metastats['notsuspsil']['instances'],0,$dlang).' / '.fnum($metastats['known']['instances'],0,$dlang).' ('.fnum($metastats['notsuspsil']['kiperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_limiting"></td><td class="ms_leg_td"> '._('Instances limiting Threads').': '.fnum($metastats['limiting']['instances'],0,$dlang).' / '.fnum($metastats['known']['instances'],0,$dlang).' ('.fnum($metastats['limiting']['kiperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending"></td><td class="ms_leg_td">+</td><td class="ms_limiting"></td><td class="ms_leg_td"> '._('Instances suspending or limiting Threads').': '.fnum($metastats['suspending']['instances']+$metastats['limiting']['instances'],0,$dlang).' / '.fnum($metastats['known']['instances'],0,$dlang).' ('.fnum($metastats['suspending']['kiperc']+$metastats['limiting']['kiperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_notsusporlim"></td><td class="ms_leg_td"> '._('Instances not suspending or limiting Threads').': '.fnum($metastats['notsusporlim']['instances'],0,$dlang).' / '.fnum($metastats['known']['instances'],0,$dlang).' ('.fnum($metastats['notsusporlim']['kiperc'],2,$dlang).'%)</td></tr></table>
|
||||
|
||||
<table class="ms_cont"><tr><td class="ms_suspending" style="width:'.$metastats['suspending']['kiperc'].'%"></td><td class="ms_silencing" style="width:'.$metastats['silencing']['kiperc'].'%"></td><td class="ms_notsuspsil" style="width:'.$metastats['notsuspsil']['kiperc'].'%"></td></tr></table>
|
||||
<table class="ms_cont"><tr><td class="ms_suspending" style="width:'.$metastats['suspending']['kiperc'].'%"></td><td class="ms_limiting" style="width:'.$metastats['limiting']['kiperc'].'%"></td><td class="ms_notsusporlim" style="width:'.$metastats['notsusporlim']['kiperc'].'%"></td></tr></table>
|
||||
|
||||
<div class="sep"></div>
|
||||
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending_u"></td><td class="ms_leg_td"> '._('Users on instances suspending Threads').': '.fnum($metastats['suspending']['users'],0,$dlang).' / '.fnum($metastats['known']['users'],0,$dlang).' ('.fnum($metastats['suspending']['kuperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_silencing_u"></td><td class="ms_leg_td"> '._('Users on instances limiting Threads').': '.fnum($metastats['silencing']['users'],0,$dlang).' / '.fnum($metastats['known']['users'],0,$dlang).' ('.fnum($metastats['silencing']['kuperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending_u"></td><td class="ms_leg_td">+</td><td class="ms_silencing_u"></td><td class="ms_leg_td"> '._('Users on instances suspending or limiting Threads').': '.fnum($metastats['suspending']['users']+$metastats['silencing']['users'],0,$dlang).' / '.fnum($metastats['known']['instances'],0,$dlang).' ('.fnum($metastats['suspending']['kuperc']+$metastats['silencing']['kuperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_notsuspsil_u"></td><td class="ms_leg_td"> '._('Users on instances not suspending or limiting Threads').': '.fnum($metastats['notsuspsil']['users'],0,$dlang).' / '.fnum($metastats['known']['users'],0,$dlang).' ('.fnum($metastats['notsuspsil']['kuperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_limiting_u"></td><td class="ms_leg_td"> '._('Users on instances limiting Threads').': '.fnum($metastats['limiting']['users'],0,$dlang).' / '.fnum($metastats['known']['users'],0,$dlang).' ('.fnum($metastats['limiting']['kuperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending_u"></td><td class="ms_leg_td">+</td><td class="ms_limiting_u"></td><td class="ms_leg_td"> '._('Users on instances suspending or limiting Threads').': '.fnum($metastats['suspending']['users']+$metastats['limiting']['users'],0,$dlang).' / '.fnum($metastats['known']['instances'],0,$dlang).' ('.fnum($metastats['suspending']['kuperc']+$metastats['limiting']['kuperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_notsusporlim_u"></td><td class="ms_leg_td"> '._('Users on instances not suspending or limiting Threads').': '.fnum($metastats['notsusporlim']['users'],0,$dlang).' / '.fnum($metastats['known']['users'],0,$dlang).' ('.fnum($metastats['notsusporlim']['kuperc'],2,$dlang).'%)</td></tr></table>
|
||||
|
||||
<table class="ms_cont"><tr><td class="ms_suspending_u" style="width:'.$metastats['suspending']['kuperc'].'%"></td><td class="ms_silencing_u" style="width:'.$metastats['silencing']['kuperc'].'%"></td><td class="ms_notsuspsil_u" style="width:'.$metastats['notsuspsil']['kuperc'].'%"></td></tr></table>
|
||||
<table class="ms_cont"><tr><td class="ms_suspending_u" style="width:'.$metastats['suspending']['kuperc'].'%"></td><td class="ms_limiting_u" style="width:'.$metastats['limiting']['kuperc'].'%"></td><td class="ms_notsusporlim_u" style="width:'.$metastats['notsusporlim']['kuperc'].'%"></td></tr></table>
|
||||
|
||||
<h5>'._('Stats relative to all instances').'</h5>
|
||||
<h4>'._('Statistics on all instances').'</h4>
|
||||
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending"></td><td class="ms_leg_td"> '._('Instances suspending Threads').': '.fnum($metastats['suspending']['instances'],0,$dlang).' / '.fnum($row['tinsts'],0,$dlang).' ('.fnum($metastats['suspending']['iperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_silencing"></td><td class="ms_leg_td"> '._('Instances limiting Threads').': '.fnum($metastats['silencing']['instances'],0,$dlang).' / '.fnum($row['tinsts'],0,$dlang).' ('.fnum($metastats['silencing']['iperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending"></td><td class="ms_leg_td">+</td><td class="ms_silencing"></td><td class="ms_leg_td"> '._('Instances suspending or limiting Threads').': '.fnum($metastats['suspending']['instances']+$metastats['silencing']['instances'],0,$dlang).' / '.fnum($row['tinsts'],0,$dlang).' ('.fnum($metastats['suspending']['iperc']+$metastats['silencing']['iperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_notsuspsil"></td><td class="ms_leg_td"> '._('Instances not suspending or limiting Threads').': '.fnum($metastats['notsuspsil']['instances'],0,$dlang).' / '.fnum($row['tinsts'],0,$dlang).' ('.fnum($metastats['notsuspsil']['iperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_unknown"></td><td class="ms_leg_td"> '._('Instances with unaccessible list of moderated instances').': '.fnum($metastats['unknown']['instances'],0,$dlang).' / '.fnum($row['tinsts'],0,$dlang).' ('.fnum($metastats['unknown']['iperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_limiting"></td><td class="ms_leg_td"> '._('Instances limiting Threads').': '.fnum($metastats['limiting']['instances'],0,$dlang).' / '.fnum($row['tinsts'],0,$dlang).' ('.fnum($metastats['limiting']['iperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending"></td><td class="ms_leg_td">+</td><td class="ms_limiting"></td><td class="ms_leg_td"> '._('Instances suspending or limiting Threads').': '.fnum($metastats['suspending']['instances']+$metastats['limiting']['instances'],0,$dlang).' / '.fnum($row['tinsts'],0,$dlang).' ('.fnum($metastats['suspending']['iperc']+$metastats['limiting']['iperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_notsusporlim"></td><td class="ms_leg_td"> '._('Instances not suspending or limiting Threads').': '.fnum($metastats['notsusporlim']['instances'],0,$dlang).' / '.fnum($row['tinsts'],0,$dlang).' ('.fnum($metastats['notsusporlim']['iperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_unknown"></td><td class="ms_leg_td"> '._('Instances whose Threads moderation status is unknown').': '.fnum($metastats['unknown']['instances'],0,$dlang).' / '.fnum($row['tinsts'],0,$dlang).' ('.fnum($metastats['unknown']['iperc'],2,$dlang).'%)</td></tr></table>
|
||||
|
||||
<table class="ms_cont"><tr><td class="ms_suspending" style="width:'.$metastats['suspending']['iperc'].'%"></td><td class="ms_silencing" style="width:'.$metastats['silencing']['iperc'].'%"></td><td class="ms_notsuspsil" style="width:'.$metastats['notsuspsil']['iperc'].'%"></td><td class="ms_unknown" style="width:'.$metastats['unknown']['iperc'].'%"></td></tr></table>
|
||||
<table class="ms_cont"><tr><td class="ms_suspending" style="width:'.$metastats['suspending']['iperc'].'%"></td><td class="ms_limiting" style="width:'.$metastats['limiting']['iperc'].'%"></td><td class="ms_notsusporlim" style="width:'.$metastats['notsusporlim']['iperc'].'%"></td><td class="ms_unknown" style="width:'.$metastats['unknown']['iperc'].'%"></td></tr></table>
|
||||
|
||||
<div class="sep"></div>
|
||||
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending_u"></td><td class="ms_leg_td"> '._('Users on instances suspending Threads').': '.fnum($metastats['suspending']['users'],0,$dlang).' / '.fnum($row['tusers'],0,$dlang).' ('.fnum($metastats['suspending']['uperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_silencing_u"></td><td class="ms_leg_td"> '._('Users on instances limiting Threads').': '.fnum($metastats['silencing']['users'],0,$dlang).' / '.fnum($row['tusers'],0,$dlang).' ('.fnum($metastats['silencing']['uperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending_u"></td><td class="ms_leg_td">+</td><td class="ms_silencing_u"></td><td class="ms_leg_td"> '._('Users on instances suspending or limiting Threads').': '.fnum($metastats['suspending']['users']+$metastats['silencing']['users'],0,$dlang).' / '.fnum($row['tusers'],0,$dlang).' ('.fnum($metastats['suspending']['uperc']+$metastats['silencing']['uperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_notsuspsil_u"></td><td class="ms_leg_td"> '._('Users on instances not suspending or limiting Threads').': '.fnum($metastats['notsuspsil']['users'],0,$dlang).' / '.fnum($row['tusers'],0,$dlang).' ('.fnum($metastats['notsuspsil']['uperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_unknown_u"></td><td class="ms_leg_td"> '._('Users on instances with unaccessible list of moderated instances').': '.fnum($metastats['unknown']['users'],0,$dlang).' / '.fnum($row['tusers'],0,$dlang).' ('.fnum($metastats['unknown']['uperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_limiting_u"></td><td class="ms_leg_td"> '._('Users on instances limiting Threads').': '.fnum($metastats['limiting']['users'],0,$dlang).' / '.fnum($row['tusers'],0,$dlang).' ('.fnum($metastats['limiting']['uperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_suspending_u"></td><td class="ms_leg_td">+</td><td class="ms_limiting_u"></td><td class="ms_leg_td"> '._('Users on instances suspending or limiting Threads').': '.fnum($metastats['suspending']['users']+$metastats['limiting']['users'],0,$dlang).' / '.fnum($row['tusers'],0,$dlang).' ('.fnum($metastats['suspending']['uperc']+$metastats['limiting']['uperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_notsusporlim_u"></td><td class="ms_leg_td"> '._('Users on instances not suspending or limiting Threads').': '.fnum($metastats['notsusporlim']['users'],0,$dlang).' / '.fnum($row['tusers'],0,$dlang).' ('.fnum($metastats['notsusporlim']['uperc'],2,$dlang).'%)</td></tr></table>
|
||||
<table class="ms_leg_tab"><tr><td class="ms_unknown_u"></td><td class="ms_leg_td"> '._('Users on instances whose Threads mod. status is unknown').': '.fnum($metastats['unknown']['users'],0,$dlang).' / '.fnum($row['tusers'],0,$dlang).' ('.fnum($metastats['unknown']['uperc'],2,$dlang).'%)</td></tr></table>
|
||||
|
||||
<table class="ms_cont"><tr><td class="ms_suspending_u" style="width:'.$metastats['suspending']['uperc'].'%"></td><td class="ms_silencing_u" style="width:'.$metastats['silencing']['uperc'].'%"></td><td class="ms_notsuspsil_u" style="width:'.$metastats['notsuspsil']['uperc'].'%"></td><td class="ms_unknown_u" style="width:'.$metastats['unknown']['uperc'].'%"></td></tr></table>
|
||||
<table class="ms_cont"><tr><td class="ms_suspending_u" style="width:'.$metastats['suspending']['uperc'].'%"></td><td class="ms_limiting_u" style="width:'.$metastats['limiting']['uperc'].'%"></td><td class="ms_notsusporlim_u" style="width:'.$metastats['notsusporlim']['uperc'].'%"></td><td class="ms_unknown_u" style="width:'.$metastats['unknown']['uperc'].'%"></td></tr></table>
|
||||
|
||||
</div>'.N;
|
||||
|
||||
|
@ -525,10 +581,10 @@ function presub() {
|
|||
$que='SELECT * FROM Instances '.$joins.' '.$wheres.' ORDER BY '.$order[$_GET['ord']]['q'];
|
||||
}
|
||||
|
||||
$debug.='MAIN QUERY: «'.$que.'»'.N;
|
||||
debug('MAIN QUERY: «'.$que.'»'.N,$debug);
|
||||
$res=tquery($que,__LINE__);
|
||||
$itot=mysqli_num_rows($res);
|
||||
$debug.='RESULTS: '.$itot.N;
|
||||
debug('RESULTS: '.$itot.N,$debug);
|
||||
/*if ($itot==0) {
|
||||
echo(_('No instance matches with the search criteria.').N.'</section>'.N.'</div>'.N.'</div>'.N.'</body>'.N.'</html>'.N);
|
||||
exit(0);
|
||||
|
@ -694,7 +750,7 @@ while ($if<$il && $row=mysqli_fetch_assoc($res)) {
|
|||
$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> '.$fdate.'</div><div><span class="ilab">'._('Display name').'</span> '.nully(hspech($row['AdmDisplayName'])).'</div><div><div class="idlab">'._('Bio').'</div><div class="inote">'.nully(strip($row['AdmNote'],$row['URI'])).'</div>'.N;
|
||||
$out.='</div></div>';
|
||||
|
||||
$out.='<div class="ghost"><div class="idlab">'._('Stats').'</div><div class="istat">';
|
||||
$out.='<div class="ghost"><div class="idlab">'._('Statistics').'</div><div class="istat">';
|
||||
|
||||
$rres=tquery('SELECT COUNT(InstID) AS cnt, SUM(Statuses) AS tstatuses, SUM(Logins) AS tlogins, SUM(Registrations) AS tregs FROM InstActivity WHERE InstID='.$row['ID'],__LINE__);
|
||||
$out.='<div class="dida">'._('Last 12 weeks activity');
|
||||
|
@ -768,12 +824,17 @@ if ($ptot>1) {
|
|||
echo('</div>'.N);
|
||||
echo('</div>'.N);
|
||||
|
||||
$debug.='TOTAL RENDERING TIME: '.hrte($bt).N;
|
||||
debug('TOTAL RENDERING TIME: '.hrte($bt).N,$debug);
|
||||
if (array_key_exists('debug',$_GET) && $_GET['debug']=='1') echo('<!--'.N.'--- DEBUG INFO ---'.N.$debug.'//-->'.N);
|
||||
|
||||
|
||||
// functions
|
||||
|
||||
function debug($msg,&$debug) {
|
||||
if (array_key_exists('debug',$_GET) && $_GET['debug']=='1')
|
||||
$debug.=$msg;
|
||||
}
|
||||
|
||||
function ckgnum($key,$def,$max) {
|
||||
if (array_key_exists($key,$_GET)) {
|
||||
$_GET[$key]=trim($_GET[$key]);
|
||||
|
@ -856,7 +917,7 @@ function tquery($query,$line) {
|
|||
$bt=hrtime(true);
|
||||
//usleep(rand(10000,100000));
|
||||
$res=mysqli_query($link,$query) or muorimeglio('Error on line '.$line.': '.mysqli_error($link),true);
|
||||
$debug.=hrte($bt).' secs. for query «'.$query.'»'.N;
|
||||
debug(hrte($bt).' secs. for query «'.$query.'»'.N,$debug);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue