Hey Urban please help me on mines, I m not asking you do do the whole thing for me but you know your last post infofrmtion it updates when someone makes a new tpic or replys to an older topic and the last post information updates. I really need mines to update the last post information if someone replyies to an older topic because at the moment it just updates if someone makes a new topic pleasee help:
this is how my code looks like
//*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// MAIN FORUM
//*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
switch ($_GET['action']) {
default:
$fetch1 = mysql_query("SELECT * FROM `forum_category`");
while ($category = mysql_fetch_array($fetch1)) {
echo "<div class='box'>
<div class='forum_bar'> <img src='/images/icons/bullet4.gif' /> Smart CMS Community</div>
</div><br>";
$fetch2 = mysql_query("SELECT * FROM `forum_topic` WHERE `cat_id` = '$category[id]'");
while ($topic = mysql_fetch_array($fetch2)) {
$getTopics = mysql_num_rows(mysql_query("SELECT * FROM `forum_thread` WHERE `thr_id` = '$topic[id]';"));
$getReplies = mysql_num_rows(mysql_query("SELECT * FROM `forum_posts` WHERE `fid` = '$topic[id]';"));
$getLatestTopic_a = mysql_query("SELECT * FROM `forum_thread` WHERE `thr_id` = '$topic[id]' ORDER BY `id` DESC LIMIT 1");
$getLatestTopic = mysql_fetch_array($getLatestTopic_a);
$timeago = date("jS F Y - h:i A", $getLatestTopic['timeposted']);
echo "<div id='forum_cat'>
<div class='forum_contant'>
<div class='boxtitle'>Category: $category[name]<a href='?page=home&action=forum&id=$topic[id]'> <img src='images/default/form_enter.gif' border='0'></a></div>
<div class='sub_forum'>$topic[name]</div>
<div class='forum_image'><img src='$topic[icon]' /></div>
<div class='forum_top'>Topics Made: $getTopics | Replies Made: $getReplies</div>
<div class='forum_description'>";
if (mysql_num_rows($getLatestTopic_a) == 0) {
print "<fieldset>
<legend>Last Post</legend>
In: No Posts Made
By: -<br>
</fieldset>";
} else {
$getTopicReplies_query = mysql_query("SELECT * FROM `forum_posts` WHERE `thr_id` = '$getLatestTopic[id]';");
$getTopicReplies_num = mysql_num_rows($getTopicReplies_query);
$getTopicReplies = mysql_fetch_array($getTopicReplies_query);
if(($getLatestTopic['timestamp'] > $getTopicReplies['timestamp']) || $getTopicReplies_num == 0 ){
print "<fieldset>
<legend>Last Post</legend>
In: <a href="?page=forum&action=forumdisplay&id=$getLatestTopic[id]">$getLatestTopic[title]</a>
By: <a href='?page=members&user=$getLatestTopic[poster]'>$getLatestTopic[poster]</a><br></fieldset>";
}else{
print "<fieldset>
<legend>Last Post</legend>
In: <a href="?page=forum&action=forumdisplay&id=$getLatestTopic[id]">$getLatestTopic[title]</a>
By: <a href='?page=members&user=$getTopicReplies[poster]'>$getTopicReplies[poster]</a><br></fieldset>";
}
}
print "</div>
<div class='bottom'></div>
</div>
</div>";
}
echo "<div class='clearer'></div>"; // give space sunder the forums
}
$rows = mysql_num_rows($fetch1);
if ($rows == 0) {
echo ("<center><b>Forum is Empty<b></center>");
}
break; // end of main forum section