mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Fixed some report bugs
+Added the report type 23, which indicates a defence during festive days +Festive reports in the alliance no longer duplicates +Festive reports in the village view no longer duplicates +Fixed a bug that didn't permit to read an allied report General: -Removed the possibility to view an inexistent village +Some minor improovements
This commit is contained in:
@@ -3075,8 +3075,9 @@ class Automation {
|
||||
$database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],$AttackArrivalTime,$endtime);
|
||||
$peace = PEACE;
|
||||
$data2 = $from['owner'].','.$from['wref'].','.$to['owner'].','.$owntribe.','.$unitssend_att.','.$peace;
|
||||
$database->addNotice($from['owner'],$to['wref'],$ownally,22,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,time());
|
||||
$database->addNotice($to['owner'],$to['wref'],$targetally,22,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,time());
|
||||
$time = time();
|
||||
$database->addNotice($from['owner'], $to['wref'], $ownally, 22,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'', $data2, $time);
|
||||
$database->addNotice($to['owner'], $to['wref'], $targetally, 23,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'', $data2, $time);
|
||||
}
|
||||
|
||||
//check if not natar tribe
|
||||
@@ -3768,29 +3769,26 @@ class Automation {
|
||||
}
|
||||
|
||||
private function updateRes($bountywid,$uid) {
|
||||
global $session;
|
||||
|
||||
|
||||
$this->bountyLoadTown($bountywid);
|
||||
$this->bountycalculateProduction($bountywid,$uid);
|
||||
$this->bountyprocessProduction($bountywid);
|
||||
}
|
||||
|
||||
private function updateORes($bountywid) {
|
||||
global $session;
|
||||
$this->bountyLoadOTown($bountywid);
|
||||
$this->bountycalculateOProduction($bountywid);
|
||||
$this->bountyprocessOProduction($bountywid);
|
||||
}
|
||||
|
||||
private function bountyLoadOTown($bountywid) {
|
||||
global $database,$session,$logging,$technology;
|
||||
global $database;
|
||||
$this->bountyinfoarray = $database->getOasisV($bountywid);
|
||||
$this->bountyresarray = $database->getResourceLevel($bountywid);
|
||||
$this->bountypop = 2;
|
||||
|
||||
}
|
||||
private function bountyLoadTown($bountywid) {
|
||||
global $database,$session,$logging,$technology;
|
||||
global $database;
|
||||
$this->bountyinfoarray = $database->getVillage($bountywid);
|
||||
$this->bountyresarray = $database->getResourceLevel($bountywid);
|
||||
$this->bountyoasisowned = $database->getOasis($bountywid);
|
||||
@@ -4802,7 +4800,7 @@ class Automation {
|
||||
/************************************************
|
||||
Function for starvation - by brainiacX and Shadow
|
||||
Rework by ronix
|
||||
Refacored by iopietro
|
||||
Refactored by iopietro
|
||||
References:
|
||||
************************************************/
|
||||
|
||||
@@ -5017,6 +5015,7 @@ class Automation {
|
||||
/************************************************
|
||||
Function for starvation - by brainiacX and Shadow
|
||||
Rework by ronix
|
||||
Refactored by iopietro
|
||||
References:
|
||||
************************************************/
|
||||
|
||||
|
||||
@@ -4270,7 +4270,7 @@ References: User ID/Message ID, Mode
|
||||
return self::$noticesCacheById[$id][$field];
|
||||
}
|
||||
|
||||
function getNotice3($uid, $use_cache = true) {
|
||||
function getNotice3($uid, $alliance, $use_cache = true) {
|
||||
list($uid) = $this->escape_input((int) $uid);
|
||||
|
||||
// first of all, check if we should be using cache and whether the field
|
||||
@@ -4279,8 +4279,8 @@ References: User ID/Message ID, Mode
|
||||
return $cachedValue;
|
||||
}
|
||||
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "ndata where uid = $uid ORDER BY time ".(isset($_GET['o']) && $_GET['o'] == 1 ? 'ASC' : 'DESC');
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "ndata where uid = $uid ".($alliance > 0 ? 'OR ally = '.$alliance.'' : '')." ORDER BY time ".(isset($_GET['o']) && $_GET['o'] == 1 ? 'ASC' : 'DESC');
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
|
||||
$noticesCacheByUId[$uid] = $this->mysqli_fetch_all($result);
|
||||
return $noticesCacheByUId[$uid];
|
||||
|
||||
@@ -116,7 +116,7 @@ class Message {
|
||||
}
|
||||
if (!is_array($type)) { $type = array($type); }
|
||||
$this->noticearray = $this->filter_by_value($database->getNotice($session->uid), "ntype", $type);
|
||||
$this->notice = $this->filter_by_value($database->getNotice3($session->uid), "ntype", $type);
|
||||
$this->notice = $this->filter_by_value($database->getNotice3($session->uid, $session->alliance), "ntype", $type);
|
||||
}
|
||||
if(isset($get['id'])) {
|
||||
$this->readingNotice = $this->getReadNotice($get['id']);
|
||||
@@ -228,7 +228,7 @@ class Message {
|
||||
|
||||
private function getNotice() {
|
||||
global $database, $session;
|
||||
$this->allNotice = $database->getNotice3($session->uid);
|
||||
$this->allNotice = $database->getNotice3($session->uid, $session->alliance);
|
||||
$this->noticearray = $this->filter_by_value_except($database->getNotice($session->uid), "ntype", 9);
|
||||
$this->notice = $this->filter_by_value_except($this->allNotice, "ntype", 9);
|
||||
$this->totalNotice = count($this->allNotice);
|
||||
@@ -354,10 +354,10 @@ class Message {
|
||||
}
|
||||
|
||||
private function getReadNotice($id) {
|
||||
global $database;
|
||||
global $database, $session;
|
||||
foreach($this->allNotice as $notice) {
|
||||
if($notice['id'] == $id) {
|
||||
$database->noticeViewed($notice['id']);
|
||||
if($notice['id'] == $id) {
|
||||
if($notice['uid'] == $session->uid) $database->noticeViewed($notice['id']);
|
||||
return $notice;
|
||||
}
|
||||
}
|
||||
@@ -391,7 +391,9 @@ class Message {
|
||||
case 16:
|
||||
case 17: return 15;
|
||||
|
||||
case 19: return 3;
|
||||
case 19: return 3;
|
||||
|
||||
case 23: return 22;
|
||||
}
|
||||
|
||||
return $type;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
$filterType = $_GET['f'];
|
||||
if($filterType == 31) $sql = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."ndata WHERE ally = ".(int) $session->alliance." AND (ntype != 0 AND ntype < 4 OR ntype > 17 AND ntype != 20 AND ntype != 21) ORDER BY time DESC LIMIT 20");
|
||||
elseif($filterType == 32) $sql = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."ndata WHERE ally = ".(int) $session->alliance." AND (ntype < 1 OR ntype > 3 AND ntype < 8 OR ntype > 19) ORDER BY time DESC LIMIT 20");
|
||||
if($filterType == 31) $sql = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."ndata WHERE ally = ".(int) $session->alliance." AND (ntype != 0 AND ntype < 4 OR ntype > 17 AND ntype != 20 AND ntype != 21 AND ntype != 22) ORDER BY time DESC LIMIT 20");
|
||||
elseif($filterType == 32) $sql = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."ndata WHERE ally = ".(int) $session->alliance." AND (ntype < 1 OR ntype > 3 AND ntype < 8 OR ntype > 19) AND ntype != 22 ORDER BY time DESC LIMIT 20");
|
||||
|
||||
$query = mysqli_num_rows($sql);
|
||||
$outputList = '';
|
||||
@@ -31,7 +31,8 @@ while($row = mysqli_fetch_array($sql)){
|
||||
|
||||
$outputList .= "<a href=\"allianz.php?s=3&f=".$type2."\">";
|
||||
$type = (isset($_GET['t']) && $_GET['t'] == 5)? $archive : $ntype;
|
||||
if((($type == 18 || $type == 19) && $filterType == 31) || (($type == 20 || $type == 21) && $filterType == 32)){
|
||||
if($type == 23) $type = 22;
|
||||
if((($type == 18 || $type == 19) && $filterType == 31) || (($type == 20 || $type == 21) && $filterType == 32) || $type == 22){
|
||||
$outputList .= "<img src=\"gpack/travian_default/img/scouts/$type.gif\" title=\"".$topic."\" />";
|
||||
}else{
|
||||
$outputList .= "<img src=\"img/x.gif\" class=\"iReport iReport$type\" title=\"".$topic."\">";
|
||||
@@ -43,8 +44,8 @@ while($row = mysqli_fetch_array($sql)){
|
||||
$outputList .= $database->getUserField($dataarray[0], "username", 0);
|
||||
|
||||
$outputList .= $nn;
|
||||
$outputList .= $database->getUserField($type != 22 ? $dataarray[28] : $dataarray[2], "username", 0);
|
||||
$getUserAlly = $database->getUserField($type != 22 ? $dataarray[28] : $dataarray[2], "alliance", 0);
|
||||
$outputList .= $database->getUserField($type != 22 && $type != 23 ? $dataarray[28] : $dataarray[2], "username", 0);
|
||||
$getUserAlly = $database->getUserField($type != 22 && $type != 23 ? $dataarray[28] : $dataarray[2], "alliance", 0);
|
||||
$getAllyName = $database->getAllianceName($getUserAlly);
|
||||
|
||||
if(!$getUserAlly) $allyName = "-";
|
||||
|
||||
@@ -21,7 +21,7 @@ if($_GET['f'] == 31 || $_GET['f'] == 32) include "Templates/Alliance/attack-filt
|
||||
else
|
||||
{
|
||||
|
||||
$sql = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."ndata WHERE ally = ".(int) $session->alliance." AND (ntype < 8 OR ntype > 17) ORDER BY time DESC LIMIT 20");
|
||||
$sql = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."ndata WHERE ally = ".(int) $session->alliance." AND (ntype < 8 OR (ntype > 17 AND ntype < 22) OR (ntype = 22 AND ally = $session->alliance) OR (ntype = 23 AND ally != $session->alliance)) ORDER BY time DESC LIMIT 20");
|
||||
$query = mysqli_num_rows($sql);
|
||||
$outputList = '';
|
||||
$name = 1;
|
||||
@@ -51,7 +51,8 @@ while($row = mysqli_fetch_array($sql)){
|
||||
|
||||
$outputList .= "<a href=\"allianz.php?s=3&f=".$type2."\">";
|
||||
$type = (isset($_GET['t']) && $_GET['t'] == 5)? $archive : $ntype;
|
||||
if($type >= 18 && $type <= 21){
|
||||
if($type == 23) $type = 22;
|
||||
if($type >= 18 && $type <= 22){
|
||||
$outputList .= "<img src=\"gpack/travian_default/img/scouts/$type.gif\" title=\"".$topic."\" />";
|
||||
}else{
|
||||
$outputList .= "<img src=\"img/x.gif\" class=\"iReport iReport$type\" title=\"".$topic."\">";
|
||||
|
||||
+53
-51
@@ -14,7 +14,7 @@ echo !$oasis['conqured']? UNOCCUOASIS : OCCUOASIS; echo " (".$basearray['x']."|"
|
||||
$otext = !$oasis['conqured']? UNOCCUOASIS : OCCUOASIS;
|
||||
} ?></h1>
|
||||
<?php if($basearray['occupied'] && $basearray['capital']) { echo "<div id=\"dmain\">(capital)</div>"; }
|
||||
if($uinfo['owner']==3 && $uinfo['name']==PLANVILLAGE){
|
||||
if($uinfo['owner'] == 3 && $uinfo['name'] == PLANVILLAGE){
|
||||
?>
|
||||
<img src="img/x.gif" id="detailed_map" class="f99" alt="<?php echo PLANVILLAGE;?>" />
|
||||
<?php }else{ ?>
|
||||
@@ -104,12 +104,13 @@ echo $tt."\"";
|
||||
$landd = explode("-",$tt);?> />
|
||||
<?php } ?>
|
||||
<div id="map_details">
|
||||
<?php if($basearray['fieldtype'] == 0) {
|
||||
<?php
|
||||
if($basearray['fieldtype'] == 0) {
|
||||
if($oasis['owner'] == 2){
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="bonus" class="tableNone bonus">
|
||||
<thead><tr>
|
||||
<th>Bonus:</th>
|
||||
<th><?php echo BONUS;?></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
@@ -125,7 +126,7 @@ if($oasis['owner'] == 2){
|
||||
<tbody>
|
||||
<?php
|
||||
$unit = $database->getUnit($_GET['d']);
|
||||
$unarray = array(31=>U31,U32,U33,U34,U35,U36,U37,U38,U39,U40);
|
||||
$unarray = array(31 => U31, U32, U33, U34, U35, U36, U37, U38, U39, U40);
|
||||
$a = 0;
|
||||
for ($i = 31; $i <= 40; $i++) {
|
||||
if($unit['u'.$i]){
|
||||
@@ -146,7 +147,7 @@ if($oasis['owner'] == 2){
|
||||
}
|
||||
}
|
||||
if($a == 10){
|
||||
echo '<tr><td><?php echo NOTROOP;?></td></tr>';
|
||||
echo '<tr><td>'.NOTROOP.'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -160,22 +161,22 @@ if($oasis['owner'] == 2){
|
||||
</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 AND ntype!=15 AND ntype!=16 AND ntype!=17";
|
||||
}
|
||||
if($session->uid == $database->getVillage($_GET['d'])['owner']){
|
||||
$limit = "ntype > 3 AND ntype < 8";
|
||||
}
|
||||
else $limit = "ntype < 8 OR ntype > 17";
|
||||
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
if($session->alliance != 0){
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE ($limit) AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
if($query){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
$topic = $row['topic'];
|
||||
echo "<tr><td>";
|
||||
if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
if($type >= 18 && $type <= 21){
|
||||
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"".$topic."\" title=\"".$topic."\" />";
|
||||
}else{
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row['ntype']."\" title=\"".$topic."\"> ";
|
||||
@@ -193,13 +194,13 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
}else{
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
if($query){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
echo "<tr><td>";
|
||||
if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
if($type >= 18 && $type <= 21){
|
||||
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"".$topic."\" title=\"".$topic."\" />";
|
||||
}else{
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row['ntype']."\" title=\"".$topic."\"> ";
|
||||
@@ -222,29 +223,29 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
<?php
|
||||
$uinfo = $database->getUserArray($oasis['owner'],1); ?>
|
||||
<tbody><tr>
|
||||
<th>Tribe</th>
|
||||
<th><?php echo TRIBE;?></th>
|
||||
<td><?php switch($uinfo['tribe']) { case 1: echo TRIBE1; break; case 2: echo TRIBE2; break; case 3: echo TRIBE3; break; case 4: echo TRIBE4; break; case 5: echo TRIBE5; break;} ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Alliance</th>
|
||||
<th><?php echo 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>
|
||||
<th><?php echo 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>
|
||||
<th><?php echo 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>
|
||||
<th><?php echo BONUS;?></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
@@ -255,26 +256,26 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="troop_info" class="tableNone rep">
|
||||
<thead><tr>
|
||||
<th>Reports:</th>
|
||||
<th><?php echo REPORT;?></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 and ntype=20 and ntype=21";
|
||||
}else{
|
||||
$limit = "ntype!=8 and ntype!=9 and ntype!=10 and ntype!=11 and ntype!=12 and ntype!=13 and ntype!=14 and ntype!=15 and ntype!=16 and ntype!=17";
|
||||
}
|
||||
if($session->uid == $database->getVillage($_GET['d'])['owner']){
|
||||
$limit = "(ntype > 3 AND ntype < 8) OR ntype = 20 OR ntype = 21";
|
||||
}
|
||||
else $limit = "ntype < 8 OR ntype > 17";
|
||||
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
if($session->alliance != 0){
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE ($limit) AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
if($query){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
$topic = $row['topic'];
|
||||
echo "<tr><td>";
|
||||
if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
if($type >= 18 && $type <= 21){
|
||||
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"".$topic."\" title=\"".$topic."\" />";
|
||||
}else{
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row['ntype']."\" title=\"".$topic."\"> ";
|
||||
@@ -292,13 +293,13 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
}else{
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
if($query){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
$topic = $row['topic'];
|
||||
echo "<tr><td>";
|
||||
if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
if($type >= 18 && $type <= 21){
|
||||
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"".$topic."\" title=\"".$topic."\" />";
|
||||
}else{
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row['ntype']."\" title=\"".$topic."\"> ";
|
||||
@@ -315,7 +316,8 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}}else if (!$basearray['occupied']) {
|
||||
}
|
||||
}else if (!$basearray['occupied']) {
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="distribution" class="tableNone">
|
||||
|
||||
@@ -385,22 +387,22 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
</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 AND ntype!=15 AND ntype!=16 AND ntype!=17";
|
||||
}
|
||||
if($session->uid == $database->getVillage($_GET['d'])['owner']){
|
||||
$limit = "(ntype > 3 AND ntype < 8) OR ntype = 23";
|
||||
}
|
||||
else $limit = "(ntype < 8 OR (ntype > 17 AND ntype < 22)) OR ntype = 22";
|
||||
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
if($session->alliance != 0){
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE ($limit) AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
if($query){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
$type = ($row['ntype'] == 23) ? 22 : $row['ntype'];
|
||||
$topic = $row['topic'];
|
||||
echo "<tr><td>";
|
||||
if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){
|
||||
if($type >= 18 && $type <= 22){
|
||||
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"".$topic."\" title=\"".$topic."\" />";
|
||||
}else{
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row['ntype']."\" title=\"".$topic."\"> ";
|
||||
@@ -416,15 +418,15 @@ if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){
|
||||
|
||||
<?php }
|
||||
}else{
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE $limit AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE ($limit) AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
if($query){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
echo "<tr><td>";
|
||||
if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
if($type >= 18 && $type <= 21){
|
||||
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"".$topic."\" title=\"".$topic."\" />";
|
||||
}else{
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row['ntype']."\" title=\"".$topic."\"> ";
|
||||
|
||||
@@ -3,13 +3,13 @@ $dataarray = explode(",",$message->readingNotice['data']);
|
||||
$colspan = (isset($dataarray[14]) && $dataarray[14] > 0) ? 11 : 10;
|
||||
|
||||
if($dataarray[15] == 1){
|
||||
$message1 = "".$database->getUserField($dataarray[0],"username",0)." visited ".$database->getUserField($dataarray[2],"username",0)."'s troops";
|
||||
$message1 = "".$database->getUserField($dataarray[0], "username", 0)." visited ".$database->getUserField($dataarray[2],"username",0)."'s troops";
|
||||
}else if($dataarray[15] == 2){
|
||||
$message1 = "".$database->getUserField($dataarray[0],"username",0)." wishes you Merry Christmas";
|
||||
$message1 = "".$database->getUserField($dataarray[0], "username", 0)." wishes you Merry Christmas";
|
||||
}else if($dataarray[15] == 3){
|
||||
$message1 = "".$database->getUserField($dataarray[0],"username",0)." wishes you Happy New Year";
|
||||
$message1 = "".$database->getUserField($dataarray[0], "username", 0)." wishes you Happy New Year";
|
||||
}else{
|
||||
$message1 = "".$database->getUserField($dataarray[0],"username",0)." wishes you Happy Easter";
|
||||
$message1 = "".$database->getUserField($dataarray[0], "username", 0)." wishes you Happy Easter";
|
||||
}
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="report_surround">
|
||||
|
||||
@@ -69,10 +69,11 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
|
||||
echo "<tr><td class=\"sel\"><input class=\"check\" type=\"checkbox\" name=\"n".$name."\" value=\"".$message->noticearray[$i-1]['id']."\" /></td>
|
||||
<td class=\"sub\">";
|
||||
$type = (isset($_GET['t']) && $_GET['t'] == 5)? $message->noticearray[$i-1]['archive'] : $message->noticearray[$i-1]['ntype'];
|
||||
if($type==15 or $type==16 or $type==17){
|
||||
if($type == 23) $type = 22;
|
||||
if($type >= 15 && $type <= 17){
|
||||
$type = $type-11;
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport$type\" alt=\"".$noticeClass[$type]."\" title=\"".$noticeClass[$type]."\" />";
|
||||
}else if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){
|
||||
}else if($type >= 18 && $type <= 22){
|
||||
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"".$noticeClass[$type]."\" title=\"".$noticeClass[$type]."\" />";
|
||||
}else{
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport$type\" alt=\"".$noticeClass[$type]."\" title=\"".$noticeClass[$type]."\" />";
|
||||
|
||||
@@ -78,11 +78,10 @@ else{
|
||||
<?php include("Templates/header.tpl"); ?>
|
||||
<div id="mid">
|
||||
<?php include("Templates/menu.tpl");
|
||||
if(isset($_GET['d']) && isset($_GET['c'])) {
|
||||
if($generator->getMapCheck($_GET['d']) == $_GET['c']) {
|
||||
include("Templates/Map/vilview.tpl");
|
||||
}
|
||||
else {
|
||||
if(isset($_GET['d']) && !empty($_GET['d']) && isset($_GET['c']) && !empty($_GET['c'])) {
|
||||
if($generator->getMapCheck($_GET['d']) == $_GET['c']) include("Templates/Map/vilview.tpl");
|
||||
else
|
||||
{
|
||||
header("Location: dorf1.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user