Using supplangs

This commit is contained in:
pezcurrel 2023-11-02 09:38:28 +01:00
parent 0aad540f3d
commit 677f3bbd6d

View file

@ -5,7 +5,8 @@ if (!defined('N')) {
exit(0); exit(0);
} }
require('lib/fnum.php'); require 'lib/fnum.php';
require 'lib/supplangs.php';
echo('</nav> echo('</nav>
<div class="scrwide"> <div class="scrwide">
@ -36,17 +37,6 @@ $now=time();
$tdstart=gmmktime(0,0,0,gmdate('n',$now),gmdate('j',$now),gmdate('Y',$now)); $tdstart=gmmktime(0,0,0,gmdate('n',$now),gmdate('j',$now),gmdate('Y',$now));
$limit=$tdstart-(30*24*60*60); $limit=$tdstart-(30*24*60*60);
$res=mysqli_query($link,'SELECT * FROM ZStats WHERE TS >= '.$limit.' ORDER BY TS DESC') or muorimeglio(__LINE__.': '.mysqli_error($link),true); $res=mysqli_query($link,'SELECT * FROM ZStats WHERE TS >= '.$limit.' ORDER BY TS DESC') or muorimeglio(__LINE__.': '.mysqli_error($link),true);
$hlmap=array(
'ca'=>_('Catalan'),
'de'=>_('German'),
'en'=>_('English'),
'es'=>_('Spanish'),
'fr'=>_('French'),
'gl'=>_('Galician'),
'it'=>_('Italian'),
'pt_BR'=>_('Português (BR)'),
'uk'=>_('Ukrainian')
);
$hpmap=array( $hpmap=array(
'home'=>_('Guide'), 'home'=>_('Guide'),
'instances'=>_('Instances'), 'instances'=>_('Instances'),
@ -62,7 +52,8 @@ while ($row=mysqli_fetch_assoc($res)) {
$buf=array(); $buf=array();
foreach($hl as $key=>$val) { foreach($hl as $key=>$val) {
$val=explode(':',$val); $val=explode(':',$val);
$buf[$hlmap[$val[0]]]=$val[1]; if (array_key_exists($val[0],$supplangs))// needed when you (temporarily) subtract a lang code from $supplangs in lib/supplangs.php
$buf[$supplangs[$val[0]]['trname']]=$val[1];
} }
arsort($buf); arsort($buf);
$hl=''; $hl='';