ok try this on for size:
function phpblock_forum_posts() {
include("/path/to/vbulletin/config.php"

;
$connection = mysql_connect("$servername","$dbusername","$dbpassword"

or die ("Cannot connect to server."

;
$db = mysql_select_db("$dbname", $connection) or die ("Could not select database."

;
$sql = "SELECT title, threadid, replycount, postusername, lastposter from thread order by lastpost desc limit 14";
$sql_result = mysql_query($sql, $connection) or die ("Could not execute query."

;
if (!$sql_result) {
echo "<p>Could not get record.";
}
while ($row = mysql_fetch_array($sql_result)) {
$threadid = $row["threadid"];
$thetitle = $row["title"];
$replycount = $row["replycount"];
$postusername = $row["postusername"];
$postuserid = $row["postuserid"];
$lastposter = $row["lastposter"];
$infodump = "<a href=\"forum/showthread.php?s=&threadid=$threadid\"><b>$thetitle</b></a> -$lastposter [$replycount]<br>";
$retval = "$retval $infodump";
}
mysql_free_result($sql_result);
mysql_close($connection);
$retval = wordwrap($retval,20,' ',1);
return $retval;
}---I am me -- I'm boring like that.
Visit: http://www.britstorm.co.uk