Files
TravianZ/Templates/Build/27_show.tpl
iopietro 77136a9784 Artifacts update and optimizations
+Added the "Artifacts" section in the Admin Panel, which contains two
options: return a deleted artifact to the Natars and create new
Artifacts, assigned to a specified player
+Return to Natars coded, in the village section of the Admin Panel
+Moved a lot of functions and costants from Automation.php to the "new"
class Artifacts.php
+Optimized a lot the whole Natars creation process, decreased the number
of query of about 600
+Optimized a lot the function which deletes a player's account, it's now
executed almost instantly, even with players with a lot of villages
+Redesigned the map spawn system, using a more Travian-like village
distribution
+Fixed a bug that did show a broken village in the artifact chronology,
if that village was destroyed
+Reduced the amount of redundant code (about 230 lines) for
27_1.tpl/27_2.tpl and 27_3.tpl
+Fixed a bug that permitted to build the Great Granary and the Great
Warehouse in the whole account, with only a village effect artifact
+Fixed a bug in the Admin Panel map that didn't permit to show village
informations, if that village contained single quotes in its name
2018-07-24 03:04:25 +02:00

136 lines
3.5 KiB
Smarty

<?php
include_once("GameEngine/Artifacts.php");
$artifact = $database->getArtefactDetails($_GET['show']);
if(empty($artifact)){
header("location: build.php?gid=27");
exit;
}
$artifactInfo = Artifacts::getArtifactInfo($artifact);
?>
<div class="artefact image-<?php echo str_replace(['type', '.gif'], '', $artifact['img']); ?>">
<table id="art_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="2"><?php echo $artifact['name'];?></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" class="desc">
<span class="detail"><?php echo $artifact['desc'];?></span>
</td>
</tr>
<tr>
<th><?php echo OWNER; ?></th>
<td>
<?php if(($artifactOwnerUsername = $database->getUserField($artifact['owner'], "username", 0)) != "[?]"){?>
<a href="spieler.php?uid=<?php echo $artifact['owner'];?>"><?php echo $artifactOwnerUsername; ?></a>
<?php }else{?>
<font color="grey"><span>[?]</span></font>
<?php } ?>
</td>
</tr>
<tr>
<th><?php echo VILLAGE; ?></th>
<td>
<?php if($database->checkVilExist($artifact['vref'])){?>
<a href="karte.php?d=<?php echo $artifact['vref'];?>&c=<?php echo $generator->getMapCheck($artifact['vref']);?>"><?php echo $database->getVillageField($artifact['vref'], "name");?> </a>
<?php }else{?>
<font color="grey"><span>[?]</span></font>
<?php }?>
</td>
</tr>
<tr>
<th><?php echo ALLIANCE; ?></th>
<td>
<?php if(($alliance = $database->getUserField($artifact['owner'], "alliance", 0)) > 0){ ?>
<a href="allianz.php?aid=<?php echo $alliance;?>"><?php echo $database->getAllianceName($alliance); ?></a>
<?php }else{?>
<span>-</span>
<?php }?>
</td>
</tr>
<tr>
<th><?php echo AREA_EFFECT; ?></th>
<td><?php echo $artifactInfo['effectInfluence']; ?></td>
</tr>
<tr>
<th><?php echo BONUS; ?></th>
<td><?php echo $artifactInfo['bonus']; ?></td>
</tr>
<tr>
<th><?php echo REQUIRED_LEVEL; ?></th>
<td><?php echo TREASURY; ?> <?php echo LEVEL; ?> <b><?php echo $artifactInfo['requiredLevel']; ?></b></td>
</tr>
<tr>
<th><?php echo TIME_CONQUER; ?></th>
<td><?php echo ($artifact['owner'] != 3) ? date("d.m.Y H:i:s", $artifact['conquered']) : "-";?></td>
</tr>
<tr>
<th><?php echo TIME_ACTIVATION; ?></th>
<td><?php echo $artifactInfo['active'];?></td>
</tr>
<?php if($artifact['type'] == 8){?>
<tr>
<th><?php echo NEXT_EFFECT; ?></th>
<td><?php echo $artifactInfo['nextEffect'];?></td>
</tr>
<?php }?>
</tbody></table>
<table class="art_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="3"><?php echo FORMER_OWNER; ?></th>
</tr>
<tr>
<td><?php echo PLAYER; ?></td>
<td><?php echo VILLAGE; ?></td>
<td><?php echo CONQUERED; ?></td>
</tr>
</thead>
<tbody>
<?php
$owners = $database->getArtifactsChronology($_GET['show']);
if(!empty($owners)){
foreach($owners as $owner){
?>
<tr>
<td>
<?php if(($artifactChronoOwnerUsername = $database->getUserField($owner['uid'], "username", 0)) != "[?]"){?>
<span class="none"><a href="spieler.php?uid=<?php echo $owner['uid'];?>"><?php echo $artifactChronoOwnerUsername;?></a></span>
<?php }else{?>
<span class="none">[?]</span>
<?php }?>
</td>
<td>
<?php if($database->checkVilExist($owner['vref'])){?>
<span class="none"><a href="karte.php?d=<?php echo $owner['vref'];?>&c=<?php echo $generator->getMapCheck($owner['vref']);?>"><?php echo $database->getVillageField($owner['vref'], "name");?></a></span>
<?php }else{?>
<span class="none">[?]</span>
<?php }?>
</td>
<td><span class="none"><?php echo date("d.m.Y H:i:s", $owner['conqueredtime']);?></span></td>
</tr>
<?php
}
}else{
?>
<tr>
<td colspan="3"><span class="none"><?php echo NO_PREVIOUS_OWNERS; ?></span></td>
</tr>
<?php
}
?>
</tbody></table></div>