= 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;} $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'); } } 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;} ?>