Mostly cosemtic: added $dlanguc

This commit is contained in:
pezcurrel 2022-11-23 19:15:00 +01:00
parent 5652458d97
commit fa5a9cb1ce

View file

@ -2,6 +2,8 @@
$bt=microtime(true);
$dlanguc=strtoupper($dlang);
require('mustard/include/n2es.php');
require('lib/fnum.php');
@ -297,8 +299,8 @@ echo('<form method="get" id="searchf" class="sdbox" onsubmit="document.getElemen
<div class="sdinput">
<select id="lang" name="lang" class="sselect">
<option value="0"'.$selected.'>'._('Irrelevant').'</option>'.N);
$res=mysqli_query($link,'SELECT Languages.ID AS Lid, CONCAT(Name'.$dlang.', \' [\', Code, \'] (\', COUNT(Languages.ID), \')\') AS Txt FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=OurLangID LEFT JOIN Instances ON Instances.ID=InstOurLangs.InstID WHERE Instances.Dead=0 AND Instances.IsMastodon=1 AND InstOurLangs.Pos=1 GROUP BY Languages.ID ORDER BY Name'.$dlang.' ASC') or muorimeglio(__LINE__.': '.mysqli_error($link),true);
//$res=mysqli_query($link,'SELECT Languages.ID AS Lid, CONCAT(Name'.$dlang.', \' (\', Code, \')\') AS Txt FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=OurLangID LEFT JOIN Instances ON Instances.ID=InstOurLangs.InstID WHERE Instances.Dead=0 AND Instances.IsMastodon=1 AND InstOurLangs.Pos=1 GROUP BY Languages.ID ORDER BY Name'.$dlang.' ASC') or muorimeglio(__LINE__.': '.mysqli_error($link),true);
$res=mysqli_query($link,'SELECT Languages.ID AS Lid, CONCAT(Name'.$dlanguc.', \' [\', Code, \'] (\', COUNT(Languages.ID), \')\') AS Txt FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=OurLangID LEFT JOIN Instances ON Instances.ID=InstOurLangs.InstID WHERE Instances.Dead=0 AND Instances.IsMastodon=1 AND InstOurLangs.Pos=1 GROUP BY Languages.ID ORDER BY Name'.$dlanguc.' ASC') or muorimeglio(__LINE__.': '.mysqli_error($link),true);
//$res=mysqli_query($link,'SELECT Languages.ID AS Lid, CONCAT(Name'.$dlanguc.', \' (\', Code, \')\') AS Txt FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=OurLangID LEFT JOIN Instances ON Instances.ID=InstOurLangs.InstID WHERE Instances.Dead=0 AND Instances.IsMastodon=1 AND InstOurLangs.Pos=1 GROUP BY Languages.ID ORDER BY Name'.$dlanguc.' ASC') or muorimeglio(__LINE__.': '.mysqli_error($link),true);
while ($row=mysqli_fetch_assoc($res)) {
($_GET['lang']==$row['Lid']) ? $selected=' selected' : $selected='';
echo('<option value="'.$row['Lid'].'"'.$selected.'>'.$row['Txt'].'</option>'.N);
@ -445,7 +447,7 @@ while ($if<$il && $row=mysqli_fetch_assoc($res)) {
$out='<div class="ihead"><a href="https://'.hspech($row['URI']).'" title="'._('Go to instance').'">'.hspech($row['URI']).'</a> (<span title="'._('Instance ID').': '.$row['ID'].'">'.$if.'</span>/'.$itot.')</div>'.N;
$out.='<div class="ibody">'.N;
$qbt=microtime(true);
$rres=tquery('SELECT CONCAT(Languages.Name'.strtoupper($dlang).'," (",Languages.Code,")") AS Lang FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=InstOurLangs.OurLangID WHERE InstOurLangs.InstID='.$row['ID'].' ORDER BY InstOurLangs.Pos ASC',__LINE__);
$rres=tquery('SELECT CONCAT(Languages.Name'.$dlanguc.'," (",Languages.Code,")") AS Lang FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=InstOurLangs.OurLangID WHERE InstOurLangs.InstID='.$row['ID'].' ORDER BY InstOurLangs.Pos ASC',__LINE__);
$buf=array();
while ($rrow=mysqli_fetch_assoc($rres))
$buf[]=hspech($rrow['Lang']);