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

Home » FUDforum Development » Bug Reports » Already Read entries (Labelling in Treeview)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Aw: Already Read entries [message #187053 is a reply to message #187051] Sat, 30 January 2016 14:29 Go to previous messageGo to previous message
andynormancx is currently offline  andynormancx   United Kingdom
Messages: 6
Registered: January 2016
Karma:
Junior Member
I'm thinking that the problem is in tree_msg.php.t and root_index.php.t

Back on 17/04/2011 a change was made to tree_msg.php.t, the following was removed:

        th_inc_view_count($msg_obj->thread_id);
	if (_uid && $msg_obj) {
		if ($msg_obj->last_forum_view < $msg_obj->post_stamp) {
			user_register_forum_view($msg_obj->forum_id);
		}
		if ($msg_obj->last_view < $msg_obj->post_stamp) {
			user_register_thread_view($msg_obj->thread_id, $msg_obj->post_stamp, $msg_obj->id);
		}
	}


at the same time a switch statement was added to root_index.php.t:

	switch ($t) {
		case 'msg':
			if (!isset($_GET['prevloaded'])) {
				th_inc_view_count($frm->id);
			}
			if (_uid && $obj2) {
				if ($frm->last_forum_view < $obj2->post_stamp) {
					user_register_forum_view($frm->forum_id);
				}
				if ($frm->last_view < $obj2->post_stamp) {
					user_register_thread_view($frm->id, $obj2->post_stamp, $obj2->id);
				}
			}
			break;
		case 'tree':
			th_inc_view_count($msg_obj->thread_id);
			if (_uid && $msg_obj) {
				if ($msg_obj->last_forum_view < $msg_obj->post_stamp) {
					user_register_forum_view($msg_obj->forum_id);
				}
				if ($msg_obj->last_view < $msg_obj->post_stamp) {
					user_register_thread_view($msg_obj->thread_id, $msg_obj->post_stamp, $msg_obj->id);
				}
			}
			break;
		case 'login':
			/* Clear expired sessions AND anonymous sessions older than 1 day. */
			q('DELETE FROM {SQL_TABLE_PREFIX}ses WHERE time_sec<'. (__request_timestamp__- ($FUD_OPT_3 & 1 ? $SESSION_TIMEOUT : $COOKIE_TIMEOUT)) .' OR (user_id>2000000000 AND time_sec<'. (__request_timestamp__- 86400) .')');
			break;
		case 'thread':
		case 'threadt':
			if (_uid) {
				user_register_forum_view($frm_id);
			}
			break;
	}


I've changed the switch statement to add an item for 'tree_msg' that falls through to 'tree'. That means that it then gets called when navigating the thread tree via AJAX.

I'm not sure whether this fix is 100% correct yet, it is possible that it is marking stuff read that it shouldn't be.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Several bugs - willing to help with fix
Next Topic: Can not edit nor delete a Category & "SubCategory"
Goto Forum:
  

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

Current Time: Tue May 14 09:29:37 GMT 2024

Total time taken to generate the page: 0.03972 seconds