Page 1 of 1

forum... checking for new post since last visit.

Posted: Wed Sep 29, 2004 6:05 pm
by b0bby
Hi, im building a custom forum
I have having trouble deciding what posts are new since the users last visit.

I can do it initially as they have a last visittime.. this is updated every time they visit a page on the site.

so im basically listing the posts that were added after the last visit date... easy enuff.
but once the page is refreshed.. the list is emptied as their visit time will have been updated...

i have though of a way of doing it with a seperated user_viewed table.
for posts.
listing post id's and who has viewed them

but i would like to avoid this as it could cause delays with the database if it was to get large.

VB and PHPbb do this thing very well... i cannot figure out how they do it.

Any ideas suggestions would be much appreciated
Thanks
Rob

Posted: Wed Sep 29, 2004 6:39 pm
by John Cartwright
1. A cookie is set each visit with a timestamp
2. When viewing threads it will check the timestamp of each post to see if it is greater then the cookie
3. If it is show that is has a new post


pretty simple

Posted: Wed Sep 29, 2004 6:42 pm
by tim
the simplest solution is combine a cookie and set a timestamp to it and compare n contrast the timestamp value to whatever u want

edit - beaten to it