Hello, I was trying to not show what the admin is doing and to show only the new post and new threads actions.
Am I doing this right?
Code:
if ($vbulletin->GPC['last'] > 0) $extra = 'AND spyid > ' . $vbulletin->GPC['last'] . ' AND forumid > 0';
// don't force to forums.*
$events = $db->query_read_slave("
SELECT spy.*, user.username, thread.title, thread.forumid, post.pagetext AS preview
FROM " . TABLE_PREFIX . "digitalpoint_spy AS spy
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = spy.userid)
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = spy.threadid)
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = spy.postid)
WHERE (thread.forumid IS NULL OR (thread.forumid IN ($forumids)$sql_subscribed) AND (action IN (1,2,3)))
$extra
ORDER BY dateline DESC
LIMIT 25
");