uid; $plusRes = mysqli_query( $database->dblink, "SELECT gold, plus, b1, b2, b3, b4, goldclub FROM " . TB_PREFIX . "users WHERE id = " . $plusUid . " LIMIT 1" ); $golds = $plusRes ? mysqli_fetch_assoc($plusRes) : null; if (!$golds) { // Fara randul utilizatorului nu avem ce afisa. Nu aratam eroarea bazei de // date jucatorului; o lasam in log, unde ii e locul. error_log('[TravianZ] plus/3.tpl: nu am putut citi datele utilizatorului ' . $plusUid . ': ' . mysqli_error($database->dblink)); $golds = array('gold' => 0, 'plus' => 0, 'b1' => 0, 'b2' => 0, 'b3' => 0, 'b4' => 0, 'goldclub' => 0); } include("Templates/Plus/pmenu.tpl"); $date2 = time(); /** * Abonamentul Plus expirat se marcheaza ACUM, inainte de afisare. * Inainte, actualizarea se facea la mijlocul randarii tabelului. */ if ((int) $golds['plus'] > 0 && (int) $golds['plus'] <= $date2) { mysqli_query($database->dblink, "UPDATE " . TB_PREFIX . "users SET plus = 0 WHERE id = " . $plusUid . " LIMIT 1"); $golds['plus'] = 0; $plusJustExpired = true; } else { $plusJustExpired = false; } if (!function_exists('formatRemainingTime')) { function formatRemainingTime($endTimestamp, $nowTimestamp) { $remaining = (int) $endTimestamp - (int) $nowTimestamp; if ($remaining <= 0) { return ''; } $days = intdiv($remaining, 86400); $remaining %= 86400; $hours = intdiv($remaining, 3600); $remaining %= 3600; $mins = intdiv($remaining, 60); $secs = $remaining % 60; return 'Remaining: ' . $days . ' ' . DAYS . ' ' . $hours . ' ' . HOURS . ' ' . $mins . ' ' . MINS . ' ' . $secs . ' secs (until ' . date('H:i:s', (int) $endTimestamp) . ')'; } } /** * Butonul de actiune, identic pentru toate randurile. * * @param int $gold aurul jucatorului * @param int $cost cat costa * @param int $until pana cand e activ bonusul (0 = inactiv) * @param int $linkId id-ul din plus.php?id=... * @param bool $banned contul e blocat */ if (!function_exists('plusActionCell')) { function plusActionCell($gold, $cost, $until, $linkId, $banned = false) { $guard = 'onclick="if(this.dataset.c) return false; this.dataset.c=1;' . ' this.style.pointerEvents=\'none\'; this.style.opacity=\'0.5\';"'; if ($banned) { return '' . TOO_LITTLE_GOLD . ''; } if ((int) $gold < (int) $cost) { return '' . TOO_LITTLE_GOLD . ''; } // activ inca -> prelungeste; altfel -> activeaza $label = ((int) $until > time()) ? EXTEND : ACTIVATE; return '' . $label . ''; } } /** * Cele patru bonusuri de productie. Asta e tot ce se schimba intre ele. */ $plusBonuses = array( array('css' => 'r1', 'label' => TZ_PRODUCTION_LUMBER, 'field' => 'b1', 'id' => 9, 'popup' => 1), array('css' => 'r2', 'label' => TZ_PRODUCTION_CLAY, 'field' => 'b2', 'id' => 10, 'popup' => 2), array('css' => 'r3', 'label' => TZ_PRODUCTION_IRON, 'field' => 'b3', 'id' => 11, 'popup' => 3), array('css' => 'r4', 'label' => TZ_PRODUCTION_CROP, 'field' => 'b4', 'id' => 12, 'popup' => 4), ); $plusIsBanned = (defined('BANNED') && $session->access == BANNED); $plusDuration = (PLUS_PRODUCTION >= 86400) ? (PLUS_PRODUCTION / 86400) . ' Days' : (PLUS_PRODUCTION / 3600) . ' Hours'; if ((int) $golds['gold'] === 0) { echo "
You currently don't own gold.
"; } else { echo '' . CURRENT_HAVE . ' ' . (int) $golds['gold'] . ' ' . GOLD . '
'; } ?>| Plus function | ||||
|---|---|---|---|---|
![]() |
Plus
'; } elseif ((int) $golds['plus'] === 0) { echo 'get PLUS '; } else { echo "" . formatRemainingTime($golds['plus'], $date2) . ''; } ?> |
= 86400) ? (PLUS_TIME / 86400) . ' Days' : (PLUS_TIME / 3600) . ' Hours'; ?> | 10 |
|
![]() |
+25%
= $date2) { echo "" . formatRemainingTime($until, $date2) . ''; } ?> |
5 |
||
![]() |
2 |
1) { echo '' . GOLD_ON . ''; } else { echo '' . TOO_LITTLE_GOLD . ''; } ?> | ||
![]() |
3 |
2) { echo '' . NPC . ''; } else { echo '' . TOO_LITTLE_GOLD . ''; } ?> | ||
| Redeem a gold code | ||||
|---|---|---|---|---|
![]() |
100 |
' . GOLD_ON . ''; } ?> | ||