Files
TravianZ/Templates/Build/26_2.tpl
T
novgorodschi catalin 55e6dd60b5 Refactor + BugFix
1. Fix a bug in Admin Panel that you can edit by yourself your rank, now you cannot edit your rank anymore.

2. Now Alliance Leader can edit his own Position

3. Fix negative value on Demolition Building, now in database at lvl is appear new level not -1

4. Refactor Ajax map, now all is alligned (Ajax folder and Map folder)

5. Fix bug from Palace (when change capital now Automation recount population automaticaly on old capital and new capital)
2026-05-18 09:18:35 +03:00

51 lines
1.8 KiB
Smarty

<?php
// 26_2.tpl - PALACE / POINT CULTURE
global $database, $session, $village;
$level = (int)$village->resarray['f'.$id];
$isNatar = (int)$database->getVillageField($village->wid, 'natar') === 1;
// ia datele o singură dată
$cpVillage = $isNatar ? 0 : (int)$database->getVillageField($village->wid, 'cp');
$cpTotal = (int)$database->getVSumField($session->uid, 'cp');
$villages = $database->getProfileVillages($session->uid);
$totalVillages = count($villages);
// calcul pentru următorul sat - fără variable variables
$cpMode = CP; // 0 = normal, 1 = speed
$cpArrayName = 'cp' . $cpMode;
$cpArray = $GLOBALS[$cpArrayName] ?? [];
$nextCpNeed = $cpArray[$totalVillages + 1] ?? 0;
$currentCp = (int)$session->cp;
?>
<div id="build" class="gid26">
<h1><?php echo PALACE; ?> <span class="level"><?php echo LEVEL.' '.$level; ?></span></h1>
<p class="build_desc">
<a href="#" onclick="return Popup(26,4,'gid');" class="build_logo">
<img class="building g26" src="img/x.gif" alt="<?php echo PALACE; ?>" title="<?php echo PALACE; ?>" />
</a>
<?php echo PALACE_DESC; ?>
</p>
<?php include("26_menu.tpl"); ?>
<p><?php echo RESIDENCE_CULTURE_DESC; ?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo PRODUCTION_POINTS; ?></th>
<td><b><?php echo $cpVillage; ?></b> <?php echo POINTS_DAY; ?></td>
</tr>
<tr>
<th><?php echo PRODUCTION_ALL_POINTS; ?></th>
<td><b><?php echo $cpTotal; ?></b> <?php echo POINTS_DAY; ?></td>
</tr>
</table>
<p>
<?php echo VILLAGES_PRODUCED; ?> <b><?php echo $currentCp; ?></b>
<?php echo POINTS_NEED; ?> <b><?php echo $nextCpNeed; ?></b>
<?php echo POINTS; ?>.
</p>
</div>