th_inc_view_count($msg_obj->thread_id);
if (_uid && $msg_obj) {
if ($msg_obj->last_forum_view < $msg_obj->post_stamp) {
user_register_forum_view($msg_obj->forum_id);
}
if ($msg_obj->last_view < $msg_obj->post_stamp) {
user_register_thread_view($msg_obj->thread_id, $msg_obj->post_stamp, $msg_obj->id);
}
}
switch ($t) {
case 'msg':
if (!isset($_GET['prevloaded'])) {
th_inc_view_count($frm->id);
}
if (_uid && $obj2) {
if ($frm->last_forum_view < $obj2->post_stamp) {
user_register_forum_view($frm->forum_id);
}
if ($frm->last_view < $obj2->post_stamp) {
user_register_thread_view($frm->id, $obj2->post_stamp, $obj2->id);
}
}
break;
case 'tree':
th_inc_view_count($msg_obj->thread_id);
if (_uid && $msg_obj) {
if ($msg_obj->last_forum_view < $msg_obj->post_stamp) {
user_register_forum_view($msg_obj->forum_id);
}
if ($msg_obj->last_view < $msg_obj->post_stamp) {
user_register_thread_view($msg_obj->thread_id, $msg_obj->post_stamp, $msg_obj->id);
}
}
break;
case 'login':
/* Clear expired sessions AND anonymous sessions older than 1 day. */
q('DELETE FROM {SQL_TABLE_PREFIX}ses WHERE time_sec<'. (__request_timestamp__- ($FUD_OPT_3 & 1 ? $SESSION_TIMEOUT : $COOKIE_TIMEOUT)) .' OR (user_id>2000000000 AND time_sec<'. (__request_timestamp__- 86400) .')');
break;
case 'thread':
case 'threadt':
if (_uid) {
user_register_forum_view($frm_id);
}
break;
}