Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Jump to the first unread post in topic
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

Webbo
Average Member

United Kingdom
982 Posts

Posted - 15 September 2015 :  17:26:58  Show Profile  Visit Webbo's Homepage  Reply with Quote
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  Show Profile  Visit HuwR's Homepage  Reply with Quote
The forum has no way of knowing what the last post you read was as it is not tracked
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 16 September 2015 :  09:33:06  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 16 September 2015 :  12:28:26  Show Profile  Visit HuwR's Homepage  Reply with Quote
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.
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 16 September 2015 :  15:45:36  Show Profile  Visit Webbo's Homepage  Reply with Quote
What would be required for the forum to know the last post you read, would it be possible to add this using cookies?
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 16 September 2015 :  16:18:01  Show Profile  Visit HuwR's Homepage  Reply with Quote
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

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 16 September 2015 :  16:50:47  Show Profile  Reply with Quote
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.
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 17 September 2015 :  02:23:17  Show Profile  Visit Webbo's Homepage  Reply with Quote
What kind of load would that put on a server for a busy forum ?
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 September 2015 :  07:40:07  Show Profile  Visit HuwR's Homepage  Reply with Quote
Not entirely sure
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 September 2015 :  09:30:23  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 September 2015 :  12:05:27  Show Profile  Visit HuwR's Homepage  Reply with Quote
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
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 17 September 2015 :  12:19:10  Show Profile  Reply with Quote
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.
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 September 2015 :  13:58:05  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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. =/
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 September 2015 :  14:00:45  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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.
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 17 September 2015 :  16:42:28  Show Profile  Visit Webbo's Homepage  Reply with Quote
I think that would be confusing for a lot of people

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 September 2015 :  17:36:35  Show Profile  Visit HuwR's Homepage  Reply with Quote
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
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07