45 $query =
"SELECT * FROM ut_online WHERE usr_id = '".$a_user_id.
"'";
46 $res = $ilDB->query($query);
49 $access_time = $row->access_time;
50 $online_time = $row->online_time;
52 return (
int) $online_time;
61 $query =
"SELECT * FROM ut_online WHERE usr_id = '".$a_user_id.
"'";
62 $res = $ilDB->query($query);
68 $query =
"INSERT INTO ut_online SET usr_id = '".$a_user_id.
"', access_time = '".time().
"'";
78 $query =
"SELECT * FROM ut_online WHERE usr_id = '".$a_usr_id.
"'";
79 $res = $ilDB->query($query);
87 $access_time = $row->access_time;
88 $online_time = $row->online_time;
91 $time_span = (int) $ilias->getSetting(
"tracking_time_span",300);
93 if(($diff = time() - $access_time) <= $time_span)
95 $query =
"UPDATE ut_online SET online_time = online_time + '".$diff.
"', access_time = '".time().
96 "' WHERE usr_id = '".$a_usr_id.
"'";
101 $query =
"UPDATE ut_online SET access_time = '".time().
102 "' WHERE usr_id = '".$a_usr_id.
"'";
103 $ilDB->query($query);