i wrote this myseld and it doesn't seem to be working correctly. it only shows me 2 of the 3 threads in the specified forum (4)
PHP Code:
<?
$dbhost = 'localhost';
$dbname = '*****';
$dbuser = '*****';
$dbpass = '*****';
mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname);
$sql = 'SELECT t.*, p.*, pp.*
FROM thread AS t, post as p, postparsed as pp
WHERE t.forumid = 4 AND p.postid = t.firstpostid AND p.postid = pp.postid
ORDER BY t.firstpostid DESC
LIMIT 5';
$sqlresult = mysql_query($sql) or die(mysql_error());
$count = mysql_num_rows($sqlresult);
while ($row = mysql_fetch_array($sqlresult))
{
$subject = $row['title'];
$poster = $row['username'];
$posterid = $row['userid'];
$time = date("D, M j, Y", $row['dateline']);
$replies = $row['replycount'];
$id = $row['threadid'];
$text = $row['pagetext_html'];
if ($replies == 1)
$replytext = 'reply';
else
$replytext = 'replies';
echo "<b>$subject</b>";
echo '<br>';
echo '<font style="font-size: 8pt;">';
echo "Posted by <a href=\"forums/member.php?u=$posterid\">$poster</a> on $time (<a href=\"forums/showthread.php?t=$id\">$replies $replytext</a>)";
echo '</font>';
echo '<br><br>';
echo $text;
}
?>
any php/vbulletin gurus that can give me a hand? im just trying to display posts as news on my home page...the news forumid is 4...