mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Fixed some bugs
+Fixed a bug that selected the capital village instead of the actual village +Medals aren't given to Support/Nature/Natars/TaskMaster/Multihunteranymore +Fixed a bug in 1.tpl (dorf3.php) that showed tigers instead of traps while building traps +Some clean-up in Technology.php
This commit is contained in:
+18
-18
@@ -5355,7 +5355,7 @@ class Automation {
|
||||
|
||||
|
||||
//Attackers of the week
|
||||
$result = mysqli_query($database->dblink,"SELECT id, ap FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, ap FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY ap DESC, id DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
@@ -5365,7 +5365,7 @@ class Automation {
|
||||
}
|
||||
|
||||
//Defender of the week
|
||||
$result = mysqli_query($database->dblink,"SELECT id, dp FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, dp FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY dp DESC, id DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
@@ -5375,7 +5375,7 @@ class Automation {
|
||||
}
|
||||
|
||||
//Climbers of the week
|
||||
$result = mysqli_query($database->dblink,"SELECT id, Rc FROM ".TB_PREFIX."users ORDER BY Rc DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, Rc FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY Rc DESC, id DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
@@ -5385,7 +5385,7 @@ class Automation {
|
||||
}
|
||||
|
||||
//Rank climbers of the week
|
||||
$result = mysqli_query($database->dblink,"SELECT id, clp FROM ".TB_PREFIX."users ORDER BY clp DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, clp FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY clp DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
@@ -5395,7 +5395,7 @@ class Automation {
|
||||
}
|
||||
|
||||
//Robbers of the week
|
||||
$result = mysqli_query($database->dblink,"SELECT id, RR FROM ".TB_PREFIX."users ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, RR FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY RR DESC, id DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
@@ -5406,11 +5406,11 @@ class Automation {
|
||||
|
||||
//Part of the bonus for top 10 attack + defense out
|
||||
//Top10 attackers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY ap DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
//Top 10 defenders
|
||||
$result2 = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY dp DESC, id DESC Limit 10");
|
||||
while($row2 = mysqli_fetch_array($result2)){
|
||||
if($row['id']==$row2['id']){
|
||||
|
||||
@@ -5441,7 +5441,7 @@ class Automation {
|
||||
|
||||
//you stand for 3rd / 5th / 10th time in the top 3 strikers
|
||||
//top10 attackers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY ap DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 1 AND plaats<=3";
|
||||
@@ -5471,7 +5471,7 @@ class Automation {
|
||||
}
|
||||
//you stand for 3rd / 5th / 10th time in the top 10 attackers
|
||||
//top10 attackers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY ap DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 1 AND plaats<=10";
|
||||
@@ -5501,7 +5501,7 @@ class Automation {
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 verdedigers
|
||||
//Pak de top10 verdedigers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY dp DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 2 AND plaats<=3";
|
||||
@@ -5531,7 +5531,7 @@ class Automation {
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 verdedigers
|
||||
//Pak de top10 verdedigers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY dp DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 2 AND plaats<=10";
|
||||
@@ -5562,7 +5562,7 @@ class Automation {
|
||||
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 klimmers
|
||||
//Pak de top10 klimmers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY Rc DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY Rc DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 3 AND plaats<=3";
|
||||
@@ -5591,7 +5591,7 @@ class Automation {
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 klimmers
|
||||
//Pak de top10 klimmers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY Rc DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY Rc DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 3 AND plaats<=10";
|
||||
@@ -5621,7 +5621,7 @@ class Automation {
|
||||
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 klimmers
|
||||
//Pak de top3 rank climbers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY clp DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 10 AND plaats<=3";
|
||||
@@ -5650,7 +5650,7 @@ class Automation {
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 10klimmers
|
||||
//Pak de top3 rank climbers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY clp DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 10 AND plaats<=10";
|
||||
@@ -5680,7 +5680,7 @@ class Automation {
|
||||
|
||||
//je staat voor 3e / 5e / 10e keer in de top 10 overvallers
|
||||
//Pak de top10 overvallers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY RR DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 4 AND plaats<=3";
|
||||
@@ -5709,7 +5709,7 @@ class Automation {
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 10 overvallers
|
||||
//Pak de top10 overvallers
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY RR DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 4 AND plaats<=10";
|
||||
@@ -5738,7 +5738,7 @@ class Automation {
|
||||
}
|
||||
|
||||
//Put all true dens to 0
|
||||
$query="SELECT id FROM ".TB_PREFIX."users ORDER BY id+0 DESC";
|
||||
$query="SELECT id FROM ".TB_PREFIX."users WHERE id > 5 ORDER BY id+0 DESC";
|
||||
$result=mysqli_query($database->dblink,$query);
|
||||
$userIDs = [];
|
||||
for ($i=0; $row=mysqli_fetch_row($result); $i++){
|
||||
|
||||
+28
-48
@@ -34,13 +34,13 @@ include_once($autoprefix."GameEngine/Lang/en.php");
|
||||
|
||||
class Technology {
|
||||
|
||||
public $unarray = array(1=>U1,U2,U3,U4,U5,U6,U7,U8,U9,U10,U11,U12,U13,U14,U15,U16,U17,U18,U19,U20,U21,U22,U23,U24,U25,U26,U27,U28,U29,U30,U31,U32,U33,U34,U35,U36,U37,U38,U39,U40,U41,U42,U43,U44,U45,U46,U47,U48,U49,U50,U99,U0);
|
||||
public $unarray = [1 => U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11, U12, U13, U14, U15, U16, U17, U18, U19, U20, U21, U22, U23, U24, U25, U26, U27, U28, U29, U30, U31, U32, U33, U34, U35, U36, U37, U38, U39, U40, U41, U42, U43, U44, U45, U46, U47, U48, U49, U50 , U99, U0];
|
||||
|
||||
public function grabAcademyRes() {
|
||||
global $village;
|
||||
$holder = array();
|
||||
$holder = [];
|
||||
foreach($village->researching as $research) {
|
||||
if(substr($research['tech'],0,1) == "t"){
|
||||
if(substr($research['tech'], 0, 1) == "t"){
|
||||
array_push($holder,$research);
|
||||
}
|
||||
}
|
||||
@@ -312,81 +312,61 @@ class Technology {
|
||||
public function meetTRequirement($unit) {
|
||||
global $session;
|
||||
switch($unit) {
|
||||
case 1:
|
||||
if($session->tribe == 1) { return true; } else { return false; }
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
if($this->getTech($unit) && $session->tribe == 1) { return true; } else { return false; }
|
||||
break;
|
||||
case 10:
|
||||
if($session->tribe == 1) { return true; } else { return false; }
|
||||
break;
|
||||
case 11:
|
||||
if($session->tribe == 2) { return true; } else { return false; }
|
||||
break;
|
||||
case 8: return $this->getTech($unit) && $session->tribe == 1;
|
||||
|
||||
case 1:
|
||||
case 10: return $session->tribe == 1;
|
||||
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
if($session->tribe == 2 && $this->getTech($unit)) { return true; } else { return false; }
|
||||
break;
|
||||
case 20:
|
||||
if($session->tribe == 2) { return true; } else { return false; }
|
||||
break;
|
||||
case 21:
|
||||
if($session->tribe == 3) { return true; } else { return false; }
|
||||
break;
|
||||
case 18: return $session->tribe == 2 && $this->getTech($unit);
|
||||
|
||||
case 11:
|
||||
case 20: return $session->tribe == 2;
|
||||
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
case 25:
|
||||
case 26:
|
||||
case 27:
|
||||
case 28:
|
||||
if($session->tribe == 3 && $this->getTech($unit)) { return true; } else { return false; }
|
||||
break;
|
||||
case 30:
|
||||
if($session->tribe == 3) { return true; } else { return false; }
|
||||
break;
|
||||
case 31:
|
||||
if($session->tribe == 4) { return true; } else { return false; }
|
||||
break;
|
||||
case 28: return $session->tribe == 3 && $this->getTech($unit);
|
||||
|
||||
case 21:
|
||||
case 30: return $session->tribe == 3;
|
||||
|
||||
case 32:
|
||||
case 33:
|
||||
case 34:
|
||||
case 35:
|
||||
case 36:
|
||||
case 37:
|
||||
case 38:
|
||||
if($session->tribe == 4 && $this->getTech($unit)) { return true; } else { return false; }
|
||||
break;
|
||||
case 40:
|
||||
if($session->tribe == 4) { return true; } else { return false; }
|
||||
break;
|
||||
case 41:
|
||||
if($session->tribe == 5) { return true; } else { return false; }
|
||||
break;
|
||||
case 38: return $session->tribe == 4 && $this->getTech($unit);
|
||||
|
||||
case 31:
|
||||
case 40: return $session->tribe == 4;
|
||||
|
||||
case 42:
|
||||
case 43:
|
||||
case 44:
|
||||
case 45:
|
||||
case 46:
|
||||
case 47:
|
||||
case 48:
|
||||
if($session->tribe == 5 && $this->getTech($unit)) { return true; } else { return false; }
|
||||
break;
|
||||
case 50:
|
||||
if($session->tribe == 5) { return true; } else { return false; }
|
||||
break;
|
||||
case 48: return $session->tribe == 5 && $this->getTech($unit);
|
||||
|
||||
case 41:
|
||||
case 50: return $session->tribe == 5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,8 +66,7 @@ include("next.tpl");
|
||||
alt="Iron" title="<?php echo IRON; ?>" />10|</span><span><img class="r4" src="img/x.gif"
|
||||
alt="Crop" title="<?php echo CROP; ?>" />20|</span><span><img class="r5" src="img/x.gif" alt="Crop consumption"
|
||||
title="<?php echo CROP_COM; ?>" />0|<img class="clock" src="img/x.gif"
|
||||
alt="Duration" title="<?php echo DURATION; ?>" /><?php $dur=$generator->getTimeFormat(round(${'u99'}['time'] * ($bid19[$village->resarray['f'.$id]]['attri']*TRAPPER_CAPACITY / 100) / SPEED));
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur; ?></span>
|
||||
alt="Duration" title="<?php echo DURATION; ?>" /><?php echo $generator->getTimeFormat(round(($bid19[$village->resarray['f'.$id]]['attri'] / 100) * ${'u99'}['time'] / SPEED)); ?></span>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -38,11 +38,12 @@
|
||||
$bui .= '<a href="build.php?newdid='.$vid.'&id='.$b['field'].'"><img class="bau" src="img/x.gif" title="'.$building->procResType($b['type']).'" alt="'.$building->procResType($b['type']).'"></a>';
|
||||
}
|
||||
foreach($unitsArray as $key => $c){
|
||||
$gid = in_array($key, $unitsbytype['infantry'])?19:(in_array($key, $unitsbytype['cavalry'])?20:(in_array($key, $unitsbytype['siege'])?21:(in_array(($key-60), $unitsbytype['infantry'])?29:(in_array(($key-60), $unitsbytype['cavalry'])?30:($building->getTypeLevel(26)>0?26:25)))));
|
||||
if($key == 99) $key = 51;
|
||||
$gid = in_array($key, $unitsbytype['infantry'])?19:(in_array($key, $unitsbytype['cavalry'])?20:(in_array($key, $unitsbytype['siege'])?21:(in_array(($key-60), $unitsbytype['infantry'])?29:(in_array(($key-60), $unitsbytype['cavalry'])?30:($key == 51)?36:($building->getTypeLevel(26)>0?26:25)))));
|
||||
if($key > 60) { $key -= 60; }
|
||||
$tro .= '<a href="build.php?newdid='.$vid.'&gid='.$gid.'"><img class="unit u'.$key.'" src="img/x.gif" title="'.$c.'x '.$technology->getUnitName($key).'" alt="'.$c.'x '.$technology->getUnitName($key).'"></a>';
|
||||
$tro .= '<a href="build.php?newdid='.$vid.'&gid='.$gid.'"><img class="unit u'.($key == 51 ? 99 : $key).'" src="img/x.gif" title="'.$c.'x '.$technology->getUnitName($key).'" alt="'.$c.'x '.$technology->getUnitName($key).'"></a>';
|
||||
}
|
||||
if($vdata['capital'] == 1) { $class = 'hl'; } else {$class = ''; }
|
||||
if($vid == $village->wid) { $class = 'hl'; } else {$class = ''; }
|
||||
|
||||
echo '
|
||||
<tr class="'.$class.'">
|
||||
|
||||
@@ -21,7 +21,7 @@ foreach($varray as $vil){
|
||||
if($vdata['clay'] > $vdata['maxstore']) { $clay = $vdata['maxstore']; } else { $clay = $vdata['clay']; }
|
||||
if($vdata['iron'] > $vdata['maxstore']) { $iron = $vdata['maxstore']; } else { $iron = $vdata['iron']; }
|
||||
if($vdata['crop'] > $vdata['maxcrop'] ) { $crop = $vdata['maxcrop']; } else { $crop = $vdata['crop']; }
|
||||
if($vdata['capital'] == 1){$class = 'hl';}else{$class = '';}
|
||||
if($vid == $village->wid){$class = 'hl';}else{$class = '';}
|
||||
echo '
|
||||
<tr class="'.$class.'">
|
||||
<td class="vil fc"><a href="dorf1.php?newdid='.$vid.'">'.$vdata['name'].'</a></td>
|
||||
|
||||
@@ -92,7 +92,7 @@ foreach($varray as $vil){
|
||||
$percentI = floor($iron/($maxs/100));
|
||||
$percentCr = floor($crop/($maxc/100));
|
||||
|
||||
if($vdata['capital'] == 1) {$class = 'hl';} else {$class = '';}
|
||||
if($vid == $village->wid) {$class = 'hl';} else {$class = '';}
|
||||
$cr = 95; //warning percentage
|
||||
if($percentW >= $cr) {$critW = 'crit';} else {$critW = '';}
|
||||
if($percentC >= $cr) {$critC = 'crit';} else {$critC = '';}
|
||||
|
||||
@@ -26,7 +26,7 @@ foreach($varray as $vil){
|
||||
$hasCel = $database->getVillageField($vid,'celebration');
|
||||
if ($hasCel <> 0) { $timer++; }
|
||||
|
||||
if(isset($vdata) && isset($vdata['capital']) && $vdata['capital'] == 1){$class = 'hl';}else{$class = '';}
|
||||
if($vid == $village->wid){$class = 'hl';}else{$class = '';}
|
||||
|
||||
echo '<tr class="'.$class.'"><td class="vil fc"><a href="dorf1.php?newdid='.$vid.'">'.$vil['name'].'</a></td>';
|
||||
echo '<td class="cps">'.$cp.'</td>';
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<?php
|
||||
foreach($varray as $vil) {
|
||||
$vid = $vil['wref'];
|
||||
if(isset($vdata) && $vdata['capital'] == 1){$class = 'hl';}else{$class = '';}
|
||||
if($vid == $village->wid){$class = 'hl';}else{$class = '';}
|
||||
|
||||
$units = $database->getEnforceVillage($vid,1);
|
||||
array_unshift($units,$database->getUnit($vid));
|
||||
|
||||
Reference in New Issue
Block a user