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
https://forums.phpfreaks.com/topic/267795-show-new-replies-to-your-posts/
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.

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.

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.

Archived

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

×
×
  • 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.