Welcome Guest, Not a member yet? Register   Sign In
'Message Read' functionality
#1

[eluser]richzilla[/eluser]
Hi all, ive just implemented a fairly simple post read / unread functionality in an app im working on, but its something ive not done before, and i was wondering wether i was going about it the wrong way or if there was a simpler / more effective way to do it.

Basically at present, i have a table in my database named post_user_flags that contains the fields:

Code:
flag_id
post_id
user_id

when the post is updated a flag is created for any user who has commented on that post. When the user logs in again, a check is made for any entries in the flag table for the users posts. When the user clicks a post that is unread, the flag is deleted.

This is the first time ive done something like this, so i may be going about it the wrong way, any help would be appreciated. Cheers.
#2

[eluser]jedd[/eluser]
This is pretty similar to the way that I handled 'last read' post counting in a thread within a forum - obviously I track thread ID's as well, but otherwise it looks similar to what you have. Oh, I also want to track the most recent read - so I can work out if (and how many) new messages attached to a post exist.

So, yes, I think you'll be okay. The only thing I'd encourage is to deeply consider the meaning and implications for a flag id not being present - whether you want it to mean it's unread for the user, not watched any longer, never visited (and consequently should mean 'new'), etc.
#3

[eluser]BrianDHall[/eluser]
I would use javascript to pop open a window that tells the user to keep a pencil and paper handy, because I can't be bothered to keep track of what they have and have not read. That's their job, the lazy SOBs.

...ok, so back to work for me then Wink




Theme © iAndrew 2016 - Forum software by © MyBB