Got it working ok... Only main difference is, as Paul said, one of the queries needs to be changed otherwise you get a problem with ambiguity.
PHP Code:
$posts = $db->query_first("
SELECT COUNT(postid) AS count
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE visible = 0 AND dateline > " . $vbulletin->userinfo[lastvisit] . "
AND deletionlog.primaryid IS NULL
");
becomes...
PHP Code:
$posts = $db->query_first("
SELECT COUNT(postid) AS count
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE visible = 0 AND post.dateline > " . $vbulletin->userinfo[lastvisit] . "
AND deletionlog.primaryid IS NULL
");