Files
TravianZ/Templates/natars.tpl
iopietro 0322a0ae49 General fixes
+Fixed a bug that permitted to see troops movement with a 0 level rally
point
+Fixed a bug that permitted to send attacks, enforcements, etc. with a 0
level rally point
+Fixed a bug that counted the moral bonus for attacks against WW
villages
+Fixed a bug that didn't permit to finish all buildings/researches, etc.
without a plus account
+Recoded part of Natars timer for being more generic
+Natars/Artifacts spawn, WW villages spawn, WW building plans spawn are
now based on the start date of the server and not on the installation
date
+Better indentation of some code
2018-05-18 15:46:15 +02:00

17 lines
741 B
Smarty

<?php
$time = time(); //The actual time
$startDate = strtotime(START_DATE); //When the server has started
$daysToDisplay = 432000 / SPEED; //5 days / SPEED of the server
$spawnTimeArray = ["Artifacts" => ($startDate + NATARS_SPAWN_TIME * 86400) - $time,
"WW villages" => ($startDate + NATARS_WW_SPAWN_TIME * 86400) - $time,
"WW building plans" => ($startDate + NATARS_WW_BUILDING_PLAN_SPAWN_TIME * 86400) - $time];
foreach($spawnTimeArray as $text => $spawnTime){
if($spawnTime <= $daysToDisplay && $spawnTime > 0){
?>
<br /><br />
<div>
<span><b><?php echo $text; ?></b> will spawn in: </span>
<span id="timer<?php echo ++$session->timer; ?>"><?php echo $generator->getTimeFormat($spawnTime); ?></span>
</div>
<?php }} ?>