Jump to content

Show new replies to your posts.


aj123cd

Recommended Posts

Show new replies to your posts.

I am building web forum in php. I am now stuck in the ?Show new replies to your posts? part. I am not able to understand the mechanism of Show new replies to posts.

 

 

Can anyone explain to me how Show new replies to your posts Work?

 

What kind of filter system should I have used?

Please can you advise me?

Thank you for your help.

 

 

Link to comment
Share on other sites

Use the timestamps of the last login time. Then you just retrieve all replies with a newer timestamp, and which belongs to a thread in which the user have replied.

Quite easily done with a simple JOIN statement, or even a subquery. Depending upon your database design, of course.

Link to comment
Share on other sites

Use the timestamps of the last login time. Then you just retrieve all replies with a newer timestamp, and which belongs to a thread in which the user have replied.

Quite easily done with a simple JOIN statement, or even a subquery. Depending upon your database design, of course.

There's a bit more to it if you want it to work past one refresh. For example, this forum - when you load the new replies page, it shows you the unread ones. Once you view one of them, the rest are still there to view.

Link to comment
Share on other sites

you'll need to implement a tracking table. it can be very simple:

 

user_id | thread_id | timestamp

 

for every thread a user visits, they get logged with a timestamp.  compare a thread_id with a last_post_timestamp to see if there is a greater time. if not, it's not new.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.