I commented everything well. If something is not understood please ask and I will tell.
$topicquery = mysql_query ('SELECT * FROM js_forum_topics
WHERE forumid="'.$sub.'"');
while ($topics = mysql_fetch_array($topicquery)) {
//Displays all of the topics and a subjects for the topic
//Database structure for js_forum_topics
//topicid (INT), forumid (INT), topic_starter (INT), topic_name,
//topic_subject, topic_date, topic_content, topic_views (INT),
//lastpost_user (INT), lastpost_time
<a href="thread.php?top='.$topics["topicid"].'">
'.$topics["topic_name"].':
</a><BR>
'.$topics["topic_subject"].'
/**********************
Get Poster Username. Using $topics["topic_starter"] from above
while loop
*************/
$topicstarter = mysql_query ('SELECT username FROM js_users
WHERE userid="'.$topics["topic_starter"].'"');
$thestarter = mysql_fetch_array($topicstarter);
echo ''.$thestarter["username"].'';
/**********************
Get Reply count for topic. using $topics["topicid"] from while loop.
while loop
*************/
// Database structure for js_forum_replys
//replyid (INT), forumid (INT), topicid (INT), reply_subject,
//reply_comment, reply_date, repy_user (INT).
$replycount = mysql_query ('SELECT * FROM js_forum_replys
WHERE topicid="'.$topics["topicid"].'"');
$totalreplys = mysql_num_rows($replycount);
echo ''.$totalreplys.'';
}
/**********************
I currenty dont have a query for Last Reply for topic. But will
have one in the future.
*************/
This shows only 3 but if i can solve these then the rest will be easy changes.