We already have this which will 'Jump to Last Post'
How hard would it be to convert it to 'jump to first unread post' within a thread for logged in members and leave it as 'jump to last post' for visitors who would not be 'cookied' so therefore the software wouldn't know what they'd read or not?
the last visit time does not indicate whether you have read a post, or even looked in a particular forum. Plus that is exactly how Active.asp works by default, it will show you posts since your last visit.
The two thinks are by no means the same, I can visit without reading anything at all.
yes, you could track it with cookies, you could create a cookie using the forum_id as part of its name and store the date against it, then retrieve when you want to use it
Now that I'm thinking of it, maybe this would be a good use for some of the local storage options instead of cookies? In either case, you still have the fun of figuring out what to do if I read it on my laptop and am now viewing the forum on my tablet... to a programmer, it makes sense that the cookie/local storage didn't follow you from device to device; but to the average user, there would likely be confusion as to why it's telling me I didn't read it when I did.
Now that I'm thinking of it, maybe this would be a good use for some of the local storage options instead of cookies? In either case, you still have the fun of figuring out what to do if I read it on my laptop and am now viewing the forum on my tablet... to a programmer, it makes sense that the cookie/local storage didn't follow you from device to device; but to the average user, there would likely be confusion as to why it's telling me I didn't read it when I did.
Yes, that is very true, so may be better to store in a table perhaps, but you would also need to think about house keeping so if a topic is deleted it would remove it from being tracked (otherwise the table will get full of junk records)
The only way to do it, IMHO, would be to track who viewed which topics in a table, adding a big load for a large, busy server. You could do it by adding a field to the Members table, then comma-separating all topics viewed, appending, appending, ad infinitum. It would be very slow, eventually, checking such a list for every visitor.
Alternatively, instead of last topic read - why not have it jump to FIRST topic posted following date of last visit? Much simpler, much less demand on the database.
Just ruminating out loud, but what if the bulk of the work was left to be done client-side? Store all of the Topic IDs/Post numbers in a JSON format (either in a field in the members table or as discrete files, e.g. 'memberid.json') and let some client-side JS keep it up, sending an updated copy to be synced back at a set interval and/or action...
... I had more to that thought, but after 3 calls, two knocks at the office door, and a few other interruptions I've lost all notion of the original thought. =/
Alternatively, instead of last topic read - why not have it jump to FIRST topic posted following date of last visit? Much simpler, much less demand on the database.
Close to what I had originally posted, but as HuwR pointed out, just because I came doesn't mean I read that post. It could be an acceptable compromise if it's something the community could grasp and be ok with - that I might get bumped to later in a thread than what I'd actually read because it assumed I read everything that was there at the time of my last visit.
Create a new field, called hasread in the topic and reply tables. This field contains a list of values in string form, following a certain pattern. For example: 5|6|12|1107|2045|45. Each value between | represents a member id, who has read the post.
Every time a user opens a forum or topic, while fetching the list of topics or replies, you check if each post was read by that user, by: Splitting the string in hasread Now you have an array containing the memberids, so you just need to check if the current user is in the array
If false, the post is unread, otherwise mark it as read and also append that memberid in the hasread list.