it's just the very first query:
PHP Code:
// doublepost check
if ($type != 'thread' AND $doublepost = $DB_site->query_first("
SELECT postid, pagetext, post.userid
FROM " . TABLE_PREFIX . "post
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE threadid = $threadinfo[threadid]
AND dateline > " . (TIMENOW - 3600) . "
AND visible = 1 AND deletionlog.primaryid IS NULL
ORDER BY dateline DESC
LIMIT 1
") AND $doublepost['userid'] == $bbuserinfo['userid'])