Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
1.8 Mark thread as unread on post editing
#1
Currently, after you read a thread and one edits one's post, there is no way for you to see that something has changed other than specifically visit the thread from time to time.

I suggest that upon post edit the post to be marked as new so that the thread becomes unread. This could also help reducing bumping only for posts.

Don't mess up with the wrong pipsqueaks!

Reply
#2
Agreed with the suggestion.

I thought about that and edited the forumdisplay.php (in v.1.6), line no. 1133

Changing this line:
if($thread['lastpost'] > $last_read && $moved[0] != "moved")

to

$query = $db->simple_select("posts", "edittime", "dateline='{$thread['lastpost']}' AND tid='{$thread['tid']}'");
		while($lastedit = $db->fetch_array($query))
		{
			$last_action = $lastedit['edittime'] > $thread['lastpost'] ? $lastedit['edittime'] : $thread['lastpost'];
		}

		if($last_action > $last_read && $moved[0] != "moved")

But too lazy to test the modification. Don't know if anywhere more it is required to be changes :p
Reply
#3
But what if it was a large thread, for example /me thread, and it was a post in the middle. How would you know what's changed?
Reply
#4
Hmm ... need to query all the posts in the thread and get the highest lastedit timestamp then?
Reply
#5
I guess we could update lastpost on post edit.

Don't mess up with the wrong pipsqueaks!

Reply
#6
This user has been denied support. This user has been denied support.
Not very cool feature, might take up loading time.
Reply
#7
(2014-01-27, 09:13 AM)Cedric Wrote: Not very cool feature, might take up loading time.

Only if you write an extra query that checks all of the posts, which is a little ridiculous for what is needed.

The following is a much cleaner faster way:
(2014-01-26, 11:43 AM)Kaeden Wrote: I guess we could update lastpost on post edit.
Reply
#8
That would be more efficient but last post sounds like it is referring to the last post in a thread not the last post to be edited.
Personally I think should be in a plugin, if someone is willing to create one.
Reply
#9
(2014-01-27, 08:19 PM)JordanMussi Wrote: That would be more efficient but last post sounds like it is referring to the last post in a thread not the last post to be edited.
Personally I think should be in a plugin, if someone is willing to create one.

You know, I think I have changed my mind and agree with you.
Reply
#10
Read statuses should be deleted from the DB after editing a post in a thread. Similar to what I do in my Bump Thread plugin:
	// Bump a thread
	function bump($args)
	{
		global $db, $plugins;

		$db->update_query('threads', array('lastpostbump' => TIME_NOW), 'tid='.(int)$args['tid']);
		$db->delete_query('forumsread', 'fid=\''.(int)$args['fid'].'\'');
		$db->delete_query('threadsread', 'tid=\''.(int)$args['tid'].'\'');

		$plugins->run_hooks('npbumpthread_bump_thread', $args);
	}
Soporte en Español

[Image: signature.png]

Discord at omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)