Then why use it? And you have 4 queries there that can be done with only one:
Code:
$lastpostinfo = $DB_site->query_first("
SELECT u.userid,t.lastposter AS username,t.title,t.threadid
FROM thread t
LEFT JOIN user u ON t.lastposter=u.username
WHERE t.forumid=$forum[forumid] ORDER BY t.lastpost DESC
");
And you don't even need userid, lastposter and threadid as that's already handled by vB.