Author |
Topic |
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 15 September 2015 : 17:26:58
|
Having done a search for a 'Jump to first unread post in a topic' the nearest I could find relating to it was this old thread... http://forum.snitz.com/Forum/topic.asp?ARCHIVE=true&TOPIC_ID=31927
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? |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 16 September 2015 : 06:12:25
|
The forum has no way of knowing what the last post you read was as it is not tracked |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 16 September 2015 : 09:33:06
|
You could make a decent guess based on the last visit time and the post time, but I forget exactly when the last visit time is updated. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 16 September 2015 : 12:28:26
|
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. |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 16 September 2015 : 15:45:36
|
What would be required for the forum to know the last post you read, would it be possible to add this using cookies? |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 16 September 2015 : 16:50:47
|
You'd have to track the last post read in each/every forum that a person has access to. You would have to update the cookie every time a post is read. |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 17 September 2015 : 02:23:17
|
What kind of load would that put on a server for a busy forum ? |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 17 September 2015 : 07:40:07
|
Not entirely sure |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 17 September 2015 : 09:30:23
|
True, didn't quite think it all the way through.
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. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 17 September 2015 : 12:05:27
|
quote: Originally posted by AnonJr
True, didn't quite think it all the way through.
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) |
MVC .net dev/test site | MVC .net running on Raspberry Pi |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 17 September 2015 : 12:19:10
|
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. |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 17 September 2015 : 13:58:05
|
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. =/ |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 17 September 2015 : 14:00:45
|
quote: Originally posted by Carefree
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. |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 17 September 2015 : 16:42:28
|
I think that would be confusing for a lot of people
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 17 September 2015 : 17:36:35
|
You could try an approach similar to below
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.
|
MVC .net dev/test site | MVC .net running on Raspberry Pi |
|
|
Topic |
|