get('adminlist'); // $cache->clean(); if (is_null($adminlist)) { $adminlist = array(getAdminList(), date('d-m-Y H:i:s')); $cache->set('adminlist', $adminlist, 30); } // FUNCTIONS function getAdminList() { global $config; global $lang; $admingroups = $config["adminlist"]; $localIcons = array(100, 200, 300, 400, 500, 600); try { $tsAdmin = TeamSpeak3::factory(getTeamspeakURI() . "#no_query_clients"); $output = ""; foreach ($admingroups as $group) { if (!array_key_exists((string)$group, $tsAdmin->serverGroupList())) continue; $group = $tsAdmin->serverGroupGetById($group); $icon = ''; if ($group["iconid"]) { if (!$group->iconIsLocal("iconid")) { $groupicon = getGroupIcon($tsAdmin, $group); if ($groupicon) { $icon = ' '; } } elseif (in_array($group["iconid"], $localIcons)) { $icon = ' '; } } $output .= "
$icon$group
"; $clients = $group->clientList(); if (empty($clients)) { $output .= '' . translate($lang["adminlist"]["emptygroup"]) . '
'; continue; } $onlineClients = []; $offlineClients = []; foreach ($clients as $userInfo) { $user = getClientByDbid($tsAdmin, $userInfo['cldbid']); if (!$user) { $offlineClients[] = '' . $userInfo['client_nickname'] . '' . translate($lang["adminlist"]["status"]["offline"]) . '
'; continue; } $onlineClients[] = '' . '' . $user . '' . ($user['client_away'] ? '' . translate($lang["adminlist"]["status"]["away"]) . '' : '' . translate($lang["adminlist"]["status"]["online"]) . '') . '
'; } foreach (array_merge($onlineClients, $offlineClients) as $str) $output .= $str; } return $output; } catch (TeamSpeak3_Exception $e) { return '' . translate($lang["general"]["scripterror"], [$e->getCode(), $e->getMessage()]) . '