Newest thread for forum.
okay find in forum.php
This is your new default part if forum.php
Code
default:
echo ("<table width='100%' cellpadding='0'>");
$fetch1 = mysql_query("SELECT * FROM `forum_category`");
while ($category = mysql_fetch_array($fetch1))
{
echo ("<tr>
<td id='mains' width='75%'><b>$category[name]</b></td><td id='mains'><b>Newest Thread</b></td>
</tr>
");
$fetch2 = mysql_query("SELECT * FROM `forum_topic` WHERE `cat_id` = '$category[id]'");
while ($topic = mysql_fetch_array($fetch2))
{
$grab = mysql_query("SELECT * FROM `forum_thread` WHERE `id` = '$topic[id]' ORDER BY `id` DESC LIMIT 0, 1");
$newest = mysql_fetch_array($grab);
$threadtitle = "$newest[title]";
$bbctt1 = BBCODE($threadtitle);
echo ("<tr>
<td id='fields' width='75%'><a href='?page=forum&id=$topic[id]'>$topic[name]</a><br><i>$topic[description]</i></td><td id='fields'><a href='?page=forumdisplay&id=$newest[id]'>$bbctt1<br>$newest[poster]</a></td>
</tr>
");
}
}
echo ("</table>");
$rows = mysql_num_rows($fetch1);
if ($rows == 0)
{
echo ("<center><b>Forum is Empty<b></center>");
}
break;
basically we grabbed the news thread in that topic by its id with this code
Code
$grab = mysql_query("SELECT * FROM `forum_thread` WHERE `id` = '$topic[id]' ORDER BY `id` DESC LIMIT 0, 1");
$newest = mysql_fetch_array($grab);
$threadtitle = "$newest[title]";
$bbctt1 = BBCODE($threadtitle);
And we displayed using.
Code
<td id='fields'><a href='?page=forumdisplay&id=$newest[id]'>$bbctt1<br>$newest[poster]</a>
Pretty simple so enjoy.