Here goes the most basic one, without having forum mask or forums viewing permissions:
PHP Code:
$lastposts = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "post WHERE visible = 1 ORDER BY dateline LIMIT 0,5");
while ($lastpost = $db->fetch_array($lastposts))
{
$lastpost['dateline'] = vbdate($vbulletin->options['dateformat'], $lastpost['dateline']);
$showlastposts .= "<a href=\"showthread.php?" . $vbulletin->session->vars['sessionurl'] . "p=$lastpost[postid]\" title=\"posted on $lastpost[dateline]\" />$lastpost[title]</a>";
}
put $showlastposts wherever you want to show the result.