19 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
44 function XoopsOnlineHandler(&$db)
64 $sql =
"SELECT COUNT(*) FROM " . $this->db->prefix(
'online') .
" WHERE online_uid=" .
$uid;
66 $sql =
"SELECT COUNT(*) FROM " . $this->db->prefix(
'online') .
" WHERE online_uid=" .
$uid .
" AND online_ip='" . $ip .
"'";
68 list ($count) = $this->db->fetchRow($this->db->queryF(
$sql));
70 $sql =
"UPDATE " . $this->db->prefix(
'online') .
" SET online_updated=" .
$time .
", online_module = " .
$module .
" WHERE online_uid = " .
$uid;
72 $sql .=
" AND online_ip='" . $ip .
"'";
75 $sql = sprintf(
"INSERT INTO %s (online_uid, online_uname, online_updated, online_ip, online_module) VALUES (%u, %s, %u, %s, %u)", $this->db->prefix(
'online'),
$uid, $this->db->quoteString(
$uname),
$time, $this->db->quoteString($ip),
$module);
77 if (!$this->db->queryF(
$sql)) {
92 $sql = sprintf(
"DELETE FROM %s WHERE online_uid = %u", $this->db->prefix(
'online'),
$uid);
108 $sql = sprintf(
"DELETE FROM %s WHERE online_updated < %u", $this->db->prefix(
'online'), time() - intval($expire));
109 $this->db->queryF(
$sql);
122 $sql =
'SELECT * FROM ' . $this->db->prefix(
'online');
132 while ($myrow = $this->db->fetchArray(
$result)) {
146 $sql =
'SELECT COUNT(*) FROM ' . $this->db->prefix(
'online');