You could do something like:
PHP Code:
$query = $vbulletin->db->query_read("
SELECT a.title, a.threadid, a.lastpost, a.postusername, b.pagetext
FROM `thread` AS a
INNER JOIN post AS b ON a.firstpostid = b.postid
WHERE a.forumid = 2
ORDER BY a.threadid DESC
LIMIT 0,5");
while($row = $vbulletin->db->fetch_array($query))
{
// $row contains the data.
}
Where 2 would be your forum id.