#1
Currently the YAF read/unread behavior is not optimum compared to other systems like Invision, vBulletin, phpbb, simplemachine, etc. It's currently only implemented as a "changed topics since your last visit" and does not remember if you really read topics or not before leaving the forum.

This is a 1 million dollar question, and all systems seems to have different answers. 😛

See some discussions around the web : here , here  or here 

Currently, YAF remembers only last visit, not real read/unread status.

Example :
- You visit your forum, seeing that 10 topics are not read.
- You read only some topics, then close your browser
- You come back : all 10 topics are marked as read, and only new topic since your last visit are marked as "active"

The two killing features
1) Ability to really track read/unread status, even between two sessions.
2) Ability to go directly to last unread message in a topic, and not last reply (in case you don't read it for a few days).

There are several ways to implement a real "read/unread status" feature. I'm only speaking about this feature a the case of registered users (anonymous users can stay with a last visit feature or less).

Cookie solution : The cookie-only solution seems not to be the most efficient because of the limitations of cookies (in size and quantity) and the fact that a user will not be able to track read/unread status from different computers will be a big drawback.

Db solution : Keeping read/unread status by topic for each user could become dangerous and not scalable. Depending the tracking system enabled (track all read status against track all unread status) a user which comes rarely will have a growing # of rows if you track unread topics, and a frequent user will have a huge # of rows if you track read topics.

A workaround seems to track unread status until a certain amount of days and/or a limit since your last visit, or combine both : in forum administration, an option will allow to set after how many days a topic will always be considered as read (using its last activity date).

My proposition / reflexion

Create a new table : topic_tracking
- userid int not null
- topicid int not null
- lastvisit datetime not null
- PK (userid, topicid)
- IX (topicid) to prune topics where activity limit has been reached

When a new topic is created, or a reply added
- Don't do anything, a topic will, by default, be flagged as "new" if created since your last visit

When you enter the forum (session start)
- Select all tracked topics for this user, joined with last topic activity to quickly detect which are the topics previously not read, consider them as "active" (new behavior)
- Check the user last visit and add all changed topic since then as "active" (current behavior)
- Store this list of active topics in session as "ActiveTopics"

When a user visit a topic
- If the topic is tracked in "ActiveTopics", update the lastvisit with the last displayed post date. If the user visit the first page, the remaining pages will still be "unread". If the read page is the last, then consider removing the entry. But keeping the entry could allow to still see the topic in the "active topics" page, but marked as read.

When a session end
- Update the topic_tracking table with session datas (we will only insert or update rows,

In a scheduled task
- Clear in DB all tracked topics where the topic last activity is older than the admin settings

I'll try to implement this feature "as-is" in the trunk, but before I must learn more from the source code to detect any gotcha. 😁

If you have comments, questions or anything else please post them.
Topic Starter
  • styx31
  • Rank: YAF Lover
  • Reputation:
    Friendly
    69.2%
  • Joined: 02/06/2009
  • Posts: 33
  • Was thanked: 7 time(s) in 4 post(s)
#2
I would like to add my vote for this feature.

And it would be fairly easy to code in, however I don't modify open source software because I then have to reintegrate all my code into each new version that comes out.

But I can be of any assistance let me know.

  • apedley
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    51.2%
  • Joined: 30/04/2010
  • Posts: 2
  • Thanks: 1 times
#3
I have done some investigations in yaf source, and it's not really an easy job...

For now, I don't have enough time to code this feature. It's on my (too long) todo list.
Topic Starter
  • styx31
  • Rank: YAF Lover
  • Reputation:
    Friendly
    69.2%
  • Joined: 02/06/2009
  • Posts: 33
  • Was thanked: 7 time(s) in 4 post(s)
#4
@styx31

I've made something like you said in my web application - I've written forum based on YAF source code.
I set up read/unread option with Database.
Stored procedure for topics list -> I'm just checking (with Join) the table LastVisits. If there was no such TopicID and UserID in this table, I'm getting 1 (new). If it exist, I'm checking the last visit datetime and then 1 or 0.

I didn't use storing an ActiveTopics in session/cache - your idea is really great, but I don't know what to do with display forums list.
How to check if there are new (unread) posts in specify forum?
  • Grzesiek
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    53%
  • Joined: 20/03/2010
  • Posts: 4
  • Thanks: 1 times
#5
Grzesiek wrote:

@styx31

I've made something like you said in my web application - I've written forum based on YAF source code.
I set up read/unread option with Database.
Stored procedure for topics list -> I'm just checking (with Join) the table LastVisits. If there was no such TopicID and UserID in this table, I'm getting 1 (new). If it exist, I'm checking the last visit datetime and then 1 or 0.

I didn't use storing an ActiveTopics in session/cache - your idea is really great, but I don't know what to do with display forums list.
How to check if there are new (unread) posts in specify forum?


GPL requires that you make these changes available publicly.

What is the URL to your changes?

EDIT: YAF.NET is GPL v2 which is a "CopyLeft" license. Although it is not required that you make your changes available, it is required that if you distribute your forum that you open source your changes.

Quote:

"To copyleft a program, we first state that it is copyrighted; then we add distribution terms, which are a legal instrument that gives everyone the rights to use, modify, and redistribute the program's code, or any program derived from it, but only if the distribution terms are unchanged. Thus, the code and the freedoms become legally inseparable."



More information here: http://www.gnu.org/copyleft/ 
  • Jaben
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.YAF.NET Supporter: Loves YAF.NET!YAF.NET Supporter: Supports our efforts. Thank you.Medal of Honor for the Support King: Given to a community member who tirelessly answers tons of support questions.
  • Joined: 09/10/2004
  • Posts: 2,544
  • Location: United States
  • Thanks: 142 times
  • Was thanked: 352 time(s) in 195 post(s)
#6
Item has been added as a request for v1.9.4 final: YAF-61
  • Jaben
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.YAF.NET Supporter: Loves YAF.NET!YAF.NET Supporter: Supports our efforts. Thank you.Medal of Honor for the Support King: Given to a community member who tirelessly answers tons of support questions.
  • Joined: 09/10/2004
  • Posts: 2,544
  • Location: United States
  • Thanks: 142 times
  • Was thanked: 352 time(s) in 195 post(s)
#7
it would also be cool to link to the last unread post within an active thread rather than linking to the last post within the thread.
  • f0zzyNUE
  • Rank: YAF Commander
  • Reputation:
    Exalted
    100%
  • Joined: 09/09/2010
  • Posts: 89
  • Thanks: 34 times
  • Was thanked: 2 time(s) in 2 post(s)
#8
f0zzyNUE wrote:

it would also be cool to link to the last unread post within an active thread rather than linking to the last post within the thread.


Where? YAF does have this feature, actually. It's used in the My topics.
  • Jaben
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.YAF.NET Supporter: Loves YAF.NET!YAF.NET Supporter: Supports our efforts. Thank you.Medal of Honor for the Support King: Given to a community member who tirelessly answers tons of support questions.
  • Joined: 09/10/2004
  • Posts: 2,544
  • Location: United States
  • Thanks: 142 times
  • Was thanked: 352 time(s) in 195 post(s)
#9
Originally Posted by: Jaben

f0zzyNUE wrote:

it would also be cool to link to the last unread post within an active thread rather than linking to the last post within the thread.


Where? YAF does have this feature, actually. It's used in the My topics.


I think he meant the first unread post of the topic rather than the last, which will be the last post in the topic anyways. Some members on my forum have also asked about this feature. Is that something in the pipeline?
  • dillegummin
  • Rank: YAF Lover
  • Reputation:
    Exalted
    90.8%
  • Joined: 27/08/2005
  • Posts: 66
  •  Norway
  • Thanks: 32 times
  • Was thanked: 1 time(s) in 1 post(s)
#10
Any update on adding this? It's the only missing feature that really bothers me about this otherwise very decent forum.
Users that are used to other forum software always complain about this, and people are missing out on topics they should be reading.
  • SiggiG
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    50.6%
  • Joined: 10/10/2010
  • Posts: 1
  • Thanks: 1 times
#11
Sorry, but I have second SiggiG's opinion here... 😉

It's kinda standard forum behaviour in phpBB and other forums...

But YAF's much better now by jumping to the last post (not last unread), than the beginning of the topic as it was before... Credits for that!
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Old Chinese Proverb]
  • JP
  • Rank: YAF Leader
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor for Bug Finder: Given for kick-assery at finding bugs by being excellent at QA.YAF.NET Supporter: Loves YAF.NET!YAF.NET Supporter: Supports our efforts. Thank you.
  • Joined: 08/01/2009
  • Posts: 398
  • Thanks: 86 times
  • Was thanked: 39 time(s) in 35 post(s)
Users browsing this topic
    Forum Jump  
    • You cannot post new topics in this forum.
    • You cannot reply to topics in this forum.
    • You cannot delete your posts in this forum.
    • You cannot edit your posts in this forum.
    • You cannot create polls in this forum.
    • You cannot vote in polls in this forum.

    About Us

    The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

    Powered by Resharper Donate with PayPal button

    Project Twitter Updates

    Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved