News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Re-thinking read/unread features

Started by kaiden11, January 20, 2012, 01:37:22 AM

Previous topic - Next topic

kaiden11

For the sake of completeness, if anybody decides to pursue this, two things:


  • The boundaries algorithm works just as well backwards. If you want to mark one or many posts as "unread," you can shrink boundaries to no longer include the posts in question, or, in the event that you cannot shrink, split the original boundary into two (and continue checking to see if shrinking is possible). You end up with a similar list of boundaries to delete, insert, or update as you would for marking something as read (and, as I'm finding, you can handle the deletes, inserts, or updates using the same subroutine).
  • Forum software that stores the latest ID or latest timestamp for a particular topic could provide an interim solution that would make peeking at the latest discussion in a topic or reading backwards a little less disruptive to viewing history. If the record for the latest ID in a topic were also to include the "earliest" ID, as identified by the first post on the page viewed when you set the latest ID, you could answer how many posts in a topic were unread by counting the number of posts outside the "earliest" and latest IDs. Some consideration would have to be given for what conditions you should update the earliest ID, but given the earliest, latest, and the count of posts per page, one could fashion something. My point being: software like SMF is essentially half-way there, given that they're already storing an upper "read" boundary ID for topics, with an effective "0" in the lower "read" boundary ID's place.

Advertisement: