From 5d6562f4b581331e138c87f5a83907faaa9bdcf1 Mon Sep 17 00:00:00 2001 From: novgorodschi catalin Date: Fri, 26 Jun 2026 13:06:55 +0300 Subject: [PATCH] Added case for Players attackers Added case for Players attackers @Ferywir must be added in Translate file please --- Templates/Ranking/ally_top10.tpl | 41 ++++++++++++++++++++++++++++++++ statistiken.php | 15 +++++++++--- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/Templates/Ranking/ally_top10.tpl b/Templates/Ranking/ally_top10.tpl index 8b6dea11..a39c1ac3 100644 --- a/Templates/Ranking/ally_top10.tpl +++ b/Templates/Ranking/ally_top10.tpl @@ -21,6 +21,27 @@ echo "Row ".$i; } + // --- ADDED: Week and Medal Reset calculation (identical to Automation.php) --- + $week = 1; + $nextReset = time() + MEDALINTERVAL; + $q = mysqli_query($database->dblink, "SELECT lastgavemedal FROM ".TB_PREFIX."config LIMIT 1"); + if($q && $rc = mysqli_fetch_assoc($q)){ + $last = (int)$rc['lastgavemedal']; + if($last > 0){ + $nextReset = $last; + while($nextReset <= time()){ $nextReset += MEDALINTERVAL; } + } else { + $setDays = round(MEDALINTERVAL/86400); + $nextReset = $setDays < 7 ? strtotime(($setDays + 1).' day midnight') : strtotime('next monday'); + } + } + $wq = mysqli_query($database->dblink, "SELECT week FROM ".TB_PREFIX."medal ORDER BY week DESC LIMIT 1"); + if($wq && mysqli_num_rows($wq)){ $week = mysqli_fetch_assoc($wq)['week'] + 1; } + $left = max(0, $nextReset - time()); + $days = floor($left / 86400); + $timeLeft = gmdate("H:i:s", $left % 86400); + // --- END MEDAL TIMER --- + $result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10"); $result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1"); ?> @@ -31,6 +52,26 @@ + + + + + +
+ Week:    Medal reset in: d +
+ diff --git a/statistiken.php b/statistiken.php index a3e0754a..0e2582e3 100644 --- a/statistiken.php +++ b/statistiken.php @@ -62,13 +62,22 @@ if (!empty($_GET['id'])) { echo 'WW'; break; case '7': - echo 'TOP 10'; + echo 'TOP 10 PLAYERS'; break; case '31': - echo 'Atacatori'; + echo 'ATTACKERS'; break; case '32': - echo 'Apărători'; + echo 'DEFENDERS'; + break; + case '41': + echo 'ALLIANCES Attackers'; + break; + case '42': + echo 'ALLIANCES Defenders'; + break; + case '43': + echo 'TOP 10 ALLIANCES'; break; case '1': echo PLAYERS;