online.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:2k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: online.php,v $
- // | $Date: 2004/02/10 01:34:32 $
- // | $Revision: 1.12 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - User activity viewer.
- // +-------------------------------------------------------------+
- error_reporting(E_ALL ^ E_NOTICE);
- include "./../global.php";
- tech_nav('users');
- ############################### USERS ONLINE ###############################
- // delete old sessions
- $time = mktime() - $settings[session_length];
- $db->query("DELETE FROM user_session
- WHERE lastactivity < '$time'
- ");
- $db->query('SELECT username, id FROM user');
- while ($result = $db->row_array()) {
- $users[$result[id]] = $result[username];
- }
- $db->query('SELECT userid, location, lastactivity
- FROM user_session
- ORDER BY lastactivity, userid');
- while ($result = $db->row_array()) {
- $table[] = array(
- iff($result[userid], "<A HREF="view.php?id=$result[userid]">".$users[$result[userid]]."</A>", '<I>Guest</I>'),
- date('r', $result[lastactivity]),
- iff($result[location], $result[location], '<I>Not available</I>')
- );
- }
- echo "<br /><center>" . thelp('Users', 'Online Users') . '</center>';
- if (is_array($table)) {
- array_unshift($table, array(
- '<B>Username</B>',
- '<B>Last Activity</B>',
- '<B>Current Location</B>')
- );
- table_header('Users Online');
- table_content('', $table);
- table_footer();
- } else {
- echo "<br /><br /><center><b>No users are currently online.</b></center>";
- }
- tech_footer();
- ?>