mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-03 00:47:19 +00:00
fix bug 10 (not %100, not shown after scroll) and bug 5 from the buglist + update Templates/movement.tpl
This commit is contained in:
@@ -3416,28 +3416,43 @@ class MYSQL_DB {
|
|||||||
Made by: Shadow
|
Made by: Shadow
|
||||||
***************************/
|
***************************/
|
||||||
|
|
||||||
function checkAttack($wref, $toWref){
|
function checkAttack($wref, $toWref){
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."movement WHERE `from` = '$wref' AND `to` = '$toWref' AND `proc` = '0' AND `sort_type` = '3'";
|
$q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and (" . TB_PREFIX . "attacks.attack_type = 3 or " . TB_PREFIX . "attacks.attack_type = 4) ORDER BY endtime ASC";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysql_query($q, $this->connection);
|
||||||
if(mysql_num_rows($result)) {
|
if(mysql_num_rows($result)) {
|
||||||
return mysql_fetch_array($result);
|
return true;
|
||||||
} else {
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************
|
/***************************
|
||||||
Function checkEnforce
|
Function checkEnforce
|
||||||
Made by: Shadow
|
Made by: Shadow
|
||||||
***************************/
|
***************************/
|
||||||
|
|
||||||
function checkEnforce($vid, $from) {
|
function checkEnforce($wref, $toWref) {
|
||||||
$q = "SELECT * from " . TB_PREFIX . "enforcement where `from` = $from and vref = $vid";
|
$q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 2 ORDER BY endtime ASC";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysql_query($q, $this->connection);
|
||||||
if(!empty($result)) {
|
if(mysql_num_rows($result)) {
|
||||||
return mysql_insert_id($this->connection);
|
|
||||||
}else{
|
|
||||||
return true;
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/***************************
|
||||||
|
Function checkEnforce
|
||||||
|
Made by: yi12345
|
||||||
|
***************************/
|
||||||
|
|
||||||
|
function checkScout($wref, $toWref) {
|
||||||
|
$q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 1 ORDER BY endtime ASC";
|
||||||
|
$result = mysql_query($q, $this->connection);
|
||||||
|
if(mysql_num_rows($result)) {
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -53,15 +53,27 @@
|
|||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
$this->procRankRaceArray(1);
|
$this->procRankRaceArray(1);
|
||||||
|
if($this->searchRank($session->uid, "userid") != 0){
|
||||||
$this->getStart($this->searchRank($session->uid, "userid"));
|
$this->getStart($this->searchRank($session->uid, "userid"));
|
||||||
|
}else{
|
||||||
|
$this->getStart(1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
$this->procRankRaceArray(2);
|
$this->procRankRaceArray(2);
|
||||||
|
if($this->searchRank($session->uid, "userid") != 0){
|
||||||
$this->getStart($this->searchRank($session->uid, "userid"));
|
$this->getStart($this->searchRank($session->uid, "userid"));
|
||||||
|
}else{
|
||||||
|
$this->getStart(1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
$this->procRankRaceArray(3);
|
$this->procRankRaceArray(3);
|
||||||
|
if($this->searchRank($session->uid, "userid") != 0){
|
||||||
$this->getStart($this->searchRank($session->uid, "userid"));
|
$this->getStart($this->searchRank($session->uid, "userid"));
|
||||||
|
}else{
|
||||||
|
$this->getStart(1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 31:
|
case 31:
|
||||||
$this->procAttRankArray();
|
$this->procAttRankArray();
|
||||||
|
|||||||
@@ -158,8 +158,10 @@ $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $do
|
|||||||
$att = '<span class=\'m3\' ></span>';
|
$att = '<span class=\'m3\' ></span>';
|
||||||
}elseif ($database->checkEnforce($wref,$toWref) != 0) {
|
}elseif ($database->checkEnforce($wref,$toWref) != 0) {
|
||||||
$att = '<span class=\'m9\' ></span>';
|
$att = '<span class=\'m9\' ></span>';
|
||||||
}
|
}elseif ($database->checkScout($wref,$toWref) != 0) {
|
||||||
}
|
$att = '<span class=\'m6\' ></span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Map content
|
// Map content
|
||||||
if($donnees['ville_user']==3 && $donnees['ville_name']=='WW Buildingplan'){
|
if($donnees['ville_user']==3 && $donnees['ville_name']=='WW Buildingplan'){
|
||||||
|
|||||||
@@ -230,7 +230,9 @@ $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $do
|
|||||||
$att = '<span class=\'m3\' ></span>';
|
$att = '<span class=\'m3\' ></span>';
|
||||||
}elseif ($database->checkEnforce($wref,$toWref) != 0) {
|
}elseif ($database->checkEnforce($wref,$toWref) != 0) {
|
||||||
$att = '<span class=\'m9\' ></span>';
|
$att = '<span class=\'m9\' ></span>';
|
||||||
}
|
}elseif ($database->checkScout($wref,$toWref) != 0) {
|
||||||
|
$att = '<span class=\'m6\' ></span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map content
|
// Map content
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
$oases = 0;
|
$oases = 0;
|
||||||
$array = $database->getOasis($village->wid);
|
$array = $database->getOasis($village->wid);
|
||||||
foreach($array as $conqured){
|
foreach($array as $conqured){
|
||||||
$oases += count($database->getMovement(6,$village->wid,0));
|
$oases += count($database->getMovement(6,$conqured['wref'],0));
|
||||||
}
|
}
|
||||||
$aantal = (count($database->getMovement(4,$village->wid,1))+count($database->getMovement(3,$village->wid,1))+count($database->getMovement(3,$village->wid,0))+count($database->getMovement(7,$village->wid,1))+count($database->getMovement(5,$village->wid,0))+$oases-count($database->getMovement(8,$village->wid,1))-count($database->getMovement(9,$village->wid,0)));
|
$aantal = (count($database->getMovement(4,$village->wid,1))+count($database->getMovement(3,$village->wid,1))+count($database->getMovement(3,$village->wid,0))+count($database->getMovement(7,$village->wid,1))+count($database->getMovement(5,$village->wid,0))+$oases-count($database->getMovement(8,$village->wid,1))-count($database->getMovement(9,$village->wid,0)));
|
||||||
|
|
||||||
@@ -24,6 +24,9 @@ $NextArrival = array();
|
|||||||
$NextArrival1 = array();
|
$NextArrival1 = array();
|
||||||
$NextArrival2 = array();
|
$NextArrival2 = array();
|
||||||
$NextArrival3 = array();
|
$NextArrival3 = array();
|
||||||
|
$NextArrival4 = array();
|
||||||
|
$NextArrival5 = array();
|
||||||
|
$NextArrival6 = array();
|
||||||
|
|
||||||
/* Units coming back from Reinf,attack,raid,evasion or reinf to my town */
|
/* Units coming back from Reinf,attack,raid,evasion or reinf to my town */
|
||||||
$aantal = count($database->getMovement(4,$village->wid,1))+count($database->getMovement(7,$village->wid,1));
|
$aantal = count($database->getMovement(4,$village->wid,1))+count($database->getMovement(7,$village->wid,1));
|
||||||
@@ -80,7 +83,7 @@ if($aantal > 0){
|
|||||||
if ($receive['attack_type'] != 2 && $receive['attack_type'] != 1) {
|
if ($receive['attack_type'] != 2 && $receive['attack_type'] != 1) {
|
||||||
$action = 'att1';
|
$action = 'att1';
|
||||||
$aclass = 'a1';
|
$aclass = 'a1';
|
||||||
$title = ''.OWN_ATTACKING_TROOPS.'';
|
$title = ''.UNDERATTACK.'';
|
||||||
$short = ''.ATTACK.'';
|
$short = ''.ATTACK.'';
|
||||||
$NextArrival1[] = $receive['endtime'];
|
$NextArrival1[] = $receive['endtime'];
|
||||||
}
|
}
|
||||||
@@ -151,7 +154,7 @@ if($aantal > 0){
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo '<tr><td class="typ"><a href="build.php?id=39"><img src="img/x.gif" class="'.$action.'" alt="'.$title.'" title="'.$title.'" /></a><span class="'.$aclass.'">»</span></td>
|
echo '<tr><td class="typ"><a href="build.php?id=39"><img src="img/x.gif" class="'.$action.'" alt="'.$title.'" title="'.$title.'" /></a><span class="'.$aclass.'">»</span></td>
|
||||||
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r"> <span id="timer'.$timer.'">'.$generator->getTimeFormat($receive['endtime']-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival5)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||||
$timer += 1;
|
$timer += 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -183,7 +186,7 @@ if($aantal > 0){
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo '<tr><td class="typ"><a href="build.php?id=39"><img src="img/x.gif" class="'.$action.'" alt="'.$title.'" title="'.$title.'" /></a><span class="'.$aclass.'">»</span></td>
|
echo '<tr><td class="typ"><a href="build.php?id=39"><img src="img/x.gif" class="'.$action.'" alt="'.$title.'" title="'.$title.'" /></a><span class="'.$aclass.'">»</span></td>
|
||||||
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r"> <span id="timer'.$timer.'">'.$generator->getTimeFormat($receive['endtime']-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival6)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||||
$timer += 1;
|
$timer += 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user