Check for new posts in a forums

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lshaw
Forum Commoner
Posts: 69
Joined: Mon Apr 20, 2009 3:40 pm
Location: United Kingdom

Check for new posts in a forums

Post by lshaw »

I have a forum set up with the tables:
Forums-id,name,description
Topics-id,forum,subject,body,author,date
Replies-id,topic,body,author,date

I have an additional table that adds a record the first time someone visits a topic:
readposts-id,user,topic
I can than tell them how many posts they have read out of the total using mysql_num_rows but this does not give them the detail of which forum the new topic is in or which forum or topic a new reply is in(i have nothing for replies currently).

Records are turned to an array using a while loop with mysql_fetch_array and I need a way of showing 'new posts' next to a forum if the record does not exsist in 'readposts' for this user. I have a session variable that stored usernames.

Sorry that this is really hard to understand but I hope someone can help me

lewis
Post Reply