diff --git a/Admin/Templates/map.tpl b/Admin/Templates/map.tpl index e2e80a3f..30677c68 100644 --- a/Admin/Templates/map.tpl +++ b/Admin/Templates/map.tpl @@ -8,19 +8,42 @@ ## Copyright: TravianZ (c) 2010-2014. All rights reserved. ## ## ## ################################################################################# -$check1=""; -$check2=""; -if(isset($_POST['show1']) || isset($_POST['show2'])) { - $check1=isset($_POST['show1'])? "checked ":""; - $check2=isset($_POST['show2'])? "checked ":""; - if ($check1!="" && $check2!="") {$criteria="";} - if ($check1!="" && $check2=="") {$criteria="WHERE tribe<>5";} - if ($check1=="" && $check2!="") {$criteria="WHERE tribe IN(0,5) OR tribe IS NULL";} -}elseif(!isset($_GET['c'])){ - $check1="checked "; - $criteria="WHERE tribe<>5"; + +$check1 = $check2 = $check3 = ""; +$includeSize = true; + +if (isset($_POST['show1']) || isset($_POST['show2']) || isset($_POST['show3'])) { + $check1 = isset($_POST['show1']) ? "checked " : ""; + $check2 = isset($_POST['show2']) ? "checked " : ""; + $check3 = isset($_POST['show3']) ? "checked " : ""; + + if($check1 != "" && $check2 == "" && $check3 == "") { + $criteria = " WHERE u.tribe <> 5"; + $includeSize = false; + } + elseif($check1 == "" && $check2 != "" && $check3 == "") { + $criteria = " WHERE u.tribe = 5 AND (v.capital = 1 OR v.natar = 1)"; + $includeSize = false; + } + elseif($check1 != "" && $check2 != "" && $check3 == "") { + $criteria = " WHERE u.tribe <> 5 OR (u.tribe = 5 AND (v.capital = 1 OR v.natar = 1))"; + $includeSize = false; + } + elseif($check1 == "" && $check2 == "" && $check3 != "") { + $criteria = " INNER JOIN ".TB_PREFIX."artefacts AS a ON a.vref = v.wref"; + } + elseif($check1 != "" && $check2 == "" && $check3 != ""){ + $criteria = " LEFT JOIN ".TB_PREFIX."artefacts AS a ON a.vref = v.wref WHERE u.tribe <> 5 OR (u.tribe = 5 AND v.capital <> 1 AND v.natar <> 1)"; + } + elseif($check1 == "" && $check2 != "" && $check3 != ""){ + $criteria = " LEFT JOIN ".TB_PREFIX."artefacts AS a ON a.vref = v.wref WHERE u.tribe = 5"; + } + elseif($check1 != "" && $check2 != "" && $check3 != ""){ + $criteria = " LEFT JOIN ".TB_PREFIX."artefacts AS a ON a.vref = v.wref"; + } } -if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0";} +if ($check1 == "" && $check2 == "" && $check3 == "") $criteria = ""; + ?>
This is the map of . Search and find players.