Jump to content

Forum topic


mc_keny

Recommended Posts

hey guys hears the thing i make a forum and its working and every thing i need a lil help though i want when a user post in a topic the topic move up says its way down the bottom and you post in it, it come to the top

Link to comment
Share on other sites

When you query all the forums, sort them by date. You do store all topics with their creation time, right?

Link to comment
Share on other sites

Have another column for last_post_time, which is updated every time someone posts. Then sort according to that column.

Link to comment
Share on other sites

yeah i did that so your saying when a user post just update the creation date for the topic? if so whats the query for ordering them by date? eg mysql_query("SELECT id,name FROM mc_topic WHERE fid='".$did."' ORDER BY date_cr DESC");?

Link to comment
Share on other sites

Can do it like this (change names etc to your own codes):

| Topic | Poster | Last Poster | Posted date | Last post date |<?php $forum=mysql_query("SELECT * FROM forum WHERE forumname='$_GET[forumname]' ORDER BY lastpostdate DESC");while($forumfetch=mysql_fetch_object($forum)){echo"| $forumfetch->title | $forumfetch->poster | $forumfetch->lastposter | $forumfetch->datemade | $forumfetch->lastpostdate |}?>

hope that helps and works :)...- DJKDra

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...