Hmm I ran the query on my server and it worked, I did notice I forgot a double quote at the end of the query which would break the script.
PHP Code:
$postcount = $vbulletin->db->query_first("
SELECT COUNT(post.dateline) as pcount
FROM ".TABLE_PREFIX."post
INNER JOIN thread ON thread.threadid = post.threadid
WHERE post.dateline > " . $vbulletin->userinfo['lastvisit'] . " AND thread.forumid NOT IN(13,14,15,16)");