FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Tree View- threads not showing as read
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Tree View- threads not showing as read [message #167660] Thu, 23 August 2012 15:00 Go to next message
Motiak is currently offline  Motiak   United States
Messages: 15
Registered: October 2011
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
So, I've had a decent number of complaints from users using tree view on my forum (FUDforum 3.0.3 however I downloaded 3.0.4 and tried it out on a VM and ran into the same issue) that threads they read keep showing up as unread. So I poked around with the code a little and it seems to me like the following from tree.tmpl isn't working as expected:

<a href="{TEMPLATE: tree_branch_lnk}" onclick="fud_tree_msg_focus({VAR: cur->id}, \'{DEF: s}\', \'{CHARSET}\'); return false;" class="big">{VAR: cur->subject}</a>

I don't feel like the fud_tree_msg_focus function in lib.js is properly causing messages to be marked as read which cause threads to show up as unread as well in the forum view. Removing the call to that function seems to fix the problem but I haven't tested it on a wide scale. Is there any specific reason that function needs to be called? Thanks.
Re: Tree View- threads not showing as read [message #167674 is a reply to message #167660] Tue, 28 August 2012 09:08 Go to previous messageGo to next message
Motiak is currently offline  Motiak   United States
Messages: 15
Registered: October 2011
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Adding the following to tree_msg.php.t also seems to work also:

$th= $msg_obj->thread_id;

if (_uid) {
if ($msg_obj->last_view < $msg_obj->post_stamp) {
user_register_thread_view($th, $msg_obj->post_stamp, $mid);
}
if ($msg_obj->last_forum_view < $msg_obj->post_stamp) {
user_register_forum_view($msg_obj->forum_id);
}
}

Does that addition seem to make sense?
Re: Tree View- threads not showing as read [message #167679 is a reply to message #167674] Wed, 29 August 2012 21:46 Go to previous messageGo to next message
NeXuS is currently offline  NeXuS   Korea, Republic of
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
add to buddy list
ignore all messages by this user
Shouldn't the time check be the other way around?

Right now you are saying: if the last_view timestamp is smaller than the object's timestamp (i.e. the user has seen the object BEFORE it has been updated) then mark it as read.

I am very tired and I may be wrong, but it feels that objects should be marked as read only if the user's last_view timestamp is bigger than the object's update timestamp (i.e. if the user has read the object AFTER it has been updated).
Re: Tree View- threads not showing as read [message #167694 is a reply to message #167679] Thu, 30 August 2012 09:06 Go to previous messageGo to next message
Motiak is currently offline  Motiak   United States
Messages: 15
Registered: October 2011
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
NeXuS wrote on Wed, 29 August 2012 21:46
Shouldn't the time check be the other way around?

Right now you are saying: if the last_view timestamp is smaller than the object's timestamp (i.e. the user has seen the object BEFORE it has been updated) then mark it as read.

I am very tired and I may be wrong, but it feels that objects should be marked as read only if the user's last_view timestamp is bigger than the object's update timestamp (i.e. if the user has read the object AFTER it has been updated).


I pulled that code (altered slightly) out of tree.tmpl. My understanding of it is if your last_view is less than the timestamp (IE if you haven't looked at the post and your last_view=0) then the database is updated so that your last_view=timestamp.
Aw: Re: Tree View- threads not showing as read [message #167704 is a reply to message #167694] Mon, 03 September 2012 01:53 Go to previous messageGo to next message
alopezie is currently offline  alopezie   Germany
Messages: 90
Registered: September 2003
Karma: 1
Member
add to buddy list
ignore all messages by this user
Thanks for your work.
We have the same annoying problem for some time (3.0.4RC2), so I´ ll try your fix after updating to the most recent release.


Alopezie.de - das Forum zum Thema Haarausfall
Re: Aw: Re: Tree View- threads not showing as read [message #167706 is a reply to message #167704] Mon, 03 September 2012 09:48 Go to previous message
Motiak is currently offline  Motiak   United States
Messages: 15
Registered: October 2011
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
alopezie wrote on Mon, 03 September 2012 01:53
Thanks for your work.
We have the same annoying problem for some time (3.0.4RC2), so I´ ll try your fix after updating to the most recent release.


I actually ran into another issue. When I put in my fix things started acting up differently. Basically I ran into two new problems:

1. Sometimes posts would now look as read when they weren't.
2. Posting in a thread causes threads to look completely read when they're not.

I believe this is because the read SQL table works as follows (and I may be wrong):

Each user gets a last_read entry for the last post that they've read timewise in a thread. That means if they read a post then all posts posted before that will show as read, whether or not they actually read it. Also this means that a reply will make the entire thread show as read which as also an issue. I'm trying to think of a good resolution for this, but it mainly just seems like the read table was created for Flat view, not Threaded.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Syndication enabled but not functioning
Next Topic: Error with Googlebot / Invalid links
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Oct 21 10:12:55 EDT 2017

Total time taken to generate the page: 0.00747 seconds