Made “Random, recommended first” ordering available only for italian language

This commit is contained in:
pezcurrel 2023-01-04 20:28:53 +01:00
parent 296bd9e035
commit 662d506f4c

View file

@ -200,9 +200,11 @@ $order=array(
'charsa'=>array('t'=>_('By available characters per post, ascending'),'q'=>'Instances.MaxTootChars ASC'),
'noxd'=>array('t'=>_('Noxious first (switches off “Exclude noxious”)'),'q'=>'Instances.Noxious DESC')
);
if (!(array_key_exists('ord',$_GET) && array_key_exists($_GET['ord'],$order)))
if (!array_key_exists('ord',$_GET) || !array_key_exists($_GET['ord'],$order))
$_GET['ord']='rand';
if ($_GET['lang']==0) $order['rand']=array('t'=>_('Random'),'q'=>'Instances.RPos ASC');
// we have recommended instances only for it language, so...
$withreclangids=[306];
if (!in_array($_GET['lang'],$withreclangids)) $order['rand']=array('t'=>_('Random'),'q'=>'Instances.RPos ASC');
$p=1;
if (array_key_exists('p',$_GET) && preg_match('#^[0-9]+$#',$_GET['p'])===1) $p=$_GET['p']+0;