Page 1 of 1
Displaying unread posts
Posted: Fri Jun 11, 2004 4:39 pm
by BCVisin
Hi, I am creating a custom fourm for myself and I want to know how phpBB and vBulletin allow each user to see which fourms and topics they haven't read yet. I know that you can display the posts since last visist, but I want to know how to display unread posts, not the posts since last visit. Also, when a user signs up, I want them to have been marked as read all posts, so it is only the new posts after they log in. Any ideas?
Posted: Fri Jun 11, 2004 5:02 pm
by PrObLeM
have it save when the last time was loged in then and when the last post was ...so if the the time on the last post is > than the last time loged in then they are new else they arent new
use time()...
Posted: Fri Jun 11, 2004 5:23 pm
by BCVisin
Ya, I fiured that one out, but when a user logs in and there are 10 new posts, and they view one of those new posts, then I want there to be 9 unread posts, and if they leave to go have dinner, or whatever, and come back an hour later, they can still see that they didn't read those 9 posts. It is not so much a question of posts since last visit, as it is a question of unread posts. Thanks for your reply!
Posted: Sat Jun 12, 2004 1:22 pm
by penguinboy
I only see two options.
* In the post keep a log of user ids.
* In the user record keep a log of viewed posts.
Posted: Sat Jun 12, 2004 1:44 pm
by feyd
or just store the previous log in time (not page access time, actual login time) .. count a somewhat long period.. say 2 hrs or something, as a soft log out.
Posted: Sat Jun 12, 2004 3:00 pm
by kettle_drum
It really is too much effort to store which posts each user has seen and not seen, as imagin on a big forum like this where there is like 100000 posts, you either have to store that 1000 users havent seen a post, or that 1000 users have seen a post. If you store this client side on a cookie, then this has to be sent back and forth all the time so the load time is huge, or if you store it server side you waste alot of space.
Its best as feyd said to just have like a 2 hour limit to show new posts, i.e. all posts from the time you came on the site, to 2 hours in the future are considered new - then you assume that the user has read them - or wasnt interested in them.
Posted: Sat Jun 12, 2004 5:12 pm
by BCVisin
but I have seen this done with outer forums like this. How is that done? Even if I change computers, I can still see which posts I have not read. There has to be a way...