Natars automation system

+Natars will now spawn automatically, you can set how many day should
pass before the spawn of Natars (and artifacts), WW Villages and WW
building plans (Note: WW villages and WW building plans won't spawn
until the creation of the natar account)
+Added 3 timers under the left menu which indicate the spawn of
Natars/Artifacts, WW villages and WW building plans
+Added an option in the installation, to set the resource production of
oasis
+Fixed a bug that didn't permit to add multiple Units, Abtech and tech
rows with one query
+Added a new information to the Artifact of the fool, the next effect
reroll will now be displayed in his informations (in the treasury)
+Fixed a bug that dind't permit the correct timers flow in Dorf3.php
(Warehouse tab), they'll now flow correctly
+Timers and resources percentage of villages with a negative production
of crop will now be marked in red (in the Warehouse tab, Dorf3.php) and
will now be displayed in how much time the granary will be emptied
+Fixed a possible bug that prevented to add raids to farm lists
+Fixed a bug that didn't permit to create WW Villages from the
Multihunter control panel
+Reworked all timers, there will be only one timer field now (in
Session.php)
+Minor bug fixing and optimization

NOTE: To play this version of the game, you need to reinstall the server
OR you can simply add these lines of code into your "config.php" file:

// ***** Natars Spawn Time
define("NATARS_SPAWN_TIME",260);
define("NATARS_WW_SPAWN_TIME",260);
define("NATARS_WW_BUILDING_PLAN_SPAWN_TIME",260);

// ***** Oasis production
define("OASIS_WOOD_MULTIPLIER",40);
define("OASIS_CLAY_MULTIPLIER",40);
define("OASIS_IRON_MULTIPLIER",40);
define("OASIS_CROP_MULTIPLIER",40);
define("OASIS_WOOD_PRODUCTION",OASIS_WOOD_MULTIPLIER*SPEED);
define("OASIS_CLAY_PRODUCTION",OASIS_CLAY_MULTIPLIER*SPEED);
define("OASIS_IRON_PRODUCTION",OASIS_IRON_MULTIPLIER*SPEED);
define("OASIS_CROP_PRODUCTION",OASIS_CROP_MULTIPLIER*SPEED);

P.S: from the next version, the possibility to add manual WWs, WW
building plans and to create the natar account will be REMOVED.
This commit is contained in:
iopietro
2018-05-10 17:45:27 +02:00
parent ec63b04587
commit 90221cf19f
40 changed files with 1222 additions and 1236 deletions
+5 -6
View File
@@ -80,20 +80,19 @@
if($totalUps > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".UPGRADING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
</thead><tbody>";
$timer = 1;
foreach($ABups as $black) {
$ABUnit = substr($black['tech'],1,2);
$count++;
$ABUnit = substr($black['tech'], 1, 2);
$abdata['b'.$ABUnit]++;
$unit = ($session->tribe-1)*10 + $ABUnit;
$unit = ($session->tribe - 1) * 10 + $ABUnit;
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit);
echo "<span class=\"none\"> (".LEVEL." ".$abdata['b'.$ABUnit].")</span>";
if($timer > 1) echo "<span class=\"none\"> ".WAITING."</span>";
if($count > 1) echo "<span class=\"none\"> ".WAITING."</span>";
echo "</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($black['timestamp']-time())."</span></td>";
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($black['timestamp']-time())."</span></td>";
$date = $generator->procMtime($black['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
+6 -7
View File
@@ -80,20 +80,19 @@
if($totalUps > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".UPGRADING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
</thead><tbody>";
$timer = 1;
foreach($ABups as $arms) {
$ABUnit = substr($arms['tech'],1,2);
$abdata['a'.$ABUnit]++;
$unit = ($session->tribe-1)*10 + $ABUnit;
$count++;
$ABUnit = substr($arms['tech'], 1, 2);
$abdata['a' . $ABUnit]++;
$unit = ($session->tribe - 1) * 10 + $ABUnit;
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit);
echo "<span class=\"none\"> (".LEVEL." ".$abdata['a'.$ABUnit].")</span>";
if($timer > 1) echo "<span class=\"none\"> ".WAITING."</span>";
if($count > 1) echo "<span class=\"none\"> ".WAITING."</span>";
echo "</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($arms['timestamp']-time())."</span></td>";
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($arms['timestamp']-time())."</span></td>";
$date = $generator->procMtime($arms['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
+270 -267
View File
@@ -1,310 +1,313 @@
<?php
if (isset($_GET['refresh'])) {
$village->unitarray = $database->getUnit($village->wid, false);
}
?><div id="build" class="gid16"><a href="#" onClick="return Popup(16,4);" class="build_logo">
<img class="g16" src="img/x.gif" alt="Rally point" title="<?php echo RALLYPOINT;?>" />
</a>
<h1><?php echo RALLYPOINT;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc"><?php echo RALLYPOINT_DESC;?></p>
if(isset($_GET['refresh'])){
$village->unitarray = $database->getUnit($village->wid, false);
}
?><div id="build" class="gid16">
<a href="#" onClick="return Popup(16,4);" class="build_logo"> <img
class="g16" src="img/x.gif" alt="Rally point"
title="<?php echo RALLYPOINT;?>" />
</a>
<h1><?php echo RALLYPOINT;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span>
</h1>
<p class="build_desc"><?php echo RALLYPOINT_DESC;?></p>
<?php
include_once("16_menu.tpl");
$units_type = $database->getMovement("34",$village->wid,1);
$settlers = $database->getMovement("7",$village->wid,1);
include_once ("16_menu.tpl");
$units_type = $database->getMovement("34", $village->wid, 1);
$settlers = $database->getMovement("7", $village->wid, 1);
$oasis_incoming = 0;
$array = $database->getOasis($village->wid);
foreach($array as $conqured){
$oasis_incoming += count($database->getMovement(6,$conqured['wref'],0));
$oasis_incoming += count($database->getMovement(6, $conqured['wref'], 0));
}
$units_incoming = count($units_type);
$settlers_incoming = count($settlers);
for($i=0;$i<$units_incoming;$i++){
if($units_type[$i]['attack_type'] == 1 && $units_type[$i]['sort_type'] == 3)
$units_incoming -= 1;
for($i = 0; $i < $units_incoming; $i++){
if($units_type[$i]['attack_type'] == 1 && $units_type[$i]['sort_type'] == 3) $units_incoming -= 1;
}
if($units_incoming > 0 or $settlers_incoming > 0 or $oasis_incoming > 0){
?>
if($units_incoming > 0 || $settlers_incoming > 0 || $oasis_incoming > 0){
?>
<h4><?php echo INCOMING_TROOPS;?> (<?php echo $units_incoming+$settlers_incoming+$oasis_incoming; ?>)</h4>
<?php include("16_incomming.tpl");
}
<?php
include ("16_incomming.tpl");
}
?>
<h4><?php echo TROOPS_IN_THE_VILLAGE;?></h4>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td><td colspan="<?php if($village->unitarray['hero'] == 0) {echo"10";}else{echo"11";}?>">
<a href="spieler.php?uid=<?php echo $session->uid; ?>"><?php echo OWN_TROOPS;?></a></td></tr></thead>
<tbody class="units">
<?php include("16_troops.tpl");
?>
</tbody></table>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td class="role"><a
href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
<td
colspan="<?php echo $village->unitarray['hero'] == 0 ? 10 : 11; ?>">
<a href="spieler.php?uid=<?php echo $session->uid; ?>"><?php echo OWN_TROOPS;?></a>
</td>
</tr>
</thead>
<tbody class="units">
<?php
if(count($village->enforcetome) > 0) {
foreach($village->enforcetome as $enforce) {
$colspan = 10+$enforce['hero'];
if($enforce['from']!=0){
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a></td>
<td colspan=\"$colspan\">";
if (LANG == "es") {
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".TROOPSFROM." ".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." </a>";
}else{ echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." ".TROOPSFROM."</a>";
}
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i=$start;$i<=($start+9);$i++) {
if($enforce['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
echo "</tbody></table>";
}else{
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
include ("16_troops.tpl");
?>
</tbody>
</table>
<?php
if(count($village->enforcetome) > 0){
foreach($village->enforcetome as $enforce){
$colspan = 10 + $enforce['hero'];
if($enforce['from'] != 0){
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a></td>
<td colspan=\"$colspan\">";
if(LANG == "es"){
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".TROOPSFROM." ".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." </a>";
}else{
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." ".TROOPSFROM."</a>";
}
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($enforce['from'], "owner"), "tribe", 0);
$start = ($tribe - 1) * 10 + 1;
$end = ($tribe * 10);
echo "<tr><th>&nbsp;</th>";
for($i = $start; $i <= ($end); $i++){
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero'] != 0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i = $start; $i <= ($start + 9); $i++){
if($enforce['u'.$i] == 0){
echo "<td class=\"none\">";
}else{
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero'] != 0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
echo "</tbody></table>";
}else{
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a>".TASKMASTER."</a></td>
<td colspan=\"$colspan\">";
echo "<a> ".VILLAGE_OF_THE_ELDERS_TROOPS."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = 4;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i=$start;$i<=($start+9);$i++) {
if($enforce['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><span class=none><b>".SEND_BACK."</b></span></div></td></tr>";
echo "</tbody></table>";
}
}
echo "<a> ".VILLAGE_OF_THE_ELDERS_TROOPS."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = 4;
$start = ($tribe - 1) * 10 + 1;
$end = ($tribe * 10);
echo "<tr><th>&nbsp;</th>";
for($i = $start; $i <= ($end); $i++){
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero'] != 0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i = $start; $i <= ($start + 9); $i++){
if($enforce['u'.$i] == 0){
echo "<td class=\"none\">";
}else{
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero'] != 0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><span class=none><b>".SEND_BACK."</b></span></div></td></tr>";
echo "</tbody></table>";
}
}
}
$enforcevill = array();
$enforceoasis = array();
$allenforce=$village->enforcetoyou;
$enforcemeoasis=$village->enforceoasis;
if(count($allenforce) > 0) {
foreach($allenforce as $enforce) {
$conquredvid=$database->getOasisField($enforce['vref'], "conqured");
if ($conquredvid>0) {
$enforce['conqured']=$conquredvid;
array_push($enforceoasis,$enforce);
} else {
array_push($enforcevill,$enforce);
}
$allenforce = $village->enforcetoyou;
$enforcemeoasis = $village->enforceoasis;
if(count($allenforce) > 0){
foreach($allenforce as $enforce){
$conquredvid = $database->getOasisField($enforce['vref'], "conqured");
if($conquredvid > 0){
$enforce['conqured'] = $conquredvid;
array_push($enforceoasis, $enforce);
}else{
array_push($enforcevill, $enforce);
}
}
}
if(count($enforcemeoasis) > 0){
foreach($enforcemeoasis as $enforce){
array_push($enforceoasis, $enforce);
}
}
if(count($enforcemeoasis) > 0) {
foreach($enforcemeoasis as $enforce) {
array_push($enforceoasis,$enforce);
}
}
if (count($enforcevill)>0) {
echo "<h4>".TROOPS_IN_OTHER_VILLAGE."</h4>";
foreach($enforcevill as $enforce) {
$colspan = 10+$enforce['hero'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a></td>
if(count($enforcevill) > 0){
echo "<h4>".TROOPS_IN_OTHER_VILLAGE."</h4>";
foreach($enforcevill as $enforce){
$colspan = 10 + $enforce['hero'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".REINFORCEMENTFOR." ".$database->getVillageField($enforce['vref'],"name")." </a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i=$start;$i<=($start+9);$i++) {
if($enforce['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
echo "<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".REINFORCEMENTFOR." ".$database->getVillageField($enforce['vref'], "name")." </a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($enforce['from'], "owner"), "tribe", 0);
$start = ($tribe - 1) * 10 + 1;
$end = ($tribe * 10);
echo "<tr><th>&nbsp;</th>";
for($i = $start; $i <= ($end); $i++){
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero'] != 0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i = $start; $i <= ($start + 9); $i++){
if($enforce['u'.$i] == 0){
echo "<td class=\"none\">";
}else{
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero'] != 0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
echo "</tbody></table>";
}
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
echo "</tbody></table>";
}
}
if(count($enforceoasis) > 0) {
echo "<h4>".TROOPS_IN_OASIS."</h4>";
foreach($enforceoasis as $enforce) {
$colspan = 10+$enforce['hero'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".$database->getVillageField($enforce['conqured'],"name")."</a></td>
if(count($enforceoasis) > 0){
echo "<h4>".TROOPS_IN_OASIS."</h4>";
foreach($enforceoasis as $enforce){
$colspan = 10 + $enforce['hero'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".$database->getVillageField($enforce['conqured'], "name")."</a></td>
<td colspan=\"$colspan\">";
if (LANG == "es") {
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".TROOPSFROM." ".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." </a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a>";
}else{ echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." ".TROOPSFROM."</a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a>";
if(LANG == "es"){
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".TROOPSFROM." ".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." </a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a>";
}else{
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." ".TROOPSFROM."</a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a>";
}
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($enforce['from'], "owner"), "tribe", 0);
$start = ($tribe - 1) * 10 + 1;
$end = ($tribe * 10);
echo "<tr><th>&nbsp;</th>";
for($i = $start; $i <= ($end); $i++){
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero'] != 0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i = $start; $i <= ($start + 9); $i++){
if($enforce['u'.$i] == 0){
echo "<td class=\"none\">";
}else{
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero'] != 0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
echo "</tbody></table>";
}
}
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i=$start;$i<=($start+9);$i++) {
if($enforce['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
echo "</tbody></table>";
}
}
if(count($database->getPrisoners3($village->wid)) > 0) {
echo "<h4>".PRISONERS."</h4>";
foreach($database->getPrisoners3($village->wid) as $prisoners) {
$colspan = 10+$prisoners['t11'];
$colspan2 = $colspan + 1;
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'],"name")."</a></td>
if(count($database->getPrisoners3($village->wid)) > 0){
echo "<h4>".PRISONERS."</h4>";
foreach($database->getPrisoners3($village->wid) as $prisoners){
$colspan = 10 + $prisoners['t11'];
$colspan2 = $colspan + 1;
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'], "name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".PRISONERSIN." ".$database->getVillageField($prisoners['wref'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
echo "<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".PRISONERSIN." ".$database->getVillageField($prisoners['wref'], "name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'], "owner"), "tribe", 0);
$start = ($tribe - 1) * 10 + 1;
$end = ($tribe * 10);
echo "<tr><th>&nbsp;</th>";
for($i = $start; $i <= ($end); $i++){
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11'] != 0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i = 1; $i <= 10; $i++){
if($prisoners['t'.$i] == 0){
echo "<td class=\"none\">";
}
else echo "<td>";
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11'] > 0) echo "<td>".$prisoners['t11']."</td>";
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan2\"><div class='sup'>".$technology->getUpkeep($prisoners, $tribe, 0, 1)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>".KILL."</a></div></td></tr>";
echo "</tbody></table>";
}
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan2\"><div class='sup'>".$technology->getUpkeep($prisoners,$tribe,0,1)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>".KILL."</a></div></td></tr>";
echo "</tbody></table>";
}
}
if(count($database->getPrisoners($village->wid)) > 0) {
echo "<h4>".PRISONERS."</h4>";
foreach($database->getPrisoners($village->wid) as $prisoners) {
$colspan = 10 + $prisoners['t11'];
$colspan2 = $colspan + 1;
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'],"name")."</a></td>
if(count($database->getPrisoners($village->wid)) > 0){
echo "<h4>".PRISONERS."</h4>";
foreach($database->getPrisoners($village->wid) as $prisoners){
$colspan = 10 + $prisoners['t11'];
$colspan2 = $colspan + 1;
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'], "name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".PRISONERSFROM." ".$database->getVillageField($prisoners['from'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
echo "<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".PRISONERSFROM." ".$database->getVillageField($prisoners['from'], "name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'], "owner"), "tribe", 0);
$start = ($tribe - 1) * 10 + 1;
$end = ($tribe * 10);
echo "<tr><th>&nbsp;</th>";
for($i = $start; $i <= ($end); $i++){
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11'] != 0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>".TROOPS."</th>";
for($i = 1; $i <= 10; $i++){
if($prisoners['t'.$i] == 0){
echo "<td class=\"none\">";
}
else echo "<td>";
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11'] > 0) echo "<td>".$prisoners['t11']."</td>";
echo "</tr></tbody>
<tbody class=\"infos\"><tr><td colspan=\"$colspan2\"><div class='sup'><img class=\"r6\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" /></div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>".SEND_BACK."</a></div></td></tr>";
echo "</tbody></table>";
}
echo "</tbody></table>";
}
}
?>
<?php
$units_type = $database->getMovement("3",$village->wid,0);
$settlers = $database->getMovement("5",$village->wid,0);
$units_type = $database->getMovement(3, $village->wid, 0);
$settlers = $database->getMovement(5, $village->wid, 0);
$units_incoming = count($units_type);
for($i=0;$i<$units_incoming;$i++){
if($units_type[$i]['vref'] != $village->wid)
$units_incoming -= 1;
for($i = 0; $i < $units_incoming; $i++){
if($units_type[$i]['vref'] != $village->wid) $units_incoming -= 1;
}
$units_incoming += count($settlers);
if($units_incoming >= 1){
echo "<h4>".TROOPS_ON_THEIR_WAY."</h4>";
include("16_walking.tpl");
echo "<h4>".TROOPS_ON_THEIR_WAY."</h4>";
include ("16_walking.tpl");
}
include("upgrade.tpl");
include ("upgrade.tpl");
?>
</p></div>
</p>
</div>
+3 -4
View File
@@ -24,7 +24,6 @@
}
$trainlist = $technology->getTrainingList(1);
if(count($trainlist) > 0) {
//$timer = 2*count($trainlist);
echo "
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
<thead><tr>
@@ -41,7 +40,7 @@
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
@@ -52,9 +51,9 @@
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer?>"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
include("upgrade.tpl");
?>
</p></div>
</p></div>
+2 -2
View File
@@ -52,7 +52,7 @@
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
@@ -63,7 +63,7 @@
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer?>"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
?>
+2 -2
View File
@@ -93,7 +93,7 @@
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
@@ -104,7 +104,7 @@
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer?>"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
include("upgrade.tpl");
+3 -5
View File
@@ -141,15 +141,13 @@ if($fail > 0) {
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
+3 -5
View File
@@ -137,15 +137,13 @@ echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABL
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
+3 -5
View File
@@ -140,15 +140,13 @@ $acares = $technology->grabAcademyRes();
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
+3 -5
View File
@@ -134,15 +134,13 @@ echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABL
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
+3 -5
View File
@@ -130,15 +130,13 @@ echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABL
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
+3 -7
View File
@@ -1,18 +1,14 @@
<?php
if(!isset($timer)) {
$timer = 1;
}
$timeleft = $database->getVillageField($village->wid, 'celebration');
if($timeleft > Time()){
if($timeleft > time()){
echo '</br>';
echo '<table cellpadding="0" cellspacing="0" id="building_contract">';
echo '<tr><td>';
echo 'celebration still needs:';
echo "</td><td><span id=\"timer".$timer."\">";
echo $generator->getTimeFormat($timeleft-time());
echo "</td><td><span id=\"timer".++$session->timer."\">";
echo $generator->getTimeFormat($timeleft - time());
echo "</span> hrs.</td>";
echo "<td>done at ".date('H:i', $timeleft)."</td></tr>";
echo "</table>";
$timer +=1;
}
?>
+2 -2
View File
@@ -17,7 +17,7 @@
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
@@ -28,7 +28,7 @@
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
?>
+2 -2
View File
@@ -17,7 +17,7 @@
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
@@ -28,7 +28,7 @@
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
?>
+21 -2
View File
@@ -1,5 +1,10 @@
<?php
$artefact = $database->getArtefactDetails($_GET['show']);
if(empty($artefact)){
header("location: build.php?gid=27");
exit;
}
if($artefact['size'] == 1 && $artefact['type'] != 11){
$reqlvl = 10;
$effect = VILLAGE;
@@ -9,11 +14,17 @@ if($artefact['size'] == 1 && $artefact['type'] != 11){
}
$activationTime = 86400 / (SPEED == 2 ? 1.5 : (SPEED == 3 ? 2 : SPEED));
$time = time();
$nextEffect = "-";
if($artefact['owner'] == 3) $active = "-";
elseif(!$artefact['active'] && $artefact['conquered'] < time() - $activationTime) $active = "<b>Can't be activated</b>";
elseif(!$artefact['active'] && $artefact['conquered'] < $time - $activationTime) $active = "<b>Can't be activated</b>";
elseif (!$artefact['active']) $active = date("Y-m-d H:i:s", $artefact['conquered'] + $activationTime);
else $active = "<b>".ACTIVE."</b>";
else
{
$active = "<b>".ACTIVE."</b>";
$nextEffect = date("Y-m-d H:i:s", $artefact['lastupdate'] + (86400 / (SPEED == 2 ? 1.5 : (SPEED == 3 ? 2 : SPEED))));
}
//// Added by brainiac - thank you
if ($artefact['type'] == 8)
@@ -120,6 +131,14 @@ $bonus = isset($betterorbadder) ? $betterorbadder." (<b>".str_replace(["(", ")"]
<th><?php echo TIME_ACTIVATION; ?></th>
<td><?php echo $active;?></td>
</tr>
<?php if($artefact['type'] == 8){?>
<tr>
<th><?php echo NEXT_EFFECT; ?></th>
<td><?php echo $nextEffect;?></td>
</tr>
<?php }?>
</tbody></table>
<table class="art_details" cellpadding="1" cellspacing="1">
<thead>
+2 -2
View File
@@ -40,7 +40,7 @@
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
@@ -51,7 +51,7 @@
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
include("upgrade.tpl");
+2 -2
View File
@@ -40,7 +40,7 @@
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
@@ -51,7 +51,7 @@
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
include("upgrade.tpl");
+1 -1
View File
@@ -93,7 +93,7 @@
<table id="distribution" cellpadding="1" cellspacing="1">
<thead>
<tr>
<?php echo "<tr class='next'><th>".HERO_READY."<span id=timer1>" . $timeleft . "</span></th></tr>"; ?>
<?php echo "<tr class='next'><th>".HERO_READY."<span id=timer".++$session->timer.">" . $timeleft . "</span></th></tr>"; ?>
</tr>
</thead>
+10 -3
View File
@@ -27,8 +27,8 @@ if($session->access != BANNED){
<tbody>
<?php
for ($i=0; $i<count($oasisarray); $i++) {
if(!empty($oasisarray)){
for($i = 0; $i < count($oasisarray); $i++){
$oasiscoor = $database->getCoor($oasisarray[$i]['wref']);
?>
<tr>
@@ -78,6 +78,13 @@ if($session->access != BANNED){
}
?></td>
</tr>
<?php } ?>
<?php
}
}else{
?>
<tr>
<td class="none" colspan="4"><?php echo NO_OASIS; ?></td>
</tr>
<?php }?>
</tbody>
</table>
+65 -99
View File
@@ -6,22 +6,6 @@
</thead>
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
/*-------------------------------------------------------*\
| ********* DO NOT REMOVE THIS COPYRIGHT NOTICE ********* |
+---------------------------------------------------------+
@@ -31,69 +15,63 @@
\*-------------------------------------------------------*/
// check if there is a hero in revive already
$reviving = false;
$training = false;
$reviving = $training = false;
foreach ($heroes as $hero_datarow) {
if ($hero_datarow['inrevive']) {
$reviving = true;
}
if ($hero_datarow['intraining']) {
$training = true;
}
if ($hero_datarow['inrevive']) $reviving = true;
if ($hero_datarow['intraining']) $training = true;
}
foreach ($heroes as $hero_datarow) {
if($hero_datarow['unit'] == 1) {
$name = U1;
} else if($hero_datarow['unit'] == 2) {
$name = U2;
} else if($hero_datarow['unit'] == 3) {
$name = U3;
} else if($hero_datarow['unit'] == 5) {
$name = U5;
} else if($hero_datarow['unit'] == 6) {
$name = U6;
} else if($hero_datarow['unit'] == 11) {
$name = U11;
} else if($hero_datarow['unit'] == 12) {
$name = U12;
} else if($hero_datarow['unit'] == 13) {
$name = U13;
} else if($hero_datarow['unit'] == 15) {
$name = U15;
} else if($hero_datarow['unit'] == 16) {
$name = U16;
} else if($hero_datarow['unit'] == 21) {
$name = U21;
} else if($hero_datarow['unit'] == 22) {
$name = U22;
} else if($hero_datarow['unit'] == 24) {
$name = U24;
} else if($hero_datarow['unit'] == 25) {
$name = U25;
} else if($hero_datarow['unit'] == 26) {
$name = U26;
}
if($hero_datarow['level'] <= 60){
$wood = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['wood']);
$clay = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['clay']);
$iron = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['iron']);
$crop = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['crop']);
$timeToTrain = round((${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['time']) / SPEED * $artefact_bonus2 / $artefact_bonus);
$training_time = $generator->getTimeFormat($timeToTrain);
$training_time2 = time() + $timeToTrain;
}else{
$wood = (${'h'.$hero_datarow['unit'].'_full'}[60]['wood']);
$clay = (${'h'.$hero_datarow['unit'].'_full'}[60]['clay']);
$iron = (${'h'.$hero_datarow['unit'].'_full'}[60]['iron']);
$crop = (${'h'.$hero_datarow['unit'].'_full'}[60]['crop']);
$timeToTrain = round((${'h'.$hero_datarow['unit'].'_full'}[60]['time']) / SPEED * $artefact_bonus2 / $artefact_bonus);
$training_time = $generator->getTimeFormat($timeToTrain);
$training_time2 = time() + $timeToTrain;
}
if($hero_datarow['unit'] == 1){
$name = U1;
}else if($hero_datarow['unit'] == 2){
$name = U2;
}else if($hero_datarow['unit'] == 3){
$name = U3;
}else if($hero_datarow['unit'] == 5){
$name = U5;
}else if($hero_datarow['unit'] == 6){
$name = U6;
}else if($hero_datarow['unit'] == 11){
$name = U11;
}else if($hero_datarow['unit'] == 12){
$name = U12;
}else if($hero_datarow['unit'] == 13){
$name = U13;
}else if($hero_datarow['unit'] == 15){
$name = U15;
}else if($hero_datarow['unit'] == 16){
$name = U16;
}else if($hero_datarow['unit'] == 21){
$name = U21;
}else if($hero_datarow['unit'] == 22){
$name = U22;
}else if($hero_datarow['unit'] == 24){
$name = U24;
}else if($hero_datarow['unit'] == 25){
$name = U25;
}else if($hero_datarow['unit'] == 26){
$name = U26;
}
if($hero_datarow['level'] <= 60){
$wood = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['wood']);
$clay = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['clay']);
$iron = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['iron']);
$crop = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['crop']);
$timeToTrain = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['time']) / SPEED);
$training_time = $generator->getTimeFormat($timeToTrain);
$training_time2 = time() + $timeToTrain;
}else{
$wood = (${'h'.$hero_datarow['unit'].'_full'}[60]['wood']);
$clay = (${'h'.$hero_datarow['unit'].'_full'}[60]['clay']);
$iron = (${'h'.$hero_datarow['unit'].'_full'}[60]['iron']);
$crop = (${'h'.$hero_datarow['unit'].'_full'}[60]['crop']);
$timeToTrain = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, (${'h'.$hero_datarow['unit'].'_full'}[60]['time']) / SPEED);
$training_time = $generator->getTimeFormat($timeToTrain);
$training_time2 = time() + $timeToTrain;
}
if($hero_datarow['inrevive'] == 1) {
$timeleft = $generator->getTimeFormat($hero_datarow['trainingtime'] - time());
@@ -101,7 +79,7 @@
<table id="distribution" cellpadding="1" cellspacing="1">
<thead>
<tr>
<?php echo "<tr class='next'><th>".HERO_READY." <span id=timer1>" . $timeleft . "</span></th></tr>"; ?>
<?php echo "<tr class='next'><th>".HERO_READY." <span id=timer".++$session->timer.">".$timeleft."</span></th></tr>"; ?>
</tr>
</thead>
@@ -117,12 +95,12 @@
</tr>
</table>
<?php }else if (!$reviving) { if($hero_datarow['unit'] == 1 OR 11 OR 21){ ?>
<?php }else if (!$reviving) if(in_array($hero_datarow['unit'], [1, 11, 21])){ ?>
<tr>
<td class="desc">
<div class="tit">
<img class="unit u<?php echo $hero_datarow['unit']; ?>" src="img/x.gif" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
<?php echo $name . " (Level " . $hero_datarow['level'] . ")"; ?>
<?php echo $name." (Level ".$hero_datarow['level'].")"; ?>
</div>
<div class="details">
<img class="r1" src="img/x.gif" alt="Wood" title="<?php echo LUMBER; ?>" /><?php echo $wood; ?>|
@@ -142,15 +120,15 @@
</div>
</td>
<td class="val" width="20%"><center>
<td class="val" width="20%" style="text-align: center">
<?php
if($village->awood < $wood OR $village->aclay < $clay OR $village->airon < $iron OR $village->acrop < $crop) {
if($village->awood < $wood || $village->aclay < $clay || $village->airon < $iron || $village->acrop < $crop) {
echo "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
}else {
echo "<a href=\"build.php?id=".$id."&amp;revive=1&amp;hid=".$hero_datarow['heroid']."\">".REVIVE."</a>";
}
?></center></td>
?></td>
</tr>
<?php }else { ?>
@@ -160,7 +138,7 @@
<td class="desc">
<div class="tit">
<img class="unit u<?php echo $hero_datarow['unit']; ?>" src="img/x.gif" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
<?php echo $name . " (Level " . $hero_datarow['level'] . ")"; ?>
<?php echo $name." (Level ".$hero_datarow['level'].")"; ?>
</div>
<div class="details">
<img class="r1" src="img/x.gif" alt="Wood" title="<?php echo LUMBER; ?>" /><?php echo $wood; ?>|
@@ -180,16 +158,16 @@
</div>
</td>
<td class="val" width="20%"><center>
<td class="val" width="20%" style="text-align: center">
<?php
if($village->awood < $wood OR $village->aclay < $clay OR $village->airon < $iron OR $village->acrop < $crop) {
if($village->awood < $wood || $village->aclay < $clay || $village->airon < $iron || $village->acrop < $crop) {
echo "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
}else {
echo "<a href=\"build.php?id=".$id."&amp;revive=1&amp;hid=".$hero_datarow['heroid']."\">".REVIVE."</a>";
}
?>
</center></td>
</td>
</tr>
<?php }
}
@@ -198,15 +176,7 @@
if(isset($_GET['revive']) && $_GET['revive'] == 1 && isset($_GET['hid']) && $_GET['hid'] == $hero_datarow['heroid'] && $hero_datarow['inrevive'] == 0 && $hero_datarow['intraining'] == 0 && $hero_datarow['dead'] == 1){
if($session->access != BANNED){
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".(int) $training_time2."', `wref` = '".(int) $village->wid."' WHERE `heroid` = ".(int) $_GET['hid']." AND `uid` = '".(int) $session->uid."'");
mysqli_query($database->dblink,"
UPDATE " . TB_PREFIX . "vdata
SET
`wood` = `wood` - ".(int) $wood.",
`clay` = `clay` - ".(int) $clay.",
`iron` = `iron` - ".(int) $iron .",
`crop` = `crop` - ".(int) $crop."
WHERE
`wref` = '" . (int) $village->wid . "'");
$database->modifyResource($village->wid, $wood, $clay, $iron, $crop, 0);
header("Location: build.php?id=".$id."");
exit;
} else {
@@ -214,15 +184,11 @@
exit;
}
}
}
?>
</table>
</table><br />
<?php
if(!$reviving && !$training) {
include ("37_train.tpl");
}
if(!$reviving && !$training) include ("37_train.tpl");
?>
+15 -32
View File
@@ -15,23 +15,6 @@
## ##
#################################################################################
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
//check if there is unit needed in the village
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".(int) $village->wid."");
@@ -63,7 +46,7 @@ if($session->tribe == 1) {
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u1['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
$output.=$generator->getTimeFormat(round($u1['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$output .= $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5,$u1['time'] / SPEED)*3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u1['wood'] + $u1['clay'] + $u1['iron'] + $u1['crop']);
@@ -102,7 +85,7 @@ if($session->tribe == 1) {
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u2['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
$output.=$generator->getTimeFormat(round($u2['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$output.=$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u2['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u2['wood'] + $u2['clay'] + $u2['iron'] + $u2['crop']);
@@ -142,7 +125,7 @@ if($session->tribe == 1) {
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
$output.= $generator->getTimeFormat(round($u3['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$output.= $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u3['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u3['wood'] + $u3['clay'] + $u3['iron'] + $u3['crop']);
@@ -180,7 +163,7 @@ if($session->tribe == 1) {
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u5['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u5['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u5['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u5['wood'] + $u5['clay'] + $u5['iron'] + $u5['crop']);
@@ -219,7 +202,7 @@ if($session->tribe == 1) {
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u6['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u6['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u6['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u6['wood'] + $u6['clay'] + $u6['iron'] + $u6['crop']);
@@ -261,7 +244,7 @@ $output.="<tr>
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u11['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u11['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u11['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u11['wood'] + $u11['clay'] + $u11['iron'] + $u11['crop']);
@@ -300,7 +283,7 @@ $output.="<tr>
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u12['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u12['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u12['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u12['wood'] + $u12['clay'] + $u12['iron'] + $u12['crop']);
@@ -341,7 +324,7 @@ $output.="<tr>
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
$generator->getTimeFormat(round($u13['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u13['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u13['wood'] + $u13['clay'] + $u13['iron'] + $u13['crop']);
@@ -380,7 +363,7 @@ $output.="<tr>
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u15['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u15['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u15['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u15['wood'] + $u15['clay'] + $u15['iron'] + $u15['crop']);
@@ -420,7 +403,7 @@ $output.="<tr>
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u16['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u16['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u16['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u16['wood'] + $u16['clay'] + $u16['iron'] + $u16['crop']);
@@ -462,7 +445,7 @@ $output.="<tr>
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u21['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u21['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u21['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u21['wood'] + $u21['clay'] + $u21['iron'] + $u21['crop']);
@@ -501,7 +484,7 @@ $output.="<tr>
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u22['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u22['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u22['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u22['wood'] + $u22['clay'] + $u22['iron'] + $u22['crop']);
@@ -541,7 +524,7 @@ $output.="<tr>
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u24['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u24['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u24['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u24['wood'] + $u24['clay'] + $u24['iron'] + $u24['crop']);
@@ -580,7 +563,7 @@ $output.="<tr>
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u25['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u25['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u25['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u25['wood'] + $u25['clay'] + $u25['iron'] + $u25['crop']);
@@ -620,7 +603,7 @@ $output.="<tr>
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u26['crop']."|
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u26['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u26['time'] / SPEED) * 3);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u26['wood'] + $u26['clay'] + $u26['iron'] + $u26['crop']);
+2 -2
View File
@@ -40,7 +40,7 @@
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
@@ -51,7 +51,7 @@
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
include("upgrade.tpl");
+1 -5
View File
@@ -30,9 +30,6 @@ $building->loadBuilding();
</tr></thead>
<tbody>
<?php
if(!isset($timer)) {
$timer = 1;
}
$BuildingList = array();
foreach($building->buildArray as $jobs) {
if($jobs['master'] == 0){
@@ -43,11 +40,10 @@ $building->loadBuilding();
if($jobs['loopcon'] == 1) {
echo " (waiting loop)";
}
echo "</td><td>in <span id=\"timer".$timer."\">";
echo "</td><td>in <span id=\"timer".++$session->timer."\">";
echo $generator->getTimeFormat($jobs['timestamp']-time());
echo "</span> hrs.</td>";
echo "<td>done at ".date('H:i', $jobs['timestamp'])."</td></tr>";
$timer +=1;
}else{
echo "<tr><td class=\"ico\"><a href=\"?d=".$jobs['id']."&a=0&c=$session->checker\">";
echo "<img src=\"img/x.gif\" class=\"del\" title=\"cancel\" alt=\"cancel\" /></a></td><td>";
+1 -1
View File
@@ -116,7 +116,7 @@ echo "<a href=\"spieler.php?s=3&id=".$session->uid."&a=1&e=4\"><img
title=\"Cancel process\" /> </a>";
$time=$generator->getTimeFormat(($timestamp-time()));
echo "The account will be deleted in <span
id=\"timer2\">".$time."</span> .</td>";
id=\"timer".++$session->timer."\">".$time."</span> .</td>";
}
else {
?>
+93 -82
View File
@@ -1,22 +1,27 @@
<?php
include('menu.tpl');
include ('menu.tpl');
?>
<table id="warehouse" cellpadding="1" cellspacing="1">
<thead><tr><th colspan="7">Warehouse</th></tr>
<tr><td>Village</td>
<td><img class="r1" src="img/x.gif" title="Wood" alt="Wood"></td>
<td><img class="r2" src="img/x.gif" title="Clay" alt="Clay"></td>
<td><img class="r3" src="img/x.gif" title="Iron" alt="Iron"></td>
<td><img class="clock" src="img/x.gif" title="Clock" alt="Clock"></td>
<td><img class="r4" src="img/x.gif" title="Crop" alt="Crop"></td>
<td><img class="clock" src="img/x.gif" title="Clock" alt="Clock"></td>
</tr></thead><tbody>
<thead>
<tr>
<th colspan="7">Warehouse</th>
</tr>
<tr>
<td>Village</td>
<td><img class="r1" src="img/x.gif" title="Wood" alt="Wood"></td>
<td><img class="r2" src="img/x.gif" title="Clay" alt="Clay"></td>
<td><img class="r3" src="img/x.gif" title="Iron" alt="Iron"></td>
<td><img class="clock" src="img/x.gif" title="Clock" alt="Clock"></td>
<td><img class="r4" src="img/x.gif" title="Crop" alt="Crop"></td>
<td><img class="clock" src="img/x.gif" title="Clock" alt="Clock"></td>
</tr>
</thead>
<tbody>
<?php
$varray = $database->getProfileVillages($session->uid);
$timer = 1;
foreach($varray as $vil){
$varray = $database->getProfileVillages($session->uid);
foreach($varray as $vil){
$vid = $vil['wref'];
$vdata = $database->getVillage($vid);
$vdata = $database->getVillage($vid);
$pop = $vdata['pop'];
$wood = floor($vdata['wood']);
$clay = floor($vdata['clay']);
@@ -24,98 +29,104 @@ foreach($varray as $vil){
$crop = floor($vdata['crop']);
$maxs = $vdata['maxstore'];
$maxc = $vdata['maxcrop'];
$vresarray = $database->getResourceLevel($vid);
$prod_wood = $sawmill = 0;
$prod_clay = $claypit = 0;
$prod_iron = $foundry = 0;
$prod_crop = $grainmill = $bakery = 0;
$woodholder = array();
$clayholder = array();
$ironholder = array();
$cropholder = array();
for($i=1;$i<=38;$i++) {
if($vresarray['f'.$i.'t'] == 1) {
array_push($woodholder,'f'.$i);
} elseif($vresarray['f'.$i.'t'] == 5) {
$sawmill = $vresarray['f'.$i];
} elseif($vresarray['f'.$i.'t'] == 2) {
array_push($clayholder,'f'.$i);
} elseif($vresarray['f'.$i.'t'] == 6) {
$claypit = $vresarray['f'.$i];
} elseif($vresarray['f'.$i.'t'] == 3) {
array_push($ironholder,'f'.$i);
} elseif($vresarray['f'.$i.'t'] == 7) {
$foundry = $vresarray['f'.$i];
} elseif($vresarray['f'.$i.'t'] == 4) {
array_push($cropholder,'f'.$i);
} elseif($vresarray['f'.$i.'t'] == 8) {
$grainmill = $vresarray['f'.$i];
} elseif($vresarray['f'.$i.'t'] == 9) {
$bakery = $vresarray['f'.$i];
}
$prod_wood = $sawmill = $prod_clay = $claypit = $prod_iron = $foundry = $prod_crop = $grainmill = $bakery = 0;
$woodholder = $clayholder = $ironholder = $cropholder = [];
for($i = 1; $i <= 38; $i++){
if($vresarray['f'.$i.'t'] == 1) array_push($woodholder, 'f'.$i);
elseif($vresarray['f'.$i.'t'] == 5) $sawmill = $vresarray['f'.$i];
elseif($vresarray['f'.$i.'t'] == 2) array_push($clayholder, 'f'.$i);
elseif($vresarray['f'.$i.'t'] == 6) $claypit = $vresarray['f'.$i];
elseif($vresarray['f'.$i.'t'] == 3) array_push($ironholder, 'f'.$i);
elseif($vresarray['f'.$i.'t'] == 7) $foundry = $vresarray['f'.$i];
elseif($vresarray['f'.$i.'t'] == 4) array_push($cropholder, 'f'.$i);
elseif($vresarray['f'.$i.'t'] == 8) $grainmill = $vresarray['f'.$i];
elseif($vresarray['f'.$i.'t'] == 9) $bakery = $vresarray['f'.$i];
}
for($i=0;$i<=count($woodholder)-1;$i++) { $prod_wood+= $bid1[$vresarray[$woodholder[$i]]]['prod']; }
for($i=0;$i<=count($clayholder)-1;$i++) { $prod_clay+= $bid2[$vresarray[$clayholder[$i]]]['prod']; }
for($i=0;$i<=count($ironholder)-1;$i++) { $prod_iron+= $bid3[$vresarray[$ironholder[$i]]]['prod']; }
for($i=0;$i<=count($cropholder)-1;$i++) { $prod_crop+= $bid4[$vresarray[$cropholder[$i]]]['prod']; }
if($sawmill >= 1) {
$prod_wood += $prod_wood /100 * $bid5[$sawmill]['attri'];
for($i = 0; $i <= count($woodholder) - 1; $i++){
$prod_wood += $bid1[$vresarray[$woodholder[$i]]]['prod'];
}
if($claypit >= 1) {
$prod_clay += $prod_clay /100 * $bid6[$claypit]['attri'];
for($i = 0; $i <= count($clayholder) - 1; $i++){
$prod_clay += $bid2[$vresarray[$clayholder[$i]]]['prod'];
}
if($foundry >= 1) {
$prod_iron += $prod_iron /100 * $bid7[$foundry]['attri'];
for($i = 0; $i <= count($ironholder) - 1; $i++){
$prod_iron += $bid3[$vresarray[$ironholder[$i]]]['prod'];
}
if ($grainmill >= 1 || $bakery >= 1) {
$prod_crop += $prod_crop /100 * ((isset($bid8[$grainmill]['attri']) ? $bid8[$grainmill]['attri'] : 0) + (isset($bid9[$bakery]['attri']) ? $bid9[$bakery]['attri'] : 0));
for($i = 0; $i <= count($cropholder) - 1; $i++){
$prod_crop += $bid4[$vresarray[$cropholder[$i]]]['prod'];
}
if($sawmill >= 1) $prod_wood += $prod_wood / 100 * $bid5[$sawmill]['attri'];
if($claypit >= 1) $prod_clay += $prod_clay / 100 * $bid6[$claypit]['attri'];
if($foundry >= 1) $prod_iron += $prod_iron / 100 * $bid7[$foundry]['attri'];
if($grainmill >= 1 || $bakery >= 1){
$prod_crop += $prod_crop / 100 * ((isset($bid8[$grainmill]['attri']) ? $bid8[$grainmill]['attri'] : 0) + (isset($bid9[$bakery]['attri']) ? $bid9[$bakery]['attri'] : 0));
}
$oasisowned = $database->getOasis($vid);
//more oasis logic required
if($session->plus) {
// more oasis logic required
if($session->plus){
$prod_wood *= 1.25;
$prod_clay *= 1.25;
$prod_iron *= 1.25;
$prod_crop *= 1.25;
}
$prod_wood *= SPEED;
$prod_clay *= SPEED;
$prod_iron *= SPEED;
$prod_crop *= SPEED;
$prod_crop -= $pop;
$prod_crop -= $technology->getUpkeep($technology->getAllUnits($vid),0);
$prod_crop -= $technology->getUpkeep($technology->getAllUnits($vid), 0);
$percentW = floor($wood / ($maxs / 100));
$percentC = floor($clay / ($maxs / 100));
$percentI = floor($iron / ($maxs / 100));
$percentCr = floor($crop / ($maxc / 100));
if($vid == $village->wid) $class = 'hl';
else $class = '';
$cr = 95; // warning percentage
if($percentW >= $cr) $critW = 'crit';
else $critW = '';
$percentW = floor($wood/($maxs/100));
$percentC = floor($clay/($maxs/100));
$percentI = floor($iron/($maxs/100));
$percentCr = floor($crop/($maxc/100));
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 = '';}
if($percentI >= $cr) {$critI = 'crit';} else {$critI = '';}
if($percentCr >= $cr) {$critCR = 'crit';} else {$critCR = '';}
$timerwood = floor(($maxs-$wood)/$prod_wood*3600);
$timerclay = floor(($maxs-$clay)/$prod_clay*3600);
$timeriron = floor(($maxs-$iron)/$prod_iron*3600);
$timer1 = min($timerwood,$timerclay,$timeriron);
$timer2 = floor(($maxc-$crop)/$prod_crop*3600);
if($percentC >= $cr) $critC = 'crit';
else $critC = '';
if($percentI >= $cr) $critI = 'crit';
else $critI = '';
if($percentCr >= $cr) $critCR = 'crit';
else $critCR = '';
if($prod_crop < 0) $critCR = $critNCR = 'crit';
else $critNCR = '';
$timerwood = floor(($maxs - $wood) / $prod_wood * 3600);
$timerclay = floor(($maxs - $clay) / $prod_clay * 3600);
$timeriron = floor(($maxs - $iron) / $prod_iron * 3600);
$timer1 = min($timerwood, $timerclay, $timeriron);
$timer2 = floor(($prod_crop >= 0 ? $maxc - $crop : $crop) / abs($prod_crop) * 3600);
if($timer1 > 0) $session->timer++;
echo '<tr class="'.$class.'">
<td class="vil fc"><a href="dorf1.php?newdid='.$vid.'">'.$vdata['name'].'</a></td>
<td class="lum '.$critW.'" title="'.$wood.'/'.$maxs.'">'.$percentW.'%</td>
<td class="clay '.$critC.'" title="'.$clay.'/'.$maxs.'">'.$percentC.'%</td>
<td class="iron '.$critI.'" title="'.$iron.'/'.$maxs.'">'.$percentI.'%</td>
<td class="max123"><span '.($timer1>0?'id="timer'.$timer.'"':'').'>'.($timer1>=0?$generator->getTimeFormat($timer1):'never').'</span></td>';
if($timer1 >0) { $timer++; }
<td class="max123"><span '.($timer1 > 0 ? 'id="timer'.$session->timer.'"' : '').'>'.($timer1 >= 0 ? $generator->getTimeFormat($timer1) : 'Never').'</span></td>';
if($timer2 > 0) $session->timer++;
echo '
<td class="crop '.$critCR.'" title="'.$crop.'/'.$maxc.'">'.$percentCr.'%</td>
<td class="max4 lc"><span '.($timer2>0?'id="timer'.$timer.'"':'').'>'.($timer2>=0?$generator->getTimeFormat($timer2):'never').'</span></td></tr>';
if($timer1 >0) { $timer++; }
<td class="max4 '.$critNCR.'"><span '.($timer2 > 0 ? 'id="timer'.$session->timer.'"' : '').'>'.($timer2 >= 0 ? $generator->getTimeFormat($timer2) : 'Never').'</span></td></tr>';
}
?>
</tbody></table>
</tbody>
</table>
+15 -26
View File
@@ -1,6 +1,4 @@
<?php
$FLData = $database->getFLData($_GET['lid']);
if($FLData['owner'] == $session->uid){
if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
$troops = 0;
@@ -56,7 +54,7 @@ if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
return round($dist, 1);
}
$distance = getDistance($coor['x'], $coor['y'], $WrefX, $WrefY);
$distance = getDistance($coor['x'], $coor['y'], $WrefX, $WrefY);
$database->addSlotFarm($_POST['lid'], $session->uid, $Wref, $WrefX, $WrefY, $distance, $_POST['t1'], $_POST['t2'], $_POST['t3'], $_POST['t4'], $_POST['t5'], $_POST['t6'], $_POST['t7'], $_POST['t8'], $_POST['t9'], $_POST['t10']);
header("Location: build.php?id=39&t=99");
@@ -71,7 +69,7 @@ if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
<?php echo $errormsg; ?>
</b></font>
<form action="build.php?id=39&t=99&action=addraid&lid=<?php echo $_GET['lid']; ?>" method="post">
<form action="build.php?id=39&t=99&action=addraid" method="post">
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
<input type="hidden" name="action" value="addSlot">
<table cellpadding="1" cellspacing="1" class="transparent" id="raidList">
@@ -81,17 +79,16 @@ if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
<select name="lid">
<?php
$sql = mysqli_query($database->dblink,"SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY name ASC");
while($row = mysqli_fetch_array($sql)){
$lid = $row["id"];
$lname = $row["name"];
$lowner = $row["owner"];
$lwref = $row["wref"];
$lvname = $database->getVillageField($row["wref"], 'name');
if($_GET['lid']==$lid){
$selected = 'selected=""';
}else{ $selected = ''; }
echo '<option value="'.$lid.'" '.$selected.'>'.$lvname.' - '.$lname.'</option>';
$sql = mysqli_query($database->dblink, "SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int)$session->uid." ORDER BY name ASC");
while($row = mysqli_fetch_array($sql)){
$lid = $row["id"];
$lname = $row["name"];
$lowner = $row["owner"];
$lwref = $row["wref"];
$lvname = $database->getVillageField($row["wref"], 'name');
if($_GET['lid'] == $lid) $selected = 'selected=""';
else $selected = '';
echo '<option value="'.$lid.'" '.$selected.'>'.$lvname.' - '.$lname.'</option>';
}
?>
</select>
@@ -126,12 +123,11 @@ if(mysqli_num_rows(mysqli_query($database->dblink,$getwref)) != 0){
$towref = $row["towref"];
$tocoor = $database->getCoor($towref);
$totype = $database->getVillageType2($towref);
$tooasistype = $type['oasistype'];
if($tooasistype == 0) $tovname = $database->getVillageField($towref, 'name');
if($totype == 0) $tovname = $database->getVillageField($towref, 'name');
else $tovname = $database->getOasisField($towref, 'name');
if($vill[$towref] == 0){
echo '<option value="'.$towref.'">'.$tovname.'('.$tocoor['x'].'|'.$tocoor['y'].')</option>';
echo '<option value="'.$towref.'">'.$tovname.' ('.$tocoor['x'].'|'.$tocoor['y'].')</option>';
}
$vill[$towref] = 1;
}
@@ -147,13 +143,6 @@ if(mysqli_num_rows(mysqli_query($database->dblink,$getwref)) != 0){
</div>
<?php include("Templates/goldClub/trooplist2.tpl"); ?>
<br />
<button type="submit" value="save" name="save" id="save" class="trav_buttons">Save</button>
<button type="submit" value="save" name="save" id="save" class="trav_buttons">Create</button>
</form>
</div>
<?php
}else{
header("Location: build.php?id=39&t=99");
exit;
}
?>
+3 -3
View File
@@ -135,14 +135,14 @@ if(mysqli_num_rows(mysqli_query($database->dblink, $getwref)) != 0){
$towref = $row["towref"];
$tocoor = $database->getCoor($towref);
$totype = $database->getVillageType2($towref);
$tooasistype = $type['oasistype'];
if($tooasistype == 0) $tovname = $database->getVillageField($towref, 'name');
if($totype == 0) $tovname = $database->getVillageField($towref, 'name');
else $tovname = $database->getOasisField($towref, 'name');
if($row["id"] == $_GET['eid']) $selected = 'selected=""';
else $selected = '';
if($vill[$towref] == 0){
echo '<option value="' . $towref . '" ' . $selected . '>' . $tovname . '(' . $tocoor['x'] . '|' . $tocoor['y'] . ')</option>';
echo '<option value="'.$towref.'" '.$selected.'>'.$tovname.' ('.$tocoor['x'].'|'.$tocoor['y'].')</option>';
}
$vill[$towref] = 1;
}
+11 -8
View File
@@ -67,20 +67,23 @@ div.c1 {text-align: center}
<?php
}
include("Templates/links.tpl");
include("Templates/natars.tpl")
?>
</p>
<?php
$timestamp = $database->isDeleting($session->uid);
if($timestamp) {
if($timestamp){
echo "<br /><td colspan=\"2\" class=\"count\">";
if($timestamp > time()+48*3600) {
echo "<a href=\"spieler.php?s=3&id=".$session->uid."&a=1&e=4\"><img
class=\"del\" src=\"img/x.gif\" alt=\"Cancel process\"
title=\"Cancel process\" /> </a>";
if($timestamp > time() + 172800){
echo "<a href=\"spieler.php?s=3&id=" . $session->uid . "&a=1&e=4\"><img
class=\"del\" src=\"img/x.gif\" alt=\"Cancel process\"
title=\"Cancel process\" /> </a>";
}
$time=$generator->getTimeFormat(($timestamp-time()));
echo "<a href=\"spieler.php?s=3\"> The account will be deleted in <span
id=\"timer1\">".$time."</span> .</a></td><br />";
$time = $generator->getTimeFormat(($timestamp - time()));
echo "<a href=\"spieler.php?s=3\"> The account will be deleted in <span
id=\"timer" . ++$session->timer . "\">" . $time . "</span> .</a></td><br />";
}
?>
</div><?php
+7 -21
View File
@@ -20,13 +20,7 @@ if($aantal > 0){
echo '<table id="movements" cellpadding="1" cellspacing="1"><thead><tr><th colspan="3">'.TROOP_MOVEMENTS.'</th></tr></thead><tbody>';
}
$NextArrival = array();
$NextArrival1 = array();
$NextArrival2 = array();
$NextArrival3 = array();
$NextArrival4 = array();
$NextArrival5 = array();
$NextArrival6 = array();
$NextArrival = $NextArrival1 = $NextArrival2 = $NextArrival3 = $NextArrival4 = $NextArrival5 = $NextArrival6 = [];
/* 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));
@@ -64,8 +58,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.'">&raquo;</span></td>
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
$timer += 1;
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
}
/* attack/raid on you! */
@@ -89,8 +82,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.'">&raquo;</span></td>
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival1)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
$timer += 1;
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival1)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
}
/* on attack, raid */
@@ -112,8 +104,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.'">&raquo;</span></td>
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival2)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
$timer += 1;
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival2)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
}
/* Units send to reinf. (to other town) */
@@ -135,8 +126,7 @@ if($lala > 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.'">&raquo;</span></td>
<td><div class="mov"><span class="'.$aclass.'">'.$lala.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival3)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
$timer += 1;
<td><div class="mov"><span class="'.$aclass.'">'.$lala.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival3)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
}
/* Found NEW VILLAGE by Shadow */
@@ -154,9 +144,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.'">&raquo;</span></td>
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival5)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
$timer += 1;
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival5)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
}
/* Attacks on Oasis (to my oasis) by Shadow */
@@ -186,7 +174,5 @@ 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.'">&raquo;</span></td>
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival6)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
$timer += 1;
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.'&nbsp;'.$short.'</span></div><div class="dur_r">in&nbsp;<span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival6)-time()).'</span>&nbsp;'.HOURS.'</div></div></td></tr>';
}
+32
View File
@@ -0,0 +1,32 @@
<?php
$time = time();
$artifactsSpawn = (COMMENCE + NATARS_SPAWN_TIME * 86400) - $time;
$wwSpawn = (COMMENCE + NATARS_WW_SPAWN_TIME * 86400) - $time;
$wwBuildingPlansSpawn = (COMMENCE + NATARS_WW_BUILDING_PLAN_SPAWN_TIME * 86400) - $time;
$daysToDisplay = 432000 / SPEED; //5 days / SPEED of the server
if($artifactsSpawn <= $daysToDisplay && $artifactsSpawn > 0){
?>
<br /><br />
<div>
<span><b>Artifacts</b> will spawn in: </span>
<span id="timer<?php echo ++$session->timer; ?>"><?php echo $generator->getTimeFormat($artifactsSpawn); ?></span>
</div>
<?php }
if($wwSpawn <= $daysToDisplay && $wwSpawn > 0){
?>
<br /><br />
<div>
<span><b>WW villages</b> will spawn in: </span>
<span id="timer<?php echo ++$session->timer; ?>"><?php echo $generator->getTimeFormat($wwSpawn); ?></span>
</div>
<?php }
if($wwBuildingPlansSpawn <= $daysToDisplay && $wwBuildingPlansSpawn > 0){ ?>
<br /><br />
<div>
<span><b>WW building plans</b> will spawn in: </span>
<span id="timer<?php echo ++$session->timer; ?>"><?php echo $generator->getTimeFormat($wwBuildingPlansSpawn); ?></span>
</div>
<?php } ?>