General fixes

+Changed the Multihunter's tribe from 0 to Romans (1)
+Added an option to the Multihunter's panel map which shows all
artefacts on the map
This commit is contained in:
iopietro
2018-06-06 01:29:42 +02:00
parent f81e918ca0
commit c9332ea67d
6 changed files with 93 additions and 59 deletions
+89 -58
View File
@@ -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 = "";
?>
<link rel="stylesheet" href="../img/admin/map.css" type="text/css" media="all">
<div id="start">
@@ -30,13 +53,16 @@ if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0";}
</div>
<p>This is the map of <?php echo SERVER_NAME;?>. Search and find players.</p>
<h1>Show Option</h1>
<form id="show" name="show" action="admin.php?p=map&c=1" method="POST">
<table width="50%">
<form id="show" name="show" action="admin.php?p=map" method="POST">
<table width="70%">
<tr><td>
<input id="show1" name="show1" type="checkbox" <?php echo $check1;?>value="1">Player
<input id="show1" name="show1" type="checkbox" <?php echo $check1;?>value="1">Players
</td>
<td>
<input id="show2" name="show2" type="checkbox" <?php echo $check2;?>value="2">Natar
<input id="show2" name="show2" type="checkbox" <?php echo $check2;?>value="2"><?php echo TRIBE5; ?>
</td>
<td>
<input id="show3" name="show3" type="checkbox" <?php echo $check3;?>value="2">Artifacts
</td>
<td>
<input id="btnshow" type="button" value="Show" style="font-size:9px" onclick=submit()>
@@ -60,52 +86,37 @@ if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0";}
<div id="lijn_ver"></div>
</div>
<!-- Contents of the folder -->
<div style="top: 0px; left: 0px;" id="map_bg">
<?php
$array_tribe=array('-',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 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($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="<a href=\"?p=village&did=".$p_array['wref']."\" target=\"_blank\"><img src=\"../img/admin/map_".$p_array['tribe'].".gif\" border=\"0\" onmouseout=\"med_closeDescription()\" onmousemove=\"med_mouseMoveHandler(arguments[0],'<ul class=\'p_info\'><li>Player name : <b>$p_name</b></li><li>Village name : <b>$p_village</b></li><li>Coordinat : <b>$p_coor</b></li><li>Population : <b>$p_pop</b></li><li>Tribe : <b>$p_tribe</b></li></ul>')\"></a>";
//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 '<div style="left:'.$p_x.'px; top:'.$p_y.'px; position:absolute">'.$p_info.'</div>';
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 ="<a href=\"?p=village&did=".$p_array['wref']."\" target=\"_blank\"><img src=\"../img/admin/map_".(isset($p_array['size']) ? "1".$p_array['size'] : ($p_array['access'] != ADMIN ? $p_array['tribe'] : 0)).".gif\" border=\"0\" onmouseout=\"med_closeDescription()\" onmousemove=\"med_mouseMoveHandler(arguments[0],'<ul class=\'p_info\'><li>Player name: <b>$p_name</b></li><li>Village name : <b>$p_village</b></li><li>Coordinate: <b>$p_coor</b></li><li>Population: <b>$p_pop</b></li><li>Tribe: <b>$p_tribe</b></li>".($check3 != "" && isset($p_array['size']) ? "<li>Artifact effect: <b>".$artifactsEffect[$p_array['size']]."</b></li>" : "")."</ul>')\"></a>";
//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 '<div style="left:'.$p_x.'px; top:'.$p_y.'px; position:absolute">'.$p_info.'</div>';
}
}
?>
</div>
</div>
<div id="legenda">
<div class="content">
@@ -126,7 +137,7 @@ if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0";}
<td><img src="../img/admin/map_5.gif" height="11" width="11"></td><td class="show"><?php echo TRIBE5;?></td>
</tr>
<tr>
<td><img src="../img/admin/map_0.gif" height="11" width="11"></td><td class="show">Multihunter</td>
<td><img src="../img/admin/map_0.gif" height="11" width="11"></td><td class="show">Multihunters</td>
</tr>
</table>
</div>
@@ -134,4 +145,24 @@ if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0";}
</div>
</div>
<div id="legenda">
<div class="content">
<h3>Artifacts Legend</h3>
<div id="items">
<div class="first"></div>
<table>
<tr>
<td><img src="../img/admin/map_11.gif" height="11" width="11"></td><td class="show"><?php echo VILLAGE_EFFECT;?></td>
</tr>
<tr>
<td><img src="../img/admin/map_12.gif" height="11" width="11"></td><td class="show"><?php echo ACCOUNT_EFFECT;?></td>
</tr>
<tr>
<td><img src="../img/admin/map_13.gif" height="11" width="11"></td><td class="show"><?php echo UNIQUE_EFFECT;?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
+3
View File
@@ -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");

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 882 B

Before

Width:  |  Height:  |  Size: 873 B

After

Width:  |  Height:  |  Size: 873 B

Before

Width:  |  Height:  |  Size: 881 B

After

Width:  |  Height:  |  Size: 881 B

+1 -1
View File
@@ -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);