25 $res = $ilDB->query(
"SELECT * FROM ut_online WHERE usr_id = ".
26 $ilDB->quote($a_user_id,
"integer"));
27 while (
$row = $ilDB->fetchObject(
$res))
29 $access_time =
$row->access_time;
30 $online_time =
$row->online_time;
32 return (
int) $online_time;
46 $res = $ilDB->query(
"SELECT * FROM ut_online WHERE usr_id = ".
47 $ilDB->quote($a_user_id,
"integer"));
54 $ilDB->manipulate(sprintf(
"INSERT INTO ut_online (usr_id, access_time) VALUES (%s,%s)",
55 $ilDB->quote($a_user_id,
"integer"),
56 $ilDB->quote(time(),
"integer")));
72 $query =
"SELECT * FROM ut_online WHERE usr_id = ".
73 $ilDB->quote($a_usr_id,
'integer');
82 $access_time =
$row->access_time;
83 $online_time =
$row->online_time;
85 $time_span = (int) $ilias->getSetting(
"tracking_time_span",300);
87 if(($diff = time() - $access_time) <= $time_span)
89 $ilDB->manipulate(sprintf(
"UPDATE ut_online SET online_time = online_time + %s, ".
90 "access_time = %s WHERE usr_id = %s",
91 $ilDB->quote($diff,
"integer"),
92 $ilDB->quote(time(),
"integer"),
93 $ilDB->quote($a_usr_id,
"integer")));
97 $ilDB->manipulate(sprintf(
"UPDATE ut_online SET ".
98 "access_time = %s WHERE usr_id = %s",
99 $ilDB->quote(time(),
"integer"),
100 $ilDB->quote($a_usr_id,
"integer")));