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'], 'user' => $l['user'], 'type' => 'admin', 'text' => $l['log'] ]; } // 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 ORDER BY time DESC LIMIT 300 "); while($b = mysqli_fetch_assoc($banQ)) { // BAN $unified[] = [ '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 if($b['active'] == 0 && $b['end'] > $b['time']) { $unified[] = [ 'id' => 2000000 + $b['id'], 'time' => $b['end'], 'user' => $b['admin'] ?: 1, 'type' => 'unban', 'text' => "Unbanned user {$b['name']}", 'active' => 0 ]; } } 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,'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','β']; return ['OTHER','cat-other','π']; } ?>
| ID | Admin | Categorie | Detalii | Data |
|---|---|---|---|---|
| # |