Too many queries there...
PHP Code:
$lastpost_titles = array();
$lastpostdata = $db->query_read("
SELECT thread.threadid, thread.title
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "post AS post ON(thread.lastpostid = post.postid)
WHERE thread.forumid <> 31
ORDER BY thread.lastpost DESC
LIMIT 4
");
while ($post = $db->fetch_array($lastpostdata))
{
$lastpost_titles[] = '<a href="forums/showthread.php?t=' . $post['threadid'] . '">' . $post['title'] . '</a>';
}
echo implode('<br />', $lastpost_titles);