mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-23 04:56:09 +00:00
big update (details in comment)
This commit is contained in:
@@ -49,42 +49,42 @@ header("Content-Type: application/json;");
|
||||
$maparray = (substr($maparray, 0, -1));
|
||||
|
||||
$query2 = "SELECT
|
||||
s1_wdata.id AS map_id,
|
||||
s1_wdata.fieldtype AS map_fieldtype,
|
||||
s1_wdata.oasistype AS map_oasis,
|
||||
s1_wdata.x AS map_x,
|
||||
s1_wdata.y AS map_y,
|
||||
s1_wdata.occupied AS map_occupied,
|
||||
s1_wdata.image AS map_image,
|
||||
".TB_PREFIX."wdata.id AS map_id,
|
||||
".TB_PREFIX."wdata.fieldtype AS map_fieldtype,
|
||||
".TB_PREFIX."wdata.oasistype AS map_oasis,
|
||||
".TB_PREFIX."wdata.x AS map_x,
|
||||
".TB_PREFIX."wdata.y AS map_y,
|
||||
".TB_PREFIX."wdata.occupied AS map_occupied,
|
||||
".TB_PREFIX."wdata.image AS map_image,
|
||||
|
||||
s1_odata.conqured AS oasis_conqured,
|
||||
".TB_PREFIX."odata.conqured AS oasis_conqured,
|
||||
info_user_oasis.username AS oasis_user,
|
||||
info_user_oasis.tribe AS oasis_tribe,
|
||||
info_alliance_oasis.tag AS oasis_alli_name,
|
||||
|
||||
s1_vdata.wref AS ville_id,
|
||||
s1_vdata.owner AS ville_user,
|
||||
s1_vdata.name AS ville_name,
|
||||
s1_vdata.capital AS ville_capital,
|
||||
s1_vdata.pop AS ville_pop,
|
||||
".TB_PREFIX."vdata.wref AS ville_id,
|
||||
".TB_PREFIX."vdata.owner AS ville_user,
|
||||
".TB_PREFIX."vdata.name AS ville_name,
|
||||
".TB_PREFIX."vdata.capital AS ville_capital,
|
||||
".TB_PREFIX."vdata.pop AS ville_pop,
|
||||
|
||||
s1_users.id AS user_id,
|
||||
s1_users.username AS user_username,
|
||||
s1_users.tribe AS user_tribe,
|
||||
s1_users.alliance AS user_alliance,
|
||||
".TB_PREFIX."users.id AS user_id,
|
||||
".TB_PREFIX."users.username AS user_username,
|
||||
".TB_PREFIX."users.tribe AS user_tribe,
|
||||
".TB_PREFIX."users.alliance AS user_alliance,
|
||||
|
||||
s1_alidata.id AS aliance_id,
|
||||
s1_alidata.tag AS aliance_name
|
||||
".TB_PREFIX."alidata.id AS aliance_id,
|
||||
".TB_PREFIX."alidata.tag AS aliance_name
|
||||
|
||||
FROM ((((((s1_wdata
|
||||
LEFT JOIN s1_vdata ON s1_vdata.wref = s1_wdata.id )
|
||||
LEFT JOIN s1_odata ON s1_odata.wref = s1_wdata.id )
|
||||
LEFT JOIN s1_users AS info_user_oasis ON info_user_oasis.id = s1_odata.owner )
|
||||
LEFT JOIN s1_alidata AS info_alliance_oasis ON info_alliance_oasis.id = info_user_oasis.alliance )
|
||||
LEFT JOIN s1_users ON s1_users.id = s1_vdata.owner )
|
||||
LEFT JOIN s1_alidata ON s1_alidata.id = s1_users.alliance )
|
||||
where s1_wdata.id IN ($maparray)
|
||||
ORDER BY FIND_IN_SET(s1_wdata.id,'$maparray2')";
|
||||
FROM ((((((".TB_PREFIX."wdata
|
||||
LEFT JOIN ".TB_PREFIX."vdata ON ".TB_PREFIX."vdata.wref = ".TB_PREFIX."wdata.id )
|
||||
LEFT JOIN ".TB_PREFIX."odata ON ".TB_PREFIX."odata.wref = ".TB_PREFIX."wdata.id )
|
||||
LEFT JOIN ".TB_PREFIX."users AS info_user_oasis ON info_user_oasis.id = ".TB_PREFIX."odata.owner )
|
||||
LEFT JOIN ".TB_PREFIX."alidata AS info_alliance_oasis ON info_alliance_oasis.id = info_user_oasis.alliance )
|
||||
LEFT JOIN ".TB_PREFIX."users ON ".TB_PREFIX."users.id = ".TB_PREFIX."vdata.owner )
|
||||
LEFT JOIN ".TB_PREFIX."alidata ON ".TB_PREFIX."alidata.id = ".TB_PREFIX."users.alliance )
|
||||
where ".TB_PREFIX."wdata.id IN ($maparray)
|
||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||
$result2 = mysql_query($query2) or die(mysql_error());
|
||||
|
||||
$targetalliance = array();
|
||||
|
||||
@@ -63,42 +63,42 @@ $maparray2 = (substr($maparray2, 0, -1));
|
||||
//echo $maparray;
|
||||
|
||||
$query2 = "SELECT
|
||||
s1_wdata.id AS map_id,
|
||||
s1_wdata.fieldtype AS map_fieldtype,
|
||||
s1_wdata.oasistype AS map_oasis,
|
||||
s1_wdata.x AS map_x,
|
||||
s1_wdata.y AS map_y,
|
||||
s1_wdata.occupied AS map_occupied,
|
||||
s1_wdata.image AS map_image,
|
||||
".TB_PREFIX."wdata.id AS map_id,
|
||||
".TB_PREFIX."wdata.fieldtype AS map_fieldtype,
|
||||
".TB_PREFIX."wdata.oasistype AS map_oasis,
|
||||
".TB_PREFIX."wdata.x AS map_x,
|
||||
".TB_PREFIX."wdata.y AS map_y,
|
||||
".TB_PREFIX."wdata.occupied AS map_occupied,
|
||||
".TB_PREFIX."wdata.image AS map_image,
|
||||
|
||||
s1_odata.conqured AS oasis_conqured,
|
||||
".TB_PREFIX."odata.conqured AS oasis_conqured,
|
||||
info_user_oasis.username AS oasis_user,
|
||||
info_user_oasis.tribe AS oasis_tribe,
|
||||
info_alliance_oasis.tag AS oasis_alli_name,
|
||||
|
||||
s1_vdata.wref AS ville_id,
|
||||
s1_vdata.owner AS ville_user,
|
||||
s1_vdata.name AS ville_name,
|
||||
s1_vdata.capital AS ville_capital,
|
||||
s1_vdata.pop AS ville_pop,
|
||||
".TB_PREFIX."vdata.wref AS ville_id,
|
||||
".TB_PREFIX."vdata.owner AS ville_user,
|
||||
".TB_PREFIX."vdata.name AS ville_name,
|
||||
".TB_PREFIX."vdata.capital AS ville_capital,
|
||||
".TB_PREFIX."vdata.pop AS ville_pop,
|
||||
|
||||
s1_users.id AS user_id,
|
||||
s1_users.username AS user_username,
|
||||
s1_users.tribe AS user_tribe,
|
||||
s1_users.alliance AS user_alliance,
|
||||
".TB_PREFIX."users.id AS user_id,
|
||||
".TB_PREFIX."users.username AS user_username,
|
||||
".TB_PREFIX."users.tribe AS user_tribe,
|
||||
".TB_PREFIX."users.alliance AS user_alliance,
|
||||
|
||||
s1_alidata.id AS aliance_id,
|
||||
s1_alidata.tag AS aliance_name
|
||||
".TB_PREFIX."alidata.id AS aliance_id,
|
||||
".TB_PREFIX."alidata.tag AS aliance_name
|
||||
|
||||
FROM ((((((s1_wdata
|
||||
LEFT JOIN s1_vdata ON s1_vdata.wref = s1_wdata.id )
|
||||
LEFT JOIN s1_odata ON s1_odata.wref = s1_wdata.id )
|
||||
LEFT JOIN s1_users AS info_user_oasis ON info_user_oasis.id = s1_odata.owner )
|
||||
LEFT JOIN s1_alidata AS info_alliance_oasis ON info_alliance_oasis.id = info_user_oasis.alliance )
|
||||
LEFT JOIN s1_users ON s1_users.id = s1_vdata.owner )
|
||||
LEFT JOIN s1_alidata ON s1_alidata.id = s1_users.alliance )
|
||||
where s1_wdata.id IN ($maparray)
|
||||
ORDER BY FIND_IN_SET(s1_wdata.id,'$maparray2')";
|
||||
FROM ((((((".TB_PREFIX."wdata
|
||||
LEFT JOIN ".TB_PREFIX."vdata ON ".TB_PREFIX."vdata.wref = ".TB_PREFIX."wdata.id )
|
||||
LEFT JOIN ".TB_PREFIX."odata ON ".TB_PREFIX."odata.wref = ".TB_PREFIX."wdata.id )
|
||||
LEFT JOIN ".TB_PREFIX."users AS info_user_oasis ON info_user_oasis.id = ".TB_PREFIX."odata.owner )
|
||||
LEFT JOIN ".TB_PREFIX."alidata AS info_alliance_oasis ON info_alliance_oasis.id = info_user_oasis.alliance )
|
||||
LEFT JOIN ".TB_PREFIX."users ON ".TB_PREFIX."users.id = ".TB_PREFIX."vdata.owner )
|
||||
LEFT JOIN ".TB_PREFIX."alidata ON ".TB_PREFIX."alidata.id = ".TB_PREFIX."users.alliance )
|
||||
where ".TB_PREFIX."wdata.id IN ($maparray)
|
||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||
//echo $query2;
|
||||
$result2 = mysql_query($query2) or die(mysql_error());
|
||||
|
||||
|
||||
@@ -7,11 +7,12 @@ $aid = $session->alliance;
|
||||
}
|
||||
$varmedal = $database->getProfileMedalAlly($aid);
|
||||
|
||||
|
||||
$allianceinfo = $database->getAlliance($aid);
|
||||
$memberlist = $database->getAllMember($aid);
|
||||
$totalpop = 0;
|
||||
|
||||
if($allianceinfo['tag']==""){
|
||||
header("Location: allianz.php");
|
||||
}
|
||||
foreach($memberlist as $member) {
|
||||
$totalpop += $database->getVSumField($member['id'],"pop");
|
||||
}
|
||||
|
||||
@@ -34,10 +34,18 @@ $uprequire = $building->resourceRequired($id,$bid);
|
||||
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
|
||||
}
|
||||
else if($bindicator == 8) {
|
||||
if($session->access!=BANNED){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=".$session->checker."\">Construct building.</a>";
|
||||
}else{
|
||||
echo "<a class=\"build\" href=\"banned.php\">Construct building.</a>";
|
||||
}
|
||||
}
|
||||
else if($bindicator == 9) {
|
||||
if($session->access!=BANNED){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=".$session->checker."\">Construct building. (waiting loop)</a>";
|
||||
}else{
|
||||
echo "<a class=\"build\" href=\"banned.php?a=$bid&id=$id&c=".$session->checker."\">Construct building. (waiting loop)</a>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
+106
-5
@@ -1,8 +1,14 @@
|
||||
<div id="content" class="map">
|
||||
<?php
|
||||
$basearray = $database->getMInfo($_GET['d']);
|
||||
$oasis1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysql_escape_string($_GET['d']));
|
||||
$oasis = mysql_fetch_assoc($oasis1);
|
||||
?>
|
||||
<h1><?php echo !$basearray['occupied']? $basearray['fieldtype']? "Abandoned valley" : "Unoccupied oasis" : $basearray['name']; echo " (".$basearray['x']."|".$basearray['y'].")"; ?></h1>
|
||||
<h1><?php if($basearray['fieldtype']!=0){
|
||||
echo !$basearray['occupied']? $basearray['fieldtype']? "Abandoned valley" : "Unoccupied oasis" : $basearray['name']; echo " (".$basearray['x']."|".$basearray['y'].")";
|
||||
}else{
|
||||
echo $oasis['name']; echo " (".$basearray['x']."|".$basearray['y'].")";
|
||||
} ?></h1>
|
||||
<?php if($basearray['occupied'] && $basearray['capital']) { echo "<div id=\"dmain\">(capital)</div>"; } ?>
|
||||
|
||||
<img src="img/x.gif" id="detailed_map" class="<?php echo ($basearray['fieldtype'] == 0)? 'w'.$basearray['oasistype'] : 'f'.$basearray['fieldtype'] ?>" alt="<?php
|
||||
@@ -92,6 +98,7 @@ $landd = explode("-",$tt);?> />
|
||||
|
||||
<div id="map_details">
|
||||
<?php if($basearray['fieldtype'] == 0) {
|
||||
if($oasis['owner'] == 2){
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="bonus" class="tableNone bonus">
|
||||
<thead><tr>
|
||||
@@ -183,12 +190,102 @@ while($row = mysql_fetch_array($result)){
|
||||
<td>There is no
|
||||
<br>information available.</td>
|
||||
</tr>
|
||||
|
||||
<?php }} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}else if (!$basearray['occupied']) {
|
||||
}else{
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="village_info" class="tableNone">
|
||||
<?php
|
||||
$uinfo = $database->getUserArray($oasis['owner'],1); ?>
|
||||
<tbody><tr>
|
||||
<th>Tribe</th>
|
||||
<td><?php switch($uinfo['tribe']) { case 1: echo Romans; break; case 2: echo Teutons; break; case 3: echo Gauls; break; case 4: echo Nature; break; case 5: echo Natars; break;} ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Alliance</th>
|
||||
<?php if($uinfo['alliance'] == 0){
|
||||
echo '<td>-</td>';
|
||||
} else echo '
|
||||
<td><a href="allianz.php?aid='.$uinfo['alliance'].' ">'.$database->getUserAlliance($oasis['owner']).'</a></td>'; ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Owner</th>
|
||||
<td><a href="spieler.php?uid=<?php echo $oasis['owner']; ?>"><?php echo $database->getUserField($oasis['owner'],'username',0); ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Village</th>
|
||||
<td><a href="karte.php?d=<?php echo $oasis['conqured'];?>&c=<?php echo $generator->getMapCheck($oasis['conqured']);?>"><?php echo $database->getVillageField($oasis['conqured'], "name");?> </a></td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="bonus" class="tableNone bonus">
|
||||
<thead><tr>
|
||||
<th>Bonus:</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
echo $ttt;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="troop_info" class="tableNone rep">
|
||||
<thead><tr>
|
||||
<th>Reports:</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($session->uid == $database->getVillage($_GET['d'])){
|
||||
$limit = "ntype=0 and ntype=4 and ntype=5 and ntype=6 and ntype=7";
|
||||
}else{
|
||||
$limit = "ntype!=8 and ntype!=9 and ntype!=10 and ntype!=11 and ntype!=12 and ntype!=13 and ntype!=14";
|
||||
}
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysql_num_rows($result);
|
||||
if($query != 0){
|
||||
while($row = mysql_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
echo "<tr><td>";
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row['ntype']."\" title=\"".$topic."\"> ";
|
||||
$date = $generator->procMtime($row['time']);
|
||||
echo "<a href=\"berichte.php?id=".$row['id']."\">".$date[0]." ".date('H:i',$row['time'])."</a> ";
|
||||
echo "</td></tr>";
|
||||
}
|
||||
}else{ ?>
|
||||
<tr>
|
||||
<td>There is no
|
||||
<br>information available.</td>
|
||||
</tr>
|
||||
|
||||
<?php }
|
||||
}else{
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysql_num_rows($result);
|
||||
if($query != 0){
|
||||
while($row = mysql_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
echo "<tr><td>";
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row['ntype']."\" title=\"".$topic."\"> ";
|
||||
$date = $generator->procMtime($row['time']);
|
||||
echo "<a href=\"berichte.php?id=".$row['id']."\">".$date[0]." ".date('H:i',$row['time'])."</a> ";
|
||||
echo "</td></tr>";
|
||||
}
|
||||
}else{ ?>
|
||||
<tr>
|
||||
<td>There is no
|
||||
<br>information available.</td>
|
||||
</tr>
|
||||
<?php }} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}}else if (!$basearray['occupied']) {
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="distribution" class="tableNone">
|
||||
|
||||
@@ -358,7 +455,11 @@ while($row = mysql_fetch_array($result)){
|
||||
<tr>
|
||||
<td class="none">
|
||||
<?php
|
||||
if($basearray['fieldtype'] == 0){
|
||||
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysql_escape_string($_GET['d']));
|
||||
}else{
|
||||
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysql_escape_string($_GET['d']));
|
||||
}
|
||||
$data1 = mysql_fetch_assoc($query1);
|
||||
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||
$data2 = mysql_fetch_assoc($query2);
|
||||
|
||||
@@ -17,7 +17,7 @@ if(count($session->villages) > 1){?>
|
||||
for($i=1;$i<=count($session->villages);++$i){echo'
|
||||
<tr>
|
||||
<td class="dot '.(($_SESSION['wid'] == $returnVillageArray[$i-1]['wref'] ) ? 'hl':'').'">●</td>
|
||||
<td class="link"><a href="?newdid='.$returnVillageArray[$i-1]['wref'].(($id>=19) ? "&id=".$id : "&id=0").'">'.htmlspecialchars($returnVillageArray[$i-1]['name']).'</a></td>
|
||||
<td class="link"><a href="?newdid='.$returnVillageArray[$i-1]['wref'].(($id>=19) ? "&id=".$id : "&id=".$_GET['id']).'">'.htmlspecialchars($returnVillageArray[$i-1]['name']).'</a></td>
|
||||
<td class="aligned_coords"><div class="cox">('.$returnVillageArray[$i-1]['x'].'</div><div class="pi">|</div><div class="coy">'.$returnVillageArray[$i-1]['y'].')</div></td></tr>';
|
||||
}?>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user