chriscloyd Posted May 9, 2010 Share Posted May 9, 2010 I have coded my forums and they work well, but now I need some help. I am trying to do the sorta thing that most forums do. When you leave and come back to the forums it shows you which forums or posts have been updated or added by a new color image. Can someone lead me in the way to do it and I can code it out from there. I just cant logically get how it works. Link to comment https://forums.phpfreaks.com/topic/201131-making-forums/ Share on other sites More sharing options...
ignace Posted May 9, 2010 Share Posted May 9, 2010 views (thread_id, user_id, date_last_viewed) To select all unread threads SELECT field, field FROM views RIGHT JOIN threads ON views.thread_id = threads.id WHERE threads.date_last_comment > views.date_last_viewed AND (views.user_id IS NULL OR views.user_id = $user_id) When a user views a thread INSERT INTO views (thread_id, user_id, date_last_viewed) VALUES ($thread_id, $user_id, now()) Link to comment https://forums.phpfreaks.com/topic/201131-making-forums/#findComment-1055269 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.