New threads since last visit
Posted: Tue Jun 30, 2009 5:09 pm
This is harder than first thought. So I have a variable for each user called "last_seen" that gets updated every 10 minutes to the database. This works for knowing when the user last visited the site, but is worthless when using it to check for which threads are new.
For example, the user visits the site's forum and notices that several of the boards have new posts. So he begins at the first board of his interest and spends 10 minutes reading the posts. After he finishes with the posts in this board he goes back to the index only to find none of the boards have been marked as having unread posts.
The "last_seen" variable becomes inaccurate for checking which threads are new. This could easily be fixed by capturing the "last_seen" variable once at the beginning then using that. However, the way my "remember me" feature works is by simply keeping the session data/cookie after the user's client has closed ( Zend_Session::rememberMe() ). Because of this, the captured "last_seen" variable becomes inaccurate again because it could have been set a few weeks ago.
I'm having a hard time trying to figure out how to fix this. I thought of having another timestamp which would be used to indicate when "last_seen" would be updated, but that won't work because you can't guess how long a person will be on a page of the site. If someone could give me some tips on how to solve this, that would be great.
For example, the user visits the site's forum and notices that several of the boards have new posts. So he begins at the first board of his interest and spends 10 minutes reading the posts. After he finishes with the posts in this board he goes back to the index only to find none of the boards have been marked as having unread posts.
The "last_seen" variable becomes inaccurate for checking which threads are new. This could easily be fixed by capturing the "last_seen" variable once at the beginning then using that. However, the way my "remember me" feature works is by simply keeping the session data/cookie after the user's client has closed ( Zend_Session::rememberMe() ). Because of this, the captured "last_seen" variable becomes inaccurate again because it could have been set a few weeks ago.
I'm having a hard time trying to figure out how to fix this. I thought of having another timestamp which would be used to indicate when "last_seen" would be updated, but that won't work because you can't guess how long a person will be on a page of the site. If someone could give me some tips on how to solve this, that would be great.