Cool, thanks for that. My search.php is a bit different so I have added the code to this thread for all to see....
Xray
Like this then? My postbot user ID is 4...
search.php
PHP Code:
$posts = $DB_site->query("
SELECT postid
FROM " . TABLE_PREFIX . "post AS post " . iif($forumids, "
INNER JOIN " . TABLE_PREFIX . "thread AS thread ON(thread.threadid = post.threadid)
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS delthread ON(delthread.primaryid = post.threadid AND delthread.type = 'thread')") . "
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS delpost ON(delpost.primaryid = post.postid AND delpost.type = 'post')
WHERE post.userid = $user[userid]
AND delpost.primaryid IS NULL " . iif($forumids, "
AND delthread.primaryid IS NULL
AND post.visible = 1
AND thread.visible = 1
AND $forumids") . "
AND thread.postuserid != 4
ORDER BY post.dateline DESC
LIMIT " . ($vboptions['maxresults'] * 2) . "
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
$threads = $DB_site->query("
SELECT threadid
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS delthread ON(delthread.primaryid = thread.threadid AND delthread.type = 'thread')
WHERE forumid IN(" . implode(', ', $forumids) . ")
AND thread.lastpost >= $datecut
AND visible = 1
AND delthread.primaryid IS NULL
AND sticky IN (0,1)
AND thread.postuserid != 4
ORDER BY lastpost DESC
LIMIT $vboptions[maxresults]