Don’t show search interface when showing a single instance

This commit is contained in:
pezcurrel 2023-01-18 07:56:28 +01:00
parent c1a4a29edc
commit 2b0bfde063

View file

@ -51,6 +51,9 @@ $minaumax=4294967295;
$mincdef='""';
$mincmax=16777215;
$link=mysqli_connect($conf['db_host'],$conf['db_user_name'],$conf['db_user_password'],$conf['db_name'],$conf['db_port'],$conf['db_socket']) or muorimeglio(_('Couldnt connect to database: ').mysqli_connect_error().' ['.mysqli_connect_errno().']',false);
mysqli_set_charset($link,'utf8mb4');
// if and when ... put it soon after </nav> below
/*<div id="popupback">
<div id="fseenhelp" class="dhelp">
@ -61,8 +64,14 @@ $mincmax=16777215;
echo('</nav>
<div class="scrwide">
<div class="scrwidein">
<section class="sectcontm">
<img src="'.$prepath.'imgs/helpbutti.svg" id="helpbutt" class="helpb" onmouseover="swhelpi(true);" onmouseout="swhelpi(false);" onclick="swhelp();">
<section class="sectcontm">'.N);
if ($single) {
echo('<p><a href="instances/'.$dlang.'">← '._('Back to search').'</a></p>'.N);
$p=1;
$que='SELECT * FROM Instances WHERE ID='.$_GET['id'];
} else {
echo('<img src="'.$prepath.'imgs/helpbutti.svg" id="helpbutt" class="helpb" onmouseover="swhelpi(true);" onmouseout="swhelpi(false);" onclick="swhelp();">
<h3>'._('Instances').'</h3>
<script language="JavaScript">
@ -117,9 +126,6 @@ function presub() {
</script>
'.N);
$link=mysqli_connect($conf['db_host'],$conf['db_user_name'],$conf['db_user_password'],$conf['db_name'],$conf['db_port'],$conf['db_socket']) or muorimeglio(_('Couldnt connect to database: ').mysqli_connect_error().' ['.mysqli_connect_errno().']',false);
mysqli_set_charset($link,'utf8mb4');
$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="helpd"><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 its 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);
@ -346,10 +352,9 @@ if ($_GET['minau']!='') $wheres[]='Instances.ActiveUsersMonth>='.$_GET['minau'];
if ($_GET['minc']!='' && $_GET['minc']!='""') $wheres[]='Instances.MaxTootChars>='.$_GET['minc'];
$joins=implode(' ',$joins);
$wheres='WHERE '.implode(' AND ',$wheres);
if (!$single)
$que='SELECT * FROM Instances '.$joins.' '.$wheres.' ORDER BY '.$order[$_GET['ord']]['q'];
else
$que='SELECT * FROM Instances WHERE ID='.$_GET['id'];
}
$debug.='QUERY: «'.$que.'»'.N;
$qbt=microtime(true);
$res=mysqli_query($link,$que) or muorimeglio(__LINE__.': '.mysqli_error($link),true);