Hey
Im pretty bored so i decided to try and make my own forum, similar to phpbb. My question is how does php know which posts have been read and which have not been read?
I've looked through the phpbb files but they didnt help.
Thanks in advance
One way: Have another field in your table named 'read' -- 0 or 1. When you serve up a post set it to 1.
Better way: Name the field readtimes -- integer. Increment each time a post is served up.
Originally posted by kburger One way: Have another field in your table named 'read' -- 0 or 1. When you serve up a post set it to 1. Better way: Name the field readtimes -- integer. Increment each time a post is served up.
That would only work if you had one user. You would have to make a relational table with post_id, user_id and every time a person looks at a new post, enter a record in this table. Then if the post_id, user_id combo is not in this table then the person hasn't read the post yet.
Right. But I thought his question was whether or not ANYONE had read a particular post. Maybe I misread his question.
Originally posted by acidbox That would only work if you had one user. You would have to make a relational table with post_id, user_id and every time a person looks at a new post, enter a record in this table. Then if the post_id, user_id combo is not in this table then the person hasn't read the post yet.
Wouldnt that end up making a very large database?
Or dont that matter
Problem solved
I spent a good five hours ripping apart PHPBB and managed to find out how they acheive this feature.
If anyones intrested in how it does work, drop me an email or something.
Thanks anyway guys. Appreciated your input.
hey dj, i'd be really interested in knowing how to do this, because i'm in the process of building a form too, and this has stumped me for now...
Each users has timestamps, maybe?