From 28820ea02cc771f1e610b582cfb2e6a7209b883c Mon Sep 17 00:00:00 2001 From: Martin Kalabek Date: Thu, 17 Oct 2024 14:55:32 +0200 Subject: [PATCH] Add enforcements to "Troops on the Server" calculations --- Admin/Templates/server_info.tpl | 64 +++++++++++++++------------------ 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/Admin/Templates/server_info.tpl b/Admin/Templates/server_info.tpl index 80d8c57b..f13409ab 100644 --- a/Admin/Templates/server_info.tpl +++ b/Admin/Templates/server_info.tpl @@ -114,68 +114,62 @@ $users = mysqli_num_rows(mysqli_query($GLOBALS["link"], "SELECT SQL_CACHE * FROM Troops on the Server '; } + echo ''; - for($i=1; $i<11; $i++) - { - $t = mysqli_query($GLOBALS["link"], "SELECT SUM(u".$i.") AS sumof FROM ".TB_PREFIX."units"); - $troop = mysqli_fetch_assoc($t); - echo ''.$troop['sumof'].''; + for($i=1; $i<11; $i++) { + echo ''.($units_villages['u'.$i] + $units_enforcements['u'.$i]).''; } echo ""; - for($i=11; $i<21; $i++) - { + for($i=11; $i<21; $i++) { echo ''; } + echo ''; - for($i=11; $i<21; $i++) - { - $t = mysqli_query($GLOBALS["link"], "SELECT SUM(u".$i.") AS sumof FROM ".TB_PREFIX."units"); - $troop = mysqli_fetch_assoc($t); - echo ''.$troop['sumof'].''; + for($i=11; $i<21; $i++) { + echo ''.($units_villages['u'.$i] + $units_enforcements['u'.$i]).''; } echo ""; - for($i=21; $i<31; $i++) - { + for($i=21; $i<31; $i++) { echo ''; } + echo ''; - for($i=21; $i<31; $i++) - { - $t = mysqli_query($GLOBALS["link"], "SELECT SUM(u".$i.") AS sumof FROM ".TB_PREFIX."units"); - $troop = mysqli_fetch_assoc($t); - echo ''.$troop['sumof'].''; + for($i=21; $i<31; $i++) { + echo ''.($units_villages['u'.$i] + $units_enforcements['u'.$i]).''; } echo ""; - for($i=31; $i<41; $i++) - { + for($i=31; $i<41; $i++) { echo ''; } + echo ''; - for($i=31; $i<41; $i++) - { - $t = mysqli_query($GLOBALS["link"], "SELECT SUM(u".$i.") AS sumof FROM ".TB_PREFIX."units"); - $troop = mysqli_fetch_assoc($t); - echo ''.$troop['sumof'].''; + for($i=31; $i<41; $i++) { + echo ''.($units_villages['u'.$i] + $units_enforcements['u'.$i]).''; } echo ""; - for($i=41; $i<51; $i++) - { + for($i=41; $i<51; $i++) { echo ''; } + echo ''; - for($i=41; $i<51; $i++) - { - $t = mysqli_query($GLOBALS["link"], "SELECT SUM(u".$i.") AS sumof FROM ".TB_PREFIX."units"); - $troop = mysqli_fetch_assoc($t); - echo ''.$troop['sumof'].''; + for($i=41; $i<51; $i++) { + echo ''.($units_villages['u'.$i] + $units_enforcements['u'.$i]).''; } ?>