mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-24 03:57:15 +00:00
Farmlist improvements and fixes
+Troops while adding/editing a raid lists are now inside of a table, this is a graphic enhancement +Reduced the X and Y textboxes size while adding/editing a raid list +Fixed a bug that didn't permit to add a raid list +Fixed a bug that did permit to insert spies in raid lists +The farmlists graphic is now more clear, "Add raid" and "Start raid" are now two general buttons, instead of having two buttons for raid list +"Select all" checkbox, will select all raid without refreshing the page (through JS) +Moved the function "getDistance" to Database.php +Removed a lot of redundant code from crop_finder.php +Removed rams, catapults, chiefs and settlers from the raid list, because the first three can't even loot resources +Removed trooplist2.tpl because of a more general unique template file (trooplist.tpl) +Some minor improvements and bug fixing IMPORTANT NOTE: if you don't want to reinstal the whole server, you can simply run this little query (where "s1_" is the prefix of your server): ALTER TABLE `s1_raidlist` DROP `t7`, DROP `t8`, DROP `t9`, DROP `t10`;
This commit is contained in:
@@ -1,141 +1,30 @@
|
||||
<?php
|
||||
if($session->tribe == 1){
|
||||
<?php
|
||||
$start = ($session->tribe - 1) * 10 + 1;
|
||||
$end = $start + 5;
|
||||
?>
|
||||
<div class="troops">
|
||||
<div class="troopGroup">
|
||||
<label for="t1"><img class="unit u1" title="<?php echo U1; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t1" type="text" name="t1" value="<?php if($t1!=0){ echo $t1; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t2"><img class="unit u2" title="<?php echo U2; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t2" type="text" name="t2" value="<?php if($t2!=0){ echo $t2; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t3"><img class="unit u3" title="<?php echo U3; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t3" type="text" name="t3" value="<?php if($t3!=0){ echo $t3; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t4"><img class="unit u4" title="<?php echo U4; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t4" type="text" value="<?php if($t4!=0){ echo $t4; }else{ echo 0; } ?>" disabled="disabled">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t5"><img class="unit u5" title="<?php echo U5; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t5" type="text" name="t5" value="<?php if($t5!=0){ echo $t5; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="troopGroup">
|
||||
<label for="t6"><img class="unit u6" title="<?php echo U6; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t6" type="text" name="t6" value="<?php if($t6!=0){ echo $t6; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t7"><img class="unit u7" title="<?php echo U7; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t7" type="text" name="t7" value="<?php if($t7!=0){ echo $t7; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t8"><img class="unit u8" title="<?php echo U8; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t8" type="text" name="t8" value="<?php if($t8!=0){ echo $t8; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t9"><img class="unit u9" title="<?php echo U9; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t9" type="text" name="t9" value="<?php if($t9!=0){ echo $t9; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t10"><img class="unit u10" title="<?php echo U10; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t10" type="text" name="t10" value="<?php if($t10!=0){ echo $t10; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php }elseif($session->tribe == 2){ ?>
|
||||
<div class="troops">
|
||||
<div class="troopGroup">
|
||||
<label for="t1"><img class="unit u11" title="<?php echo U11; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t1" type="text" name="t1" value="<?php if($t1!=0){ echo $t1; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t2"><img class="unit u12" title="<?php echo U12; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t2" type="text" name="t2" value="<?php if($t2!=0){ echo $t2; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t3"><img class="unit u13" title="<?php echo U13; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t3" type="text" name="t3" value="<?php if($t3!=0){ echo $t3; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t4"><img class="unit u14" title="<?php echo U14; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t4" type="text" value="<?php if($t4!=0){ echo $t4; }else{ echo 0; } ?>" disabled="disabled">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t5"><img class="unit u15" title="<?php echo U15; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t5" type="text" name="t5" value="<?php if($t5!=0){ echo $t5; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="troopGroup">
|
||||
<label for="t6"><img class="unit u16" title="<?php echo U16; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t6" type="text" name="t6" value="<?php if($t6!=0){ echo $t6; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t7"><img class="unit u17" title="<?php echo U17; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t7" type="text" name="t7" value="<?php if($t7!=0){ echo $t7; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t8"><img class="unit u18" title="<?php echo U18; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t8" type="text" name="t8" value="<?php if($t8!=0){ echo $t8; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t9"><img class="unit u19" title="<?php echo U19; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t9" type="text" name="t9" value="<?php if($t9!=0){ echo $t9; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t10"><img class="unit u20" title="<?php echo U20; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t10" type="text" name="t10" value="<?php if($t10!=0){ echo $t10; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php }elseif($session->tribe == 3){ ?>
|
||||
<div class="troops">
|
||||
<div class="troopGroup">
|
||||
<label for="t1"><img class="unit u21" title="<?php echo U21; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t1" type="text" name="t1" value="<?php if($t1!=0){ echo $t1; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t2"><img class="unit u22" title="<?php echo U22; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t2" type="text" name="t2" value="<?php if($t2!=0){ echo $t2; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t3"><img class="unit u23" title="<?php echo U23; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t3" type="text" value="<?php if($t3!=0){ echo $t3; }else{ echo 0; } ?>" disabled="disabled">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t4"><img class="unit u24" title="<?php echo U24; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t4" type="text" name="t4" value="<?php if($t4!=0){ echo $t4; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t5"><img class="unit u25" title="<?php echo U25; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t5" type="text" name="t5" value="<?php if($t5!=0){ echo $t5; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="troopGroup">
|
||||
<label for="t6"><img class="unit u26" title="<?php echo U26; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t6" type="text" name="t6" value="<?php if($t6!=0){ echo $t6; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t7"><img class="unit u27" title="<?php echo U27; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t7" type="text" name="t7" value="<?php if($t7!=0){ echo $t7; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t8"><img class="unit u28" title="<?php echo U28; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t8" type="text" name="t8" value="<?php if($t8!=0){ echo $t8; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t9"><img class="unit u29" title="<?php echo U29; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t9" type="text" name="t9" value="<?php if($t9!=0){ echo $t9; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
<div class="troopGroup">
|
||||
<label for="t10"><img class="unit u30" title="<?php echo U30; ?>" src="img/x.gif"></label>
|
||||
<input class="text troop" id="t10" type="text" name="t10" value="<?php if($t10!=0){ echo $t10; }else{ echo 0; } ?>">
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<table class="transparent" id="raidList" cellspacing="1" cellpadding="1">
|
||||
<tr>
|
||||
<?php
|
||||
for($i = $start; $i <= $end; $i++){
|
||||
if(in_array($i, [4, 14, 23])) continue;
|
||||
?>
|
||||
<td>
|
||||
<label for="t<?php echo $i - $start + 1; ?>"><img class="unit u<?php echo $i; ?>" title="<?php echo $technology->getUnitName($i) ?>" src="img/x.gif"></label>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
for($i = $start; $i <= $end; $i++){
|
||||
if(in_array($i, [4, 14, 23])) continue;
|
||||
?>
|
||||
<td>
|
||||
<input class="text" id="t<?php echo $i - $start + 1; ?>" type="text" name="t<?php echo $i - $start + 1; ?>" value="<?php echo (${'t'.($i - $start + 1)} > 0) ? ${'t'.($i - $start + 1)} : 0; ?>">
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user