= 1000000000) return round($n / 1000000000, 2).'B'; if ($n >= 1000000) return round($n / 1000000, 2).'M'; if ($n >= 1000) return round($n / 1000, 1).'K'; return $n; } function q1($sql){ global $database; $r=$database->query($sql); return $r ? $r->fetch_assoc() : []; } // ---- DATE ---- $users = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."users WHERE tribe IN (1,2,3,6,7,8,9)")['c'] ?? 0); $active = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."active")['c'] ?? 0); $online = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."users WHERE timestamp > ".(time()-300)." AND tribe>0")['c'] ?? 0); $banned = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."users WHERE access=0")['c'] ?? 0); $villages = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."vdata")['c'] ?? 0); $pop = (int)(q1("SELECT SUM(pop) s FROM ".TB_PREFIX."vdata")['s'] ?? 0); $tribes = [1=>0,2=>0,3=>0,6=>0,7=>0,8=>0,9=>0]; foreach([1,2,3,6,7,8,9] as $t){ $tribes[$t] = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."users WHERE tribe=$t")['c'] ?? 0); } $gold = (int)(q1("SELECT SUM(gold) s FROM ".TB_PREFIX."users")['s'] ?? 0); // ---- TRUPE ---- $cells = ['SUM(hero) as hero']; for($i=1;$i<=90;$i++) $cells[] = "SUM(u$i) AS u$i"; $uv = q1("SELECT ".implode(',',$cells)." FROM ".TB_PREFIX."units"); $ue = q1("SELECT ".implode(',',$cells)." FROM ".TB_PREFIX."enforcement"); ?>

🌍 World Information

Registered players
Active players
Players online
Players banned
Villages settled
Total population

👥 Player Distribution

'Romans',2=>'Teutons',3=>'Gauls',6=>'Huns',7=>'Egyptians',8=>'Spartans',9=>'Vikings']; $colors=[1=>'romans',2=>'teutons',3=>'gauls',6=>'huns',7=>'egyptians',8=>'spartans',9=>'vikings']; foreach($names as $id=>$name){ $pct = $users ? round($tribes[$id]/$users*100,1) : 0; echo "
$name{$tribes[$id]} ($pct%)
"; echo "
"; } ?>

💰 Server Economy

Total Gold
Avg Gold/player
Server started
Uptime

⚔️ Troops on Server (villages + reinforcements)

range(1,10), 'Teutons' => range(11,20), 'Gauls' => range(21,30), 'Nature' => range(31,40), 'Natars' => range(41,50), 'Huns' => range(51,60), 'Egyptians' => range(61,70), 'Spartans' => range(71,80), 'Vikings' => range(81,90) ]; foreach($tribesUnits as $tribe=>$ids){ echo "

$tribe

"; $has=false; foreach($ids as $u){ $total = (int)($uv["u$u"] ?? 0) + (int)($ue["u$u"] ?? 0); if($total>0){ $has=true; echo "
u$u".formatNum($total)."
"; } } if(!$has) echo "
No troops
"; echo "
"; } $heroTotal = (int)($uv['hero'] ?? 0) + (int)($ue['hero'] ?? 0); echo "

Heroes

Hero".formatNum($heroTotal)."
"; ?>