Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Determining unread posts

 
Post new topic   Reply to topic    Bay Six Software Forum Index -> SapientBoard
View previous topic :: View next topic  
Author Message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 728

PostPosted: Mar 27th, 2009, 11:54pm    Post subject: Determining unread posts Reply with quote

Alyce brought up this issue in the "pet peeves" topic and I think it needs more in-depth discussion.
Alyce wrote:
I like an easy way to view recent posts. The LB board does not give you the ability to display only unread posts, or more than 10 recent posts.

Conforums (and other sites that use the same software) store which topics have unread posts in their database. I presume that the table gets updated when the user logs on because it would become very burdensome to do this for all users every time someone creates or deletes a post. This data by itself probably takes up several megabytes (if not GB) due to the number of accounts. If they tried to track the read status of individual posts, I'm sure that would consume at least 10 times the storage.

Besides, it wouldn't be practical to store the status of individual posts because they almost always appear in multiples. But if it could display all of the unread posts, how would the software know if you actually read them?

At the other extreme is software like phpBB, which doesn't store any read status data. Instead, it determines what is "new" based solely on when a user last visited compared to when posts were created. If the topics are not read then, upon the next visit those same posts are considered "old."

There might be some middle ground, but it could be complicated. It would involve a database table, but with limits. There might be three levels: admins, mods, and regular users.

Admins might have unlimited status. Mods might be unlimited for the area they moderate, but are otherwise regular users. Everyone else might be limited to 20 topics per forum, or whatever the admins choose.

Can anyone see a better way?

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
Alyce
Full Member


Joined: 04 Jul 2005
Posts: 91

PostPosted: Mar 28th, 2009, 1:52am    Post subject: Re: Determining unread posts Reply with quote

I don't care about read/unread so much. Proboards allows the admin to determine the number of "most recent posts" that show in the info box at the bottom of the forum. Conforums has only the standard 10. A "xxx most recent posts" wouldn't need to be stored in a database, correct? Only the xxx would need to be stored.
_________________
- Alyce
Back to top
View user's profile Send private message Visit poster's website
STPendl
Full Member


Joined: 20 Aug 2007
Posts: 161
Location: Austria

PostPosted: Mar 28th, 2009, 9:53am    Post subject: Re: Determining unread posts Reply with quote

Posts since last visit is not hard to do, it only takes one additional info about the member.

Unread posts needs an additional index for every thread, which contains the members who haven't read the topic since the last reply.
This would be a huge amount and would need a purge for members, which have left but did not delete their account or are only visiting once in a while.

A member selectable value of recent posts in conjunction with posts since last visit could be an option.
I would allow the most recent post count to be set in the members profile, selecting from 10, 20, 50, 100.
The search would find the posts since last visit up to the count specified.
This should reduce database workload too.

_________________
Stefan

Any code I post can be freely used, just give credit.
Back to top
View user's profile Send private message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 728

PostPosted: Mar 28th, 2009, 8:35pm    Post subject: Re: Determining unread posts Reply with quote

The problem with the "X most recent posts" feature is the loss of context and continuity. I'm considering how feasible it is to do this but group the posts by topic.
Back to top
View user's profile Send private message Send e-mail
STPendl
Full Member


Joined: 20 Aug 2007
Posts: 161
Location: Austria

PostPosted: Mar 28th, 2009, 9:49pm    Post subject: Re: Determining unread posts Reply with quote

So it seems to be better to have "X most recent threads", which should be a smaller number anyway.
_________________
Stefan

Any code I post can be freely used, just give credit.
Back to top
View user's profile Send private message
BASICwebmaster
Guest





PostPosted: Mar 29th, 2009, 1:37am    Post subject: Re: Determining unread posts Reply with quote

Store a timestamp of the user's last visit. Each message has a posted timestamp. Whenever a message is posted, each board's last updated timestamp is updated too.

For the main page, you only have to show which forums have unread messages. You're already querying the boards table anyway, so just get the last updated timestamp and compare to the user's last visit timestamp. When you visit a particular board, the method is similar, but with individual threads instead of boards.

For unread since last visit, query for messages posted after the the user's last visit.

(This is a lot of what I've been playing with away from LB. Algorithms and theory doesn't come up much.)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bay Six Software Forum Index -> SapientBoard All times are GMT
Page 1 of 1
Jump to:  
Quick Reply
Username:
Message:
   Shortcut keys: Alt+Q to activate, Alt+P to preview, Alt+S to submit
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Lo-Fi Version
Powered by phpBB © 2001, 2005 phpBB Group