function user_view_online() { global $db, $countries; $db->query('SELECT username, country, uID, lastklick, betretten FROM ' . DB_PRE . 'ecp_online LEFT JOIN ' . DB_PRE . 'ecp_user ON (uID = ID) WHERE uID != 0 AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ' ORDER BY username ASC'); if ($db->num_rows()) { $user = array(); while ($row = $db->fetch_assoc()) { $row['betretten'] = goodtime(time() - $row['betretten']); $row['lastklick'] = goodtime(time() - $row['lastklick']); $row['countryname'] = $countries[$row['country']]; $user[] = $row; } $tpl = new Smarty(); $tpl->assign('user', $user); ob_start(); $tpl->display(DESIGN . '/tpl/user/user_online.html'); $content = ob_get_contents(); ob_end_clean(); main_content(USER_ONLINE, $content, '', 1); } else { table(ERROR, NO_ENTRIES); } }
function setTSUsers($uArray, $ip, $port, $tPort) { $array = array(); for ($i = 1; $i < count($uArray); $i++) { $innerArray = $uArray[$i]; $subarray = array(); $subarray['icon'] = setUserStatus($innerArray[12]); $subarray['name'] = "<strong>" . removeChar($innerArray[14]) . "</strong> (" . setPPriv($innerArray[11]) . "" . setCPriv($innerArray[10]) . ")"; $subarray['channel'] = getChannelName($innerArray[1], $ip, $port, $tPort); $subarray['ping'] = format_nr($innerArray[7], 0); $subarray['loggedin'] = goodtime((int) $innerArray[8], (int) $innerArray[8] > 86400 ? 1 : 3); $subarray['idle'] = goodtime((int) $innerArray[9]); $array[] = $subarray; } return $array; }