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 = ""; + ?>
@@ -30,13 +53,16 @@ if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0";}

This is the map of . Search and find players.

Show Option

-
- + +
+ - +
- value="1">Player + value="1">Players - value="2">Natar + value="2"> + + value="2">Artifacts @@ -60,52 +86,37 @@ if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0";}
-
query_return($q); - foreach($player_info as $p_array) { - $p_name=$p_array['username']; - $p_village=mysqli_real_escape_string($GLOBALS["link"], $p_array['name']); - $p_coor="(".$p_array['x']."|".$p_array['y'].")"; - $p_pop=$p_array['pop']; - - // natars have a NULL username, since they don't have user accounts - if (!$p_array['username']) { - $p_tribe = $array_tribe[TRIBE5]; - $p_array['tribe'] = 5; - } else { - $p_tribe=$array_tribe[$p_array['tribe']]; - } - - $p_info="
  • Player name : $p_name
  • Village name : $p_village
  • Coordinat : $p_coor
  • Population : $p_pop
  • Tribe : $p_tribe
  • ')\">
    "; - //250px=0 - $xdiv=250/WORLD_MAX; - if ($p_array['x']<0) { //- - $p_x=250-intval(abs($p_array['x'])*$xdiv); - } - if ($p_array['x']>0) { //+ - $p_x=250+intval(abs($p_array['x'])*$xdiv); - } - if ($p_array['y']<0) { //- - $p_y=250+intval(abs($p_array['y'])*$xdiv); - } - if ($p_array['y']>0) { //+ - $p_y=250-intval(abs($p_array['y'])*$xdiv); - } - if ($p_array['x']==0 && $p_array['y']==0) { //multihunter - $p_x=250; - $p_y=250; - } - - echo '
    '.$p_info.'
    '; + if($criteria != ""){ + $artifactsEffect = ['-', VILLAGE_EFFECT, ACCOUNT_EFFECT, UNIQUE_EFFECT]; + $array_tribe = ['-', TRIBE1, TRIBE2, TRIBE3, TRIBE4, TRIBE5, TRIBE6]; + $q = "SELECT v.wref, v.owner, v.name, v.capital, v.pop, u.username, u.tribe, u.access, w.x, w.y".($includeSize ? ", a.size" : "")." FROM ".TB_PREFIX."vdata AS v LEFT JOIN ".TB_PREFIX."users AS u ON v.owner = u.id LEFT JOIN ".TB_PREFIX."wdata AS w ON v.wref = w.id ".$criteria; + $player_info = $database->query_return($q); + + foreach($player_info as $p_array) { + $p_name = $p_array['username']; + $p_village = mysqli_real_escape_string($database->dblink, $p_array['name']); + $p_coor = "(".$p_array['x']."|".$p_array['y'].")"; + $p_pop = $p_array['pop']; + $p_tribe = $array_tribe[$p_array['tribe']]; + + $p_info ="
  • Player name: $p_name
  • Village name : $p_village
  • Coordinate: $p_coor
  • Population: $p_pop
  • Tribe: $p_tribe
  • ".($check3 != "" && isset($p_array['size']) ? "
  • Artifact effect: ".$artifactsEffect[$p_array['size']]."
  • " : "")."')\">
    "; + + //250px = 0 + $xdiv = 250 / WORLD_MAX; + if($p_array['x'] < 0) $p_x = 250 - intval(abs($p_array['x']) * $xdiv); //- + elseif($p_array['x'] > 0) $p_x = 250 + intval(abs($p_array['x']) * $xdiv); //+ + if($p_array['y'] < 0) $p_y = 250 + intval(abs($p_array['y']) * $xdiv); //- + elseif($p_array['y'] > 0) $p_y = 250 - intval(abs($p_array['y']) * $xdiv); //+ + if($p_array['x'] == 0 && $p_array['y'] == 0) $p_x = $p_y = 250; //multihunter + + echo '
    '.$p_info.'
    '; + } } ?>
    - - +
    @@ -126,7 +137,7 @@ if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0";}
    MultihunterMultihunters
    @@ -134,4 +145,24 @@ if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0";} +
    +
    +

    Artifacts Legend

    +
    +
    + + + + + + + + + + +
    +
    + +
    +
    \ No newline at end of file diff --git a/GameEngine/Lang/en.php b/GameEngine/Lang/en.php index f77af56b..8b0d8041 100755 --- a/GameEngine/Lang/en.php +++ b/GameEngine/Lang/en.php @@ -1008,6 +1008,9 @@ define("NO_ARTIFACTS","There are no artefacts."); define("ANY_ARTIFACTS","You do not own any artefacts."); define("OWNER","Owner"); define("AREA_EFFECT","Area of effect"); +define("VILLAGE_EFFECT","Village effect"); +define("ACCOUNT_EFFECT","Account effect"); +define("UNIQUE_EFFECT","Unique effect"); define("REQUIRED_LEVEL","Required level"); define("TIME_CONQUER","Time of conquer"); define("TIME_ACTIVATION","Time of activation"); diff --git a/img/admin/map_6.gif b/img/admin/map_11.gif similarity index 100% rename from img/admin/map_6.gif rename to img/admin/map_11.gif diff --git a/img/admin/map_7.gif b/img/admin/map_12.gif similarity index 100% rename from img/admin/map_7.gif rename to img/admin/map_12.gif diff --git a/img/admin/map_8.gif b/img/admin/map_13.gif similarity index 100% rename from img/admin/map_8.gif rename to img/admin/map_13.gif diff --git a/var/db/struct.sql b/var/db/struct.sql index fc931d54..6967fc0e 100644 --- a/var/db/struct.sql +++ b/var/db/struct.sql @@ -1620,7 +1620,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%users` ( -- INSERT INTO `%PREFIX%users` (`id`, `username`, `password`, `email`, `tribe`, `access`, `gold`, `gender`, `birthday`, `location`, `desc1`, `desc2`, `plus`, `b1`, `b2`, `b3`, `b4`, `sit1`, `sit2`, `alliance`, `sessid`, `act`, `timestamp`, `ap`, `apall`, `dp`, `dpall`, `protect`, `quest`, `gpack`, `cp`, `lastupdate`, `RR`, `Rc`, `ok`, `is_bcrypt`) VALUES -(5, 'Multihunter', '', 'multihunter@travianz.game', 0, 9, 0, 0, '1970-01-01', '', '[#MH]', '[#MULTIHUNTER]', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0, 1), +(5, 'Multihunter', '', 'multihunter@travianz.game', 1, 9, 0, 0, '1970-01-01', '', '[#MH]', '[#MULTIHUNTER]', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0, 1), (1, 'Support', '', 'support@travianz.game', 0, 8, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0, 1), (2, 'Nature', '', 'nature@travianz.game', 4, 2, 0, 0, '1970-01-01', '', '[#NATURE]', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0, 1), (4, 'Taskmaster', '', 'taskmaster@travianz.game', 0, 8, 0, 0, '1970-01-01', '', '[#TASKMASTER]', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0, 1);