diff --git a/Admin/Templates/addUsers.tpl b/Admin/Templates/addUsers.tpl index cd7cd4b6..c6a958c6 100644 --- a/Admin/Templates/addUsers.tpl +++ b/Admin/Templates/addUsers.tpl @@ -1,167 +1,152 @@ -
- - -
Create Users and Villages -

- -Submitting this form will create new Users and/or Villages on your server! - -
- -Includes resources, main building, rally point, warehouse, granary, wall, market, residence, troops (for hero level-up), and one cranny. - -

Base Name should be between 4 and 20 characters long

- - -Mode
-
- -

- - -How Many (accounts) should be between 1 and 200
-(Higher values might take a while or cause a crash!) -

- - -If you want to run this more than once you should use a different Base Name each time.
-
-Example (legacy):
-Base Name = Farm | How Many (accounts) = 5 → Users: Farm1..Farm5
-Example (single):
-Base Name = FarmLord | Villages = 5 → User: FarmLord with 5 villages -

-
Error: Base Name is too short (min 4 chars)'; - break; - case 'BN2L': - $baseNameFontColor = "Red"; - echo '

Error: Base Name is too long (max 20 chars)'; - break; - case 'AMLO': - $amountFontColor = "Red"; - echo '

Error: Minimum of 1 for How Many (accounts)'; - break; - case 'AMHI': - $amountFontColor = "Red"; - echo '

Error: Maximum of 200 for How Many (accounts)'; - break; - case 'VILO': - $villagesFontColor = "Red"; - echo '

Error: Minimum of 1 for Villages'; - break; - case 'VIHI': - $villagesFontColor = "Red"; - echo '

Error: Maximum of 200 for Villages'; - break; - default: - echo '

Error: Unknown'; - } +if(isset($_GET['e'])) { + $baseName = $_GET['bn']??$baseName; + $amount = $_GET['am']??$amount; + $villages = $_GET['vi']??$villages; + $mode = $_GET['mo']??$mode; + switch ($_GET['e']) { + case 'BN2S': $errorMsg = "Base Name prea scurt (minim 4 caractere)"; break; + case 'BN2L': $errorMsg = "Base Name prea lung (maxim 20 caractere)"; break; + case 'AMLO': $errorMsg = "Minim 1 cont"; break; + case 'AMHI': $errorMsg = "Maxim 200 conturi"; break; + case 'VILO': $errorMsg = "Minim 1 sat"; break; + case 'VIHI': $errorMsg = "Maxim 200 sate"; break; + default: $errorMsg = "Eroare necunoscută"; } - elseif ( isset($_GET['g']) && $_GET['g'] == 'OK') { - $baseName = ($_GET['bn']); - $mode = ($_GET['mo']); - $skipped = ($_GET['sk']); - $beginnersProtection = ($_GET['bp']); - - // interpret the tribe label - switch ($_GET['tr']) { - case '0': $tribe = RANDOM; break; - case '1': $tribe = TRIBE1; break; - case '2': $tribe = TRIBE2; break; - case '3': $tribe = TRIBE3; break; - default: $tribe = 'Unknown'; - } - - if ($mode === 'many_accounts') { - $amount = ($_GET['am']); - echo '

'.$amount.' Users (1 village each) added with Base Name '.$baseName.'
'; - } else { - $villages = ($_GET['vi']); - echo '

Created User '.$baseName.' with '.$villages.' villages.
'; - } - - if (($mode === 'many_accounts' && $amount > 0) || ($mode === 'single_with_villages' && $villages > 0)) { - $usersMessage = ($mode === 'many_accounts' ? (($amount > 1) ? 'these Users' : 'this User') : 'this User'); - $begMessage = 'Beginners Protection was '; - if (!$beginnersProtection) { $begMessage .= 'NOT '; } - $begMessage .= 'set for '.$usersMessage.'
'; - echo $begMessage; - - $tribeMessage = 'Tribe for '.$usersMessage.' was '.$tribe.'
'; - echo $tribeMessage; - } - - if ($skipped > 0) { - echo ''.$skipped.' Users not created as the user name already exists
'; - } - - echo '
Now would be a good time to Return to the server (updates rankings; may take a while)
' - . 'Make sure max_execution_time is set high enough in php.ini

'; - $baseName = ""; $amount = ""; $villages = ""; +} +elseif(isset($_GET['g']) && $_GET['g']=='OK'){ + $baseName = $_GET['bn']; $mode = $_GET['mo']; $skipped=(int)$_GET['sk']; $bp=(int)$_GET['bp']; + $tribe = [0=>RANDOM,1=>TRIBE1,2=>TRIBE2,3=>TRIBE3][$_GET['tr']]??'Unknown'; + + if($mode==='many_accounts'){ + $amount=(int)$_GET['am']; + $successMsg = "Creat $amount conturi cu baza $baseName"; + } else { + $villages=(int)$_GET['vi']; + $successMsg = "Creat contul $baseName cu $villages sate"; } + $successMsg .= "
Protecție: ".($bp?"DA":"NU")." | Trib: $tribe"; + if($skipped>0) $successMsg .= "
$skipped nume existente - sărite"; +} ?> -
-
+ + +
+

👤 Create Users

+ +
+
+
Submitting this form will create new Users and/or Villages on your server!
+
Includes resources, main building, rally point, warehouse, granary, wall, market, residence, troops (for hero level-up), and one cranny.
+
+ + + + +
+
+ +
+ + +
+ +
+ Base Name 4-20 caractere. Ex: Farm | 5 → Farm1..Farm5. Ex single: FarmLord | 5 sate.
+ Atenție: valori mari pot bloca serverul! +
+ +
+ + +
+ +
+ + +
+
1 - 200
+ +
+ + +
+
1 - 200 (doar single)
+ +
+ +
+ +
+
Trib
+
+ + + + +
+
+ +
+ +
- -
-Villages (for single account)    - -
- -
-Beginners Protection    -

-Tribe:
-
-
-
-
-

- - - + \ No newline at end of file diff --git a/Admin/Templates/admin_log.tpl b/Admin/Templates/admin_log.tpl index 16847284..d7771c00 100644 --- a/Admin/Templates/admin_log.tpl +++ b/Admin/Templates/admin_log.tpl @@ -10,38 +10,41 @@ getAdminLog(); $unified = []; foreach($adminLogs as $l) { + // FIX: sărim peste unban-urile din log-ul vechi, le luăm doar din banlist + if(stripos($l['log'], 'unbanned') !== false || stripos($l['log'], 'unban') !== false) { + continue; + } $unified[] = [ 'id' => $l['id'], 'time' => $l['time'], @@ -51,7 +54,7 @@ foreach($adminLogs as $l) { ]; } -// 2. Ban-uri și Unban-uri din banlist +// Ban-uri și Unban-uri din banlist $banQ = mysqli_query($GLOBALS["link"], " SELECT id, uid, name, reason, time, end, admin, active FROM ".TB_PREFIX."banlist @@ -61,14 +64,14 @@ $banQ = mysqli_query($GLOBALS["link"], " while($b = mysqli_fetch_assoc($banQ)) { // BAN $unified[] = [ - 'id' => 1000000 + $b['id'], // offset ca să nu se amestece ID-urile + 'id' => 1000000 + $b['id'], 'time' => $b['time'], 'user' => $b['admin'] ?: 1, 'type' => 'ban', 'text' => "Banned user {$b['name']} (Reason: {$b['reason']})", 'active' => $b['active'] ]; - // UNBAN - dacă e inactiv, folosim end ca timp de unban + // UNBAN if($b['active'] == 0 && $b['end'] > $b['time']) { $unified[] = [ 'id' => 2000000 + $b['id'], @@ -81,28 +84,51 @@ while($b = mysqli_fetch_assoc($banQ)) { } } -// 3. Sortează tot după timp DESC usort($unified, function($a,$b){ return $b['time'] <=> $a['time']; }); $unified = array_slice($unified, 0, 300); +$perPage = 20; +$page = isset($_GET['pg']) ? max(1,intval($_GET['pg'])) : 1; +$total = count($unified); +$totalPages = ceil($total / $perPage); +$offset = ($page-1) * $perPage; +$paged = array_slice($unified, $offset, $perPage); function logCategory($entry) { if($entry['type']=='ban') return ['BAN','cat-ban','🔨']; if($entry['type']=='unban') return ['UNBAN','cat-unban','🔓']; $t = strtolower(strip_tags($entry['text'])); + // FIX: prinde orice unban din text + if (strpos($t,'unban')!==false) return ['UNBAN','cat-unban','🔓']; if (strpos($t,'mass ban')!==false) return ['BAN','cat-ban','🔨']; - if (strpos($t,'mass unban')!==false) return ['UNBAN','cat-unban','🔓']; if (strpos($t,'gold')!==false) return ['GOLD','cat-gold','💰']; if (strpos($t,'plus')!==false && strpos($t,'bonus')===false) return ['PLUS','cat-plus','⭐']; if (strpos($t,'bonus')!==false) return ['BONUS','cat-plus','📈']; - if (strpos($t,'reset')!==false) return ['RESET','cat-maint','⚙️']; - if (strpos($t,'village')!==false || strpos($t,'buildings')!==false || strpos($t,'renamed')!==false) return ['VILLAGE','cat-village','🏘️']; - if (strpos($t,'message')!==false) return ['MESSAGE','cat-msg','✉️']; + if (strpos($t,'reset')!==false) return ['RESET','cat-maint','⚙']; + if (strpos($t,'village')!==false || strpos($t,'buildings')!==false || strpos($t,'renamed')!==false) return ['VILLAGE','cat-village','🏘']; + if (strpos($t,'message')!==false) return ['MESSAGE','cat-msg','✉']; return ['OTHER','cat-other','📝']; } ?> -

Admin Log Unificat - ultimele 300 acțiuni

+
+
+

📋 Admin Log Unificat - ultimele 300 acțiuni

+
- +
+ + + + + + + + + + +
+ +
+
@@ -114,7 +140,7 @@ function logCategory($entry) { getUserField($admid, "username", 0); $adminLink = $username ? ''.htmlspecialchars($username).'' : 'SYSTEM'; @@ -124,7 +150,7 @@ foreach($unified as $e) { $date = date("d.m.Y H:i:s", $e['time'] + 3600*2); $details = $e['text']; ?> - + @@ -134,7 +160,27 @@ foreach($unified as $e) {
ID
#
+
+1){ ?>« Prev + / +Next » +
+
+ - $limit) { ?> -

Afișate doar ultimele . Pentru istoric complet, exportă din phpMyAdmin tabelul s1_admin_log.

- \ No newline at end of file + \ No newline at end of file diff --git a/Admin/Templates/ban.tpl b/Admin/Templates/ban.tpl index dc629ced..40bcd89e 100644 --- a/Admin/Templates/ban.tpl +++ b/Admin/Templates/ban.tpl @@ -1,334 +1,154 @@ dblink, " - SELECT id, username - FROM ".TB_PREFIX."users - WHERE id = $uid - LIMIT 1 - "); - - if(!$userCheck || mysqli_num_rows($userCheck) == 0) - { - $error = "This user does not exist!"; - } - else - { - // ========================= - // CHECK ALREADY ACTIVE BAN - // ========================= - $check = mysqli_query($database->dblink, " - SELECT id - FROM ".TB_PREFIX."banlist - WHERE uid = $uid - AND active = 1 - LIMIT 1 - "); - - if(mysqli_num_rows($check) > 0) - { - $error = "User is already banned!"; - } - else - { + if($uid <= 0) $error = "Invalid User ID!"; + elseif(in_array($uid,$blocked)) $error = "You cannot ban system accounts!"; + else { + $userCheck = mysqli_query($database->dblink,"SELECT id,username FROM ".TB_PREFIX."users WHERE id=$uid LIMIT 1"); + if(!$userCheck || mysqli_num_rows($userCheck)==0) $error = "This user does not exist!"; + else { + $check = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."banlist WHERE uid=$uid AND active=1 LIMIT 1"); + if(mysqli_num_rows($check)>0) $error = "User is already banned!"; + else { $user = mysqli_fetch_assoc($userCheck); $name = $user['username']; - $end = ($time > 0) ? (time() + $time) : 0; - - // ========================= - // INSERT BAN (ACTIVE) - // ========================= - $currentTime = time(); - - $stmt = $database->dblink->prepare(" - INSERT INTO `".TB_PREFIX."banlist` - (uid, name, reason, time, end, admin, active) - VALUES - (?, ?, ?, ?, ?, 0, 1) - "); - - if ($stmt) { - // i = integer, s = string - $stmt->bind_param("issii", $uid, $name, $reason, $currentTime, $end); - $stmt->execute(); - $stmt->close(); - } else { - $error = "Database error (ban insert): " . $database->dblink->error; - } - - // ========================= - // BLOCK USER ACCESS - // ========================= - if (empty($error)) { - $stmt2 = $database->dblink->prepare(" - UPDATE `".TB_PREFIX."users` - SET access = 0 - WHERE id = ? - LIMIT 1 - "); - - if ($stmt2) { - $stmt2->bind_param("i", $uid); - $stmt2->execute(); - $stmt2->close(); - } else { - $error = "Database error (access update): " . $database->dblink->error; - } -} - if (empty($error)) { - $success = "User has been banned successfully!"; -} + $end = $time>0 ? time()+$time : 0; + $stmt = $database->dblink->prepare("INSERT INTO `".TB_PREFIX."banlist` (uid,name,reason,time,end,admin,active) VALUES (?,?,?,?,?,0,1)"); + $now = time(); + $stmt->bind_param("issii",$uid,$name,$reason,$now,$end); + $stmt->execute(); $stmt->close(); + $stmt2 = $database->dblink->prepare("UPDATE `".TB_PREFIX."users` SET access=0 WHERE id=? LIMIT 1"); + $stmt2->bind_param("i",$uid); $stmt2->execute(); $stmt2->close(); + $success = "User $name has been banned successfully!"; } } } } -// ========================= -// ACTIVE BANS -// ========================= +// ========================= DATA ========================= $bannedUsers = $admin->search_banned(); - -// ========================= -// HISTORY (inactive bans) -// ========================= -$banHistory = mysqli_query($database->dblink, " - SELECT * - FROM ".TB_PREFIX."banlist - WHERE active = 0 - ORDER BY id DESC - LIMIT 50 -"); +$banHistory = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."banlist WHERE active=0 ORDER BY id DESC LIMIT 50"); ?> - - - -
- +
+
+ +

Ban Management

+
- -
- +
+
- -
- +
+ +
+

+ + Add New Ban +

+ + +
+ + +
+
+ + +
+ +
- - - - - - + +
+

+ + Active Bans () +

+
+ getUserField($b['uid'],'username',0) ?: $b['name']; + $end = $b['end'] ? date("d.m H:i",$b['end']) : '∞'; + ?> +
+
+
+
+
+
+ + +
+
+ No active bans
'; }?> +
+ + - - - - - - - - - - - - - - - - - - - - -
Ban
User ID
Reason - -
Duration - -
- -
- - - - - - - - - - - - - - - - - - getUserField($b['uid'],'username',0); - - if($name == '') - { - $name = $b['name']; - $link = "[".$name."]"; - } - else - { - $link = ''.$name.''; - } - - $end = $b['end'] ? date("d.m.y H:i",$b['end']) : '*'; - - echo ' - - - - - - '; - } - } - else - { - echo ''; - } - ?> - -
Active Bans ()
UsernameLengthReason
'.$link.''.date("d.m.y H:i",$b['time']).' - '.$end.''.$b['reason'].' - - - -
No active bans
- -

- - - - - - - - - - - - - - - - 0) - { - while($h = mysqli_fetch_assoc($banHistory)) - { - $end = $h['end'] ? date("d.m.y H:i",$h['end']) : '*'; - - echo ' - - - - - '; - } - } - else - { - echo ''; - } - ?> - -
Ban History (Inactive)
UsernameLengthReason
'.$h['name'].''.date("d.m.y H:i",$h['time']).' - '.$end.''.$h['reason'].'
No ban history
\ No newline at end of file + +
+

+ + Ban History +

+
+ 0){ while($h=mysqli_fetch_assoc($banHistory)){ + $end = $h['end'] ? date("d.m H:i",$h['end']) : '∞'; + ?> +
+
+
+
+
+ +
+ No history
'; }?> +
+
+
\ No newline at end of file diff --git a/Admin/Templates/givePlus.tpl b/Admin/Templates/givePlus.tpl index e62564b3..20aaccd8 100644 --- a/Admin/Templates/givePlus.tpl +++ b/Admin/Templates/givePlus.tpl @@ -1,56 +1,54 @@ +$id = $_SESSION['id']; +?> + -
- - - - - - - - - - - - - - - - - - - - -
Give Everyone Free Plus
-
- How Long? -
-
-
- Day -
-
-
- -
-
-
+
+
+ +

Plus Management

+
-
Plus Given'; - } -?> \ No newline at end of file +
+
+ +
+

Give Everyone Free Plus

+

Activează Travian Plus pentru TOȚI jucătorii de pe server.

+ +
+ + + Days + +
+
+ + +
✓ Plus a fost activat cu succes pentru toți jucătorii!
+ +
\ No newline at end of file diff --git a/Admin/Templates/givePlusRes.tpl b/Admin/Templates/givePlusRes.tpl index 98b333c0..792eb8e7 100644 --- a/Admin/Templates/givePlusRes.tpl +++ b/Admin/Templates/givePlusRes.tpl @@ -1,95 +1,79 @@ +$id = $_SESSION['id']; +?> + -
- - - - - - - - - - - - - - - - +
+
+ +

Resource Bonus

+
-
- - - +
+
+
+ +
+

Give Everyone Resource Bonus

+

Activează bonus 25% pentru toate resursele la TOȚI jucătorii.

+
-
- - - + + + +
+
+
Wood
+
days
+
+
+
Clay
+
days
+
+
+
Iron
+
days
+
+
+
Crop
+
days
+
+
- - - - - - - - -
Give Everyone Free Res Bonus
Resource BonusDuration
-
- Wood -
-
-
- Day -
-
-
- Clay -
-
-
- Day -
-
-
- Iron -
-
-
- Day -
-
-
- Crop -
-
-
- Day -
-
-
- -
-
-
+ + + -
Resource Bonuses Given'; - } -?> \ No newline at end of file + +
✓ Resource bonuses au fost activate pentru toți jucătorii!
+ + \ No newline at end of file diff --git a/Admin/Templates/gold.tpl b/Admin/Templates/gold.tpl index 320c2ea4..2330b846 100644 --- a/Admin/Templates/gold.tpl +++ b/Admin/Templates/gold.tpl @@ -1,58 +1,52 @@ +$id = $_SESSION['id']; +?> + -
- - - - - - - - - - - - - - - - - - - - -
Give Everyone Free gold
Amount
-
- How much gold? -
-
-
-   - Gold -
-
-
- -
-
-
+
+
+ +

Gold Management

+
-
Gold Added'; - } -?> \ No newline at end of file +
+
+ +
+

Give Everyone Free Gold

+

Acest gold va fi adăugat la TOȚI jucătorii activi de pe server.

+ +
+ + + +
+
+ + +
✓ Gold a fost adăugat cu succes la toți jucătorii!
+ +
\ No newline at end of file diff --git a/Admin/Templates/home.tpl b/Admin/Templates/home.tpl index b1a7bc4e..6c1c45e4 100644 --- a/Admin/Templates/home.tpl +++ b/Admin/Templates/home.tpl @@ -1,75 +1,136 @@ +if($_SESSION['access'] < MULTIHUNTER) die("Access Denied!"); - -
-
- WELCOME TO - - CONTROL PANEL -
-
+// ---- STATS ---- +$totalUsers = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."users WHERE id > 5")->fetch_assoc()['c']; +$active24h = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."users WHERE timestamp > ".(time()-86400)." AND id > 5")->fetch_assoc()['c']; +$onlineNow = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."users WHERE timestamp > ".(time()-300)." AND id > 5")->fetch_assoc()['c']; +$totalVillages = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."vdata")->fetch_assoc()['c']; +$totalGold = $database->query("SELECT SUM(gold) as s FROM ".TB_PREFIX."users")->fetch_assoc()['s']; +$activePlus = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."users WHERE plus > ".time())->fetch_assoc()['c']; +$activeBans = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."banlist WHERE active=1")->fetch_assoc()['c']; +$lastReg = $database->query("SELECT username, id FROM ".TB_PREFIX."users WHERE id>5 ORDER BY id DESC LIMIT 1")->fetch_assoc(); -

+// ---- TIMELINE ---- +$startTime = $database->query("SELECT MIN(timestamp) as t FROM ".TB_PREFIX."users WHERE id>5")->fetch_assoc()['t']; +$serverStart = $startTime ? date('d.m.Y H:i', $startTime) : 'Unknown'; - -query("SELECT COUNT(*) as c FROM ".TB_PREFIX."vdata WHERE owner=3")->fetch_assoc()['c']; +$natarsStatus = $natarsVillages > 0 ? "Launched ($natarsVillages villages)" : "Not launched"; -if ($_SESSION['access'] == MULTIHUNTER) { - $role = 'MultiHunter'; - $color = '#e67e22'; -} else if ($_SESSION['access'] == ADMIN) { - $role = 'Administrator'; - $color = '#c0392b'; -} else { - $role = 'User'; +$arteCount = 0; $arteDate = null; +if($database->dblink->query("SHOW TABLES LIKE '".TB_PREFIX."artefacts'")->num_rows){ + $a = $database->query("SELECT COUNT(*) as c, MIN(conquered) as d FROM ".TB_PREFIX."artefacts")->fetch_assoc(); + $arteCount = $a['c']; $arteDate = $a['d']; } +$arteStatus = $arteCount > 0 ? "Launched ($arteCount) - ".date('d.m.Y',$arteDate) : "Not launched"; + +// PLANS din artefacts type=11 +$plans = 0; $plansDate = null; +if($database->dblink->query("SHOW TABLES LIKE '".TB_PREFIX."artefacts'")->num_rows){ + $p = $database->query("SELECT COUNT(*) as c, MIN(conquered) as d FROM ".TB_PREFIX."artefacts WHERE type=11")->fetch_assoc(); + $plans = $p['c']; $plansDate = $p['d']; +} +$plansStatus = $plans > 0 ? "Launched ($plans) - ".($plansDate ? date('d.m.Y',$plansDate) : '') : "Not launched"; + +$role = $_SESSION['access'] == ADMIN ? 'Administrator' : 'MultiHunter'; ?> + -
- Hello ,
- You are logged in as: - - - -
+
+
+

WELCOME TO CONTROL PANEL

+
Hello Server Time
+
-


+ +
+

Total Players

+ active 24h
+

Online Now

last 5 minutes
+

Villages

avg / player
+

Gold in Game

with Plus active
+

Active Bans

+

Last Registration

ID #
+

PHP / MySQL

dblink->server_info; ?>
+

Server Load

Uptime:
+
- -
+ +
+

Server Timeline

+
+
Start Date:
+
Natars:
+
Artefacts:
+
WW Plans:
+
Server Age:
+
Next Event:
+
+
- -
- Credits: Akakori & Elmar
- Fixed, remade and new features added by Dzoki
- Reworked by aggenkeech
- Refactored by Shadow +
+
+

Last 5 Admin Actions

+
+ query("SELECT * FROM ".TB_PREFIX."admin_log ORDER BY id DESC LIMIT 5"); + while($l = $logs->fetch_assoc()){ + $u = $database->getUserField($l['user'],'username',0); + echo '
['.date('H:i',$l['time']).'] '.$u.' — '.strip_tags($l['log']).'
'; + } + ?> +
+
view full log →
+
+ + +
+ +
+ Credits: Akakori & Elmar — Fixed by Dzoki — Reworked by aggenkeech — Dashboard v2.1 by Shadow +
\ No newline at end of file diff --git a/Admin/Templates/inactive.tpl b/Admin/Templates/inactive.tpl index ca62378f..075a42ac 100644 --- a/Admin/Templates/inactive.tpl +++ b/Admin/Templates/inactive.tpl @@ -1,85 +1,104 @@ 5 AND tribe BETWEEN 1 AND 3 ORDER BY timestamp ASC LIMIT 200"; + } else { + $q = "SELECT * FROM ".TB_PREFIX."users WHERE timestamp <= $from AND timestamp > $to AND id>5 AND tribe BETWEEN 1 AND 3 ORDER BY timestamp ASC LIMIT 200"; + } + $res = $database->query($q); + return $res ? $res->fetch_all(MYSQLI_ASSOC) : []; +} + +$ranges = [ + '1-3 days' => inactiveRange(1,3), + '3-7 days' => inactiveRange(3,7), + '7+ days' => inactiveRange(7,null) +]; + +$tribeImg = [1=>'',2=>'1',3=>'2']; +$tribeName = [1=>'Roman',2=>'Teuton',3=>'Gaul']; ?> - - - - - - - - - - - - - - - - - = timestamp AND $to_time < timestamp) AND id>5"; - }elseif ($h==2) { // 3 days and before 7 days - $from_time=time() - (86400*3); $to_time = time() - (86400*7); - $q = "SELECT * FROM ".TB_PREFIX."users where ($from_time >= timestamp AND $to_time < timestamp) AND id>5"; - }elseif ($h==3) { //7 days and after - $from_time=time() - (86400*7); - $q = "SELECT * FROM ".TB_PREFIX."users where $from_time > timestamp AND id>5"; - } - - $result = $database->query($q); - $active = $database->mysqli_fetch_all($result); - for ($i = 0; $i <= count($active)-1; $i++){ - $uid = $database->getUserField($active[$i]['username'],'id',1); - $varray = $database->getProfileVillages($uid); - $totalpop = 0; - foreach($varray as $vil){ - $totalpop += $vil['pop']; - } - if($active[$i]['tribe'] == 1){ - $tribe = "Roman"; - $img = ""; - }else if($active[$i]['tribe'] == 2){ - $tribe = "Teuton"; - $img = "1"; - }else if($active[$i]['tribe'] == 3){ - $tribe = "Gaul"; - $img = "2"; - } - $getmin=((time()-$active[$i]['timestamp'])/60); - $gethr=((time()-$active[$i]['timestamp'])/3600); - $getday=intval((time()-$active[$i]['timestamp'])/86400); - - echo " - - - - - - - - - "; - } - } - ?> - -
Inactive users
Name [access]TimeTribePopulationVillagesGold
".$active[$i]['username']." [".$active[$i]['access']."]".$getday." days ".intval($gethr-$getday*24)." hours\"$tribe\"".$totalpop."".count($varray)."\"Gold\" ".$active[$i]['gold']."
+
+
+ +

Inactive Users

+
+ +
+ $list){ $i++; ?> + + +
+ + $users){ $i++; ?> +
+ No users in this range
"; } else { ?> +
+ getProfileVillages($uid); + $totalpop = 0; foreach($varray as $v) $totalpop += $v['pop']; + $days = floor((time()-$u['timestamp'])/86400); + $hours = floor(((time()-$u['timestamp'])%86400)/3600); + $tribe = $u['tribe']; + ?> +
+
+
+
[]
+ +
+
+ d h ago + 👥 pop + 🏘 vil +
+
+
+ 💰 + delete +
+
+ +
+ +
+ +
+ + \ No newline at end of file diff --git a/Admin/Templates/login.tpl b/Admin/Templates/login.tpl index 08ec2848..f59fd258 100644 --- a/Admin/Templates/login.tpl +++ b/Admin/Templates/login.tpl @@ -10,9 +10,6 @@ ## ## ################################################################################# -############ Check Update ############# -//copy("http://travian.gamingcrazy.net/Update/update_latest.tpl", "Templates/update_latest.tpl"); - ?>
diff --git a/Admin/Templates/maintenenceResetGold.tpl b/Admin/Templates/maintenenceResetGold.tpl index a364b6cc..8f43c8ec 100644 --- a/Admin/Templates/maintenenceResetGold.tpl +++ b/Admin/Templates/maintenenceResetGold.tpl @@ -1,32 +1,52 @@ -
- - - - - - - - - - - - -
Reset All Players Gold
-
-
All Players Gold Reset'; -} -?> \ No newline at end of file + + +
+
+ +

Maintenance

+
+ +
+
+ +
+

Reset All Players Gold

+

Această acțiune va seta gold-ul la 0 pentru TOȚI jucătorii de pe server.

+ +
+ ⚠️ ATENȚIE: Acțiunea este ireversibilă! Asigură-te că ai backup înainte. +
+ +
+ + +
+
+ + +
✓ Gold-ul tuturor jucătorilor a fost resetat!
+ +
\ No newline at end of file diff --git a/Admin/Templates/maintenenceResetPlus.tpl b/Admin/Templates/maintenenceResetPlus.tpl index b4900b02..c04c7359 100644 --- a/Admin/Templates/maintenenceResetPlus.tpl +++ b/Admin/Templates/maintenenceResetPlus.tpl @@ -1,32 +1,52 @@ -
- - - - - - - - - - - - -
Reset All Players Plus Bonus
-
-
All Players Plus Bonus Reset'; -} -?> \ No newline at end of file + + +
+
+ +

Maintenance

+
+ +
+
+ +
+

Reset All Players Plus

+

Această acțiune va dezactiva Travian Plus pentru TOȚI jucătorii.

+ +
+ ⚠️ Plus-ul va fi setat la 0 zile pentru toată lumea. +
+ +
+ + +
+
+ + +
✓ Plus-ul tuturor jucătorilor a fost resetat!
+ +
\ No newline at end of file diff --git a/Admin/Templates/maintenenceResetPlusBonus.tpl b/Admin/Templates/maintenenceResetPlusBonus.tpl index 5518a451..ee041779 100644 --- a/Admin/Templates/maintenenceResetPlusBonus.tpl +++ b/Admin/Templates/maintenenceResetPlusBonus.tpl @@ -1,32 +1,61 @@ -
- - - - - - - - - - - - -
Reset All Players Resource Bonus
-
-
All Players Resource Bonus Reset'; -} -?> \ No newline at end of file + + +
+
+ +

Maintenance

+
+ +
+
+ +
+

Reset All Resource Bonuses

+

Această acțiune va dezactiva bonusul de 25% pentru TOATE resursele la toți jucătorii.

+ +
+ + + + +
+ +
+ ⚠️ Toate bonusurile de resurse vor fi setate la 0 zile. +
+ +
+ + +
+
+ + +
✓ Bonusurile de resurse au fost resetate pentru toți jucătorii!
+ +
\ No newline at end of file diff --git a/Admin/Templates/msg.tpl b/Admin/Templates/msg.tpl index af17bf98..63ffc568 100644 --- a/Admin/Templates/msg.tpl +++ b/Admin/Templates/msg.tpl @@ -1,83 +1,152 @@ escape($_GET['q']) : ''; +$filter = isset($_GET['f'])? $_GET['f'] : 'all'; +$page = max(1, (int)($_GET['page']?? 1)); +$limit = 50; +$offset = ($page-1)*$limit; -if($nid > 0) $msg = $database->getMessage($nid, 3); -else -{ - $sql = "SELECT * FROM " . TB_PREFIX . "mdata ORDER BY time DESC "; - $result = mysqli_query($GLOBALS["link"], $sql); - $allMessages = $database->mysqli_fetch_all($result); +// ---- SINGLE MESSAGE - PĂSTRĂM VIZUALIZAREA CLASICĂ ---- +if($nid > 0){ + $msg = $database->getMessage($nid, 3); + if(empty($msg)) die("Message ID $nid doesn't exist!"); + ?> + + + +
+ ← Back to messages +
Sent to: getUserField($msg[0]['target'],'username',0);?>
+
+

Message

+
+
+ +
+
getUserField($msg[0]['owner'],'username',0);?>
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ - - - -

Players Message

-
- -
- "target > 0", + 'sent' => "owner > 0", + 'system' => "owner = 0" +]; +if(isset($filterMap[$filter])) $where.= " AND ".$filterMap[$filter]; + +$total = $database->query("SELECT COUNT(*) c FROM ".TB_PREFIX."mdata WHERE $where")->fetch_assoc()['c']; +$msgs = $database->query("SELECT * FROM ".TB_PREFIX."mdata WHERE $where ORDER BY time DESC LIMIT $offset,$limit")->fetch_all(MYSQLI_ASSOC); ?> - - - - + +
+
+

+ + Players Messages () +

+
+ 'All','inbox'=>'Inbox','sent'=>'Sent','system'=>'System'] as $k=>$v){?> + + +
+ +
-
+
+ getUserField($m['owner'],'username',0) : 'System'; + $to = $m['target']? $database->getUserField($m['target'],'username',0) : '-'; + $time = date('d.m H:i',$m['time']); + $preview = strip_tags($m['message']); + $preview = mb_substr($preview,0,90); + $cls = $m['owner']==0? 'system' : 'player'; + ?> + +
+
+ + +
+
+
...
+
+ # + view → +
+
+
+ +
- Sent to: getUserField($msg[0]['target'],'username',0);?> - -
-

Message

-
-
- -
-
getUserField($msg[0]['owner'],'username',0);?>
-
-
-
-
-
-
-
-
-
- -
-
-
-
\ No newline at end of file + $limit){ $pages = ceil($total/$limit);?> + + +
\ No newline at end of file diff --git a/Admin/Templates/notregistered.tpl b/Admin/Templates/notregistered.tpl index 51f8516e..d8500cdc 100644 --- a/Admin/Templates/notregistered.tpl +++ b/Admin/Templates/notregistered.tpl @@ -1,41 +1,83 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - } - ?> - -
Players Not Activated
#IDUsernameEmailTribeActivation CodeAct 2??Time
".$i."".$row['id']."".$row['username']."".$row['email']."".$tribe."".$row['act']."".$row['act2']."".date('d:m:Y H:i', $row['timestamp'])."
\ No newline at end of file + + + +
+
+

✉️ Players Not Activated

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + "; +} +if($i==0) echo ""; +?> + +
#IDUsernameEmailTribeActivation CodeAct2Time
{$i}{$row['id']}".htmlspecialchars($row['username'])."{$row['email']}{$tribe}{$row['act']}{$row['act2']}{$time}
Niciun jucător neactivat
+
+
+ + \ No newline at end of file diff --git a/Admin/Templates/online.tpl b/Admin/Templates/online.tpl index ecfc614d..ab101952 100644 --- a/Admin/Templates/online.tpl +++ b/Admin/Templates/online.tpl @@ -1,67 +1,79 @@ -getUserActive(); +$count = count($active); + +$tribeName = [1=>'Roman',2=>'Teuton',3=>'Gaul']; +$tribeColor = [1=>'#c0392b',2=>'#2980b9',3=>'#27ae60']; +$tribeImg = [1=>'',2=>'1',3=>'2']; ?> - - - - - - - - - - - - - - -getUserField($active[$i]['username'],'id',1); -$varray = $database->getProfileVillages($uid); -$totalpop = 0; -foreach($varray as $vil) { - $totalpop += $vil['pop']; -} - if($active[$i]['tribe'] == 1){ - $tribe = "Roman"; - } else if($active[$i]['tribe'] == 2){ - $tribe = "Teuton"; - } else if($active[$i]['tribe'] == 3){ - $tribe = "Gaul"; - } -echo ' - - - - - - - - -'; -} -}else{ -echo ''; +
+
+

🟢 Online Users

+
now
+
-} + +
No online users in last 5 minutes
+ +
+ getUserField($u['username'],'id',1); + $varray = $database->getProfileVillages($uid); + $totalpop = 0; foreach($varray as $v) $totalpop += $v['pop']; + $tribe = (int)$u['tribe']; + $class = strtolower($tribeName[$tribe]?? 'roman'); + $last = time() - $u['timestamp']; + $mins = floor($last/60); + ?> +
+
+
+ + [] +
+ +
+
Last action:
+
+ 👥 + 🏘 + ⚔️ + +
+
+ +
+ +
-?> - -
Online users ()
Name [access]TimeTribePopVillagesGold
'.$active[$i]['username'].' ['.$active[$i]['access'].']'.date("d.m.y H:i:s",$active[$i]['timestamp']).''.$tribe.''.$totalpop.''.count($varray).'Gold '.$active[$i]['gold'].'
No online users
\ No newline at end of file + \ No newline at end of file diff --git a/Admin/Templates/report.tpl b/Admin/Templates/report.tpl index ce2f3ee1..40dc5647 100644 --- a/Admin/Templates/report.tpl +++ b/Admin/Templates/report.tpl @@ -1,60 +1,135 @@ escape($_GET['q']) : ''; +$filter = isset($_GET['f'])? $_GET['f'] : 'all'; +$page = max(1, (int)($_GET['page']?? 1)); +$limit = 50; +$offset = ($page-1)*$limit; -if ($bid > 0) { - $rep = $database->getNotice2($bid); -} -else -{ - $sql = "SELECT * FROM " . TB_PREFIX . "ndata ORDER BY time DESC "; - $result = mysqli_query($GLOBALS["link"], $sql); - $rep1 = $database->mysqli_fetch_all($result); -} - -if(!empty($rep1)) -{ - ?> - - - -

Players Report

-
- -
- - - - -
- Report of: getUserField($rep['uid'], 'username', 0); ?>
-
-

Report

- 0){ + $rep = $database->getNotice2($bid); + if(!$rep) die("Report ID $bid doesn't exist!"); $isAdmin = true; - $message = new Message(); - $message->readingNotice = $rep; - include ("../Templates/Notice/".$message->getReportType($rep['ntype']).".tpl"); + $message = new Message(); + $message->readingNotice = $rep; + ?> + + + +
+ ← Back to reports +
+

Report

+ getReportType($rep['ntype']).".tpl");?> +
+
+ "ntype IN (2,9)", // attack + artefact attack + 'defences' => "ntype IN (3)", + 'scouts' => "ntype IN (4,14)", + 'trades' => "ntype IN (5)" +]; +if(isset($filterMap[$filter])) $where.= " AND ".$filterMap[$filter]; + +$total = $database->query("SELECT COUNT(*) c FROM ".TB_PREFIX."ndata WHERE $where")->fetch_assoc()['c']; +$reps = $database->query("SELECT * FROM ".TB_PREFIX."ndata WHERE $where ORDER BY time DESC LIMIT $offset,$limit")->fetch_all(MYSQLI_ASSOC); + +$typeNames = [1=>'reinforcement',2=>'attack',3=>'defence',4=>'scout',5=>'trade',6=>'wonder',7=>'settlement',8=>'oasis',9=>'artefact',10=>'adventure',14=>'spy']; ?> + + +
+
+

📜 Players Reports ()

+
+ 'All','attacks'=>'Attacks','defences'=>'Defences','scouts'=>'Scouts','trades'=>'Trades'] as $k=>$v){?> + + +
+ +
+ +
+ getUserField($r['uid'],'username',0); + $time = date('d.m H:i',$r['time']); + $preview = strip_tags($r['topic']?? $r['n1'].' '.$r['n2']); + $preview = mb_substr($preview,0,80); + ?> + +
+
+ # + +
+
...
+
+ + view → +
+
+
+ +
+ + $limit){ $pages = ceil($total/$limit);?> + + +
\ No newline at end of file diff --git a/Admin/Templates/search.tpl b/Admin/Templates/search.tpl index 89f8ed3f..4f161282 100644 --- a/Admin/Templates/search.tpl +++ b/Admin/Templates/search.tpl @@ -1,53 +1,83 @@ ['Search Players','👤'], + 'alliances' => ['Search Alliances','🛡️'], + 'villages' => ['Search Villages','🏘️'], + 'email' => ['Search E-mails','✉️'], + 'ip' => ['Search IPs','🌐'], + 'deleted_players' => ['Search Deleted','🗑️'] +]; +$current = $_POST['p']?? 'player'; +$search = stripslashes($_POST['s']?? ''); ?> -
-
- - - - - - - - - - - -
Search v1.0
- - - - - -
-
+ -
'; - if($_GET['msg'] == 'ursdel') - { - echo "User was deleted."; +
+
+ + + + + +

Admin Search

+
- } - echo '
'; - } -?> \ No newline at end of file +
+
+ + + +
+ +
+ $v){?> +
+ + +
+ +
+
+ + +
+ +
+ +
+ + \ No newline at end of file diff --git a/Admin/Templates/server_info.tpl b/Admin/Templates/server_info.tpl index 01a6fc55..613e09be 100644 --- a/Admin/Templates/server_info.tpl +++ b/Admin/Templates/server_info.tpl @@ -1,4 +1,5 @@ = 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() : []; } -$tribe1 = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1"); -$tribe2 = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2"); -$tribe3 = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3"); -$tribes = Array(mysqli_num_rows($tribe1),mysqli_num_rows($tribe2),mysqli_num_rows($tribe3)); -$users = mysqli_num_rows(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE tribe > 0 AND tribe < 4")); +// ---- DATE ---- +$users = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."users WHERE tribe BETWEEN 1 AND 3")['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]; +for($t=1;$t<=3;$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<=50;$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 ".($t - 300)) or die(mysqli_error($database->dblink)); - $num_rows = mysqli_num_rows($result); - echo $num_rows;?> -
Players Banned -
Villages settled -
Total Populationdblink,"SELECT SUM(pop) AS sumofpop FROM ".TB_PREFIX."vdata"); $getpop = mysqli_fetch_assoc($pop); echo $getpop['sumofpop']; ?>
+ -
+
- - - - - - - - - - - - - - - - - - - - - - - - -
Player Information
TribeRegisteredPercent
Romans 0) ? ($percents[0] = round(100 * ($tribes[0] / $users), 2))."%" : "---"; ?>
Teutons 0) ? ($percents[1] = round(100 * ($tribes[1] / $users), 2))."%" : "---"; ?>
Gauls 0) ? (100-$percents[0]-$percents[1])."%" : "---"; ?>
+
+
+

🌍 World Information

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

👥 Player Distribution

+ 'Romans',2=>'Teutons',3=>'Gauls']; $colors=[1=>'romans',2=>'teutons',3=>'gauls']; + foreach($names as $id=>$name){ + $pct = $users ? round($tribes[$id]/$users*100,1) : 0; + echo "
$name{$tribes[$id]} ($pct%)
"; + echo "
"; + } ?> +
- - - - - - - - - - - - - - - - -
Server Information
TotalAverage
Gold Gold
+
+

💰 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), + 'Natars' => range(31,40), + 'Other' => range(41,50) + ]; + 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)."
"; + ?> +
+ - $units_villages = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT ".implode(',', $cells)." FROM ".TB_PREFIX."units")); - $units_enforcements = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT ".implode(',', $cells)." FROM ".TB_PREFIX."enforcement")); - - for($i=1; $i<11; $i++) { - echo ''; - } - - echo ''; - for($i=1; $i<11; $i++) { - $total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]); - echo ''; - } - - echo ""; - for($i=11; $i<21; $i++) { - echo ''; - } - - echo ''; - for($i=11; $i<21; $i++) { - $total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]); - echo ''; - } - - echo ""; - for($i=21; $i<31; $i++) { - echo ''; - } - - echo ''; - for($i=21; $i<31; $i++) { - $total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]); - echo ''; - } - - echo ""; - for($i=31; $i<41; $i++) { - echo ''; - } - - echo ''; - for($i=31; $i<41; $i++) { - $total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]); - echo ''; - } - - echo ""; - for($i=41; $i<51; $i++) { - echo ''; - } - - echo ''; - for($i=41; $i<51; $i++) { - $total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]); - echo ''; - } - ?> - -
Troops on the Server
'.formatNum($total).'
'.formatNum($total).'
'.formatNum($total).'
'.formatNum($total).'
'.formatNum($total).'
+
\ No newline at end of file diff --git a/Admin/Templates/usergold.tpl b/Admin/Templates/usergold.tpl index 7daf47de..08fdcf11 100644 --- a/Admin/Templates/usergold.tpl +++ b/Admin/Templates/usergold.tpl @@ -1,36 +1,70 @@ -
- - - - - - - - - - - - - - - - - - -
Give Free gold for specific user
How much gold?
-   - Gold -
For which user (id)?
- -
-
+ -
Gold Added'; } ?> \ No newline at end of file +
+
+ +

User Gold

+
+ +
+
+
+ +
+
+

Give Gold to Specific Player

+

Adaugă gold doar pentru un singur cont (după ID).

+
+
+ +
+ + +
+ + +
+ +
+ + +
+ + +
+
+ + +
✓ Gold adăugat cu succes pentru user!
+ +
\ No newline at end of file diff --git a/Admin/Templates/users.tpl b/Admin/Templates/users.tpl index 56841873..9498c927 100644 --- a/Admin/Templates/users.tpl +++ b/Admin/Templates/users.tpl @@ -1,98 +1,166 @@ 0]; -$totalUsers = (int)($totalRow['cnt'] ?? 0); +$where = "1=1"; +if($filter=='admins') $where = "access >= 8"; +elseif($filter=='normal') $where = "access = 2"; +elseif($filter=='banned') $where = "access = 0"; +elseif($filter=='online') $where = "timestamp > ".(time()-900); + +$totalRes = mysqli_query($GLOBALS['link'], "SELECT COUNT(*) AS cnt FROM ".TB_PREFIX."users WHERE $where"); +$totalUsers = (int)(mysqli_fetch_assoc($totalRes)['cnt']??0); $totalPages = max(1, (int)ceil($totalUsers / $perPage)); +if($page>$totalPages){$page=$totalPages;$offset=($page-1)*$perPage;} -if ($page > $totalPages) { - $page = $totalPages; - $offset = ($page - 1) * $perPage; +$result = mysqli_query($GLOBALS['link'], " + SELECT id, username, email, access, tribe, gold, timestamp + FROM ".TB_PREFIX."users + WHERE $where + ORDER BY id DESC + LIMIT $perPage OFFSET $offset +"); + +function tribeLabel($t){ + $t = (int)$t; + switch($t){ + case 1: return array('Roman','🏛','#c0392b'); + case 2: return array('Teuton','🪓','#7f8c8d'); + case 3: return array('Gaul','🌾','#27ae60'); + case 4: return array('Nature','🌲','#16a085'); + case 5: return array('Natars','👑','#8e44ad'); + default: return array('N/A','❓','#95a5a6'); + } } - -$sql = "SELECT id, username, email, access, tribe, gold, timestamp " . - "FROM " . TB_PREFIX . "users " . - "ORDER BY id DESC LIMIT " . (int)$perPage . " OFFSET " . (int)$offset; -$result = mysqli_query($GLOBALS['link'], $sql); - -function tribeLabel($tribe) { - $tribe = (int)$tribe; - if ($tribe === 1) return 'Roman'; - if ($tribe === 2) return 'Teuton'; - if ($tribe === 3) return 'Gaul'; - return 'N/A'; +function accessBadge($a){ + $a = (int)$a; + if($a == 9) return array('Admin','#c0392b'); + if($a == 8) return array('MH','#e67e22'); + if($a == 2) return array('Normal','#3498db'); + if($a == 0) return array('Banned','#7f8c8d'); + return array('Lvl '.$a,'#95a5a6'); } +function shortEmail($e){if(!$e)return '-';if(strlen($e)>22)return substr($e,0,19).'...';return $e;} ?> + + +
+
+

👥 Users

+
found
+
+ +
+ All + Admins + Normal + Banned + Online
+ + + +
+ + + + + + + + + + + + + + time()-900; + $emailTitle = htmlspecialchars($r['email']??''); + ?> + + + + + + + + + + + +
IDUsernameEmailAccessTribeGoldLast Activity
#●';?> +
+ + +
+
+
+ + +
+ + \ No newline at end of file