View or mark unread posts

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
Forke
Registered User
Posts: 102
Joined: Fri Feb 08, 2008 6:03 am

Re: View or mark unread posts

Post by Forke » Wed Mar 12, 2008 11:22 pm

HI again!

I've come with a comment.

I'm using this suggestion you made in the xml file:
If you want the
topic name to be a link to the first unread post (which is the way I prefer),
then make the following additional change in search.php:
And it works great. Except when the unread topic has images; if that is the case, I get redirected to the post with the image (I mean, the one that uses the [img] tag) instead of the unread post.

:)
My first validated mod!
Adaptive Quick Search

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Thu Mar 13, 2008 1:08 am

Forke wrote:Except when the unread topic has images; if that is the case, I get redirected to the post with the image (I mean, the one that uses the [img] tag) instead of the unread post.

:)
I can't replicate that on my test board. Can you give me a bit more info? For example:

- If you have a post in a topic that has an [img] tag in it, and you have a bunch of posts beyond it, and you click the mark unread link in a later post, and then you go to the unread posts list and click the title link, what happens?

- If you do all that but you click the regular unread post flag that appears to the left of the topic title rather than clicking the topic title link, do you have the same problem?

- If you right click the link and paste it into a window to see what it says, where does the link actually point to?

Forke
Registered User
Posts: 102
Joined: Fri Feb 08, 2008 6:03 am

Re: View or mark unread posts

Post by Forke » Thu Mar 13, 2008 1:19 am

Sorry I've bothered you, asinshesq, my issue dissapeared.

I spoke too soon :oops:

Thanks for your quick response!
My first validated mod!
Adaptive Quick Search

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Thu Mar 13, 2008 1:28 am

Forke wrote:Sorry I've bothered you, asinshesq, my issue dissapeared.

I spoke too soon :oops:

Thanks for your quick response!
No problem. Those gremlins can be vicious...

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

fix for taxzamanian's global announcement issue

Post by asinshesq » Thu Mar 13, 2008 4:06 pm

asinshesq wrote:
Tazmanian wrote:Hello,

i think there is a little bug when somebody post a global announcement.

Look at the printscreen. There is an unread (new) global announcement but the link to the view unread post shows 'there are no new messages'. However when I click on it, it does show the unread post.

http://users.telenet.be/ysoers/markunreadposts.jpg
Thanks. I never noticed that before, but note that it's the same behavior you get in an unmodded phpbb3 board. On an unmodded board, the forum where a global announcement is posted does not show up as new post (because as a technical matter the post has a forum_id 0f 0 rather than a forum_id for a particular forum), but it does show up as new in viewforum and does appear in the list of new posts when you click the view new posts link.

I'll consider whether to change that behavior for this mod in a future version when I get some time.
Here's a quick and dirty fix you can try that at least fixes the 'view unread posts' link vs 'you have no unread posts' link problem (I haven't tested it so let us know if it works):

Code: Select all


This approach takes an additional db query so you may not want to do it on a large board.

Note that I have NOT fixed the regular phpbb3 behaviour of not showing any forums as unread on the index.  If I were to fix that, I would have to either (a) show all forums unread whenever there is even one single global announcement unread (which is counterintuitive) or randomly pick a forum to show unread (maybe the forum that sits highest on the page??).

Also note that I have not tired to allow users to mark globals unread (at least, not yet ;) ).

Let me know how this works.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: fix for taxzamanian's global announcement issue

Post by asinshesq » Thu Mar 13, 2008 8:44 pm

asinshesq wrote:
asinshesq wrote:
Tazmanian wrote:Hello,

i think there is a little bug when somebody post a global announcement.

Look at the printscreen. There is an unread (new) global announcement but the link to the view unread post shows 'there are no new messages'. However when I click on it, it does show the unread post.

http://users.telenet.be/ysoers/markunreadposts.jpg
Thanks. I never noticed that before, but note that it's the same behavior you get in an unmodded phpbb3 board. On an unmodded board, the forum where a global announcement is posted does not show up as new post (because as a technical matter the post has a forum_id 0f 0 rather than a forum_id for a particular forum), but it does show up as new in viewforum and does appear in the list of new posts when you click the view new posts link.

I'll consider whether to change that behavior for this mod in a future version when I get some time.
Here's a quick and dirty fix you can try that at least fixes the 'view unread posts' link vs 'you have no unread posts' link problem (I haven't tested it so let us know if it works)
Here's a more complete fix that I have briefly tested. It changes the 'you have no unread posts' text to 'view your unread posts' even if the only unread posts are global announcements, and it now allows the user to mark a global announcement as unread. It is still true that if the only unread posts you have are global announcements, none of the forums on the index are marked as unread, but that's because that is the regular behaviour of phpbb3 and if you want a different result you should install a mod for that (note that there is a mod by barrycarlyon ( http://www.phpbb.com/community/viewtopic.php?t=585080 ) that in fact allows you to put global announcements on the index page, thereby fixing the problem).

Please keep in mind that the fixes below require an extra db query and therefore might slow up a really big board to some extent.

Anyway, here's the code of the fix (let me know if it seems to work for you):

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_view_or_mark_unread_posts.php

#
#-----[ FIND ]------------------------------------------
#
/**
* checks to see if the user has any unread posts in the forum
* (returns true if there are unread posts and false if there are not)
*/
function check_unread_posts()

#
#-----[ BEFORE, ADD ]------------------------------------------
#
/**
* checks to see if the user has any unread global announcements in the forum
* (returns true if there are unread posts and false if there are not)
*/
function check_unread_global_announcements()
{
	global $db, $user;
	// test to see if there are any unread global announcements (note that running this block of code
	// triggers an extra db query so people with large borads may want to comment the block out) 
	$sql = 'SELECT t.topic_id
		FROM ' . TOPICS_TABLE . ' t
		LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (t.forum_id = 0 AND t.topic_id = tt.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
		WHERE
		(
			t.topic_last_post_time > tt.mark_time
			OR (tt.mark_time IS NULL AND  t.topic_last_post_time > ' . $user->data['user_lastmark'] . ')
		)
		AND t.topic_moved_id = 0';

	$result = $db->sql_query_limit($sql,1);
	$row = $db->sql_fetchrow($result);	
	$db->sql_freeresult($result);

	if (isset($row['topic_id']))
	{
		// if we get here, the user has at least one unread global announcement
		return true;
	}
	
	// if we get here, the user has no unread global announcements
	return false;
}

#
#-----[ FIND ]------------------------------------------
#
		// functions_display has already been called (user is on index) but there are no unreads

#
#-----[ AFTER, ADD ]------------------------------------------
#
		// let's check to see if any unread global announcements before concluding there are no unreads
		if (check_unread_global_announcements())
		{
			// user has at least one unread global announcement, so return true
			return true;
		}
		// user has no unreads and no unread global announcements, so return false

#
#-----[ FIND ]------------------------------------------
#
	// if we get here, we've been through all forums for this user and none have unread posts, so return false

#
#-----[ REPLACE WITH ]------------------------------------------
#
	// if we get here, we've been through all forums for this user and none have unread posts
	// let's check to see if any unread global announcements before concluding there are no unreads
	if (check_unread_global_announcements())
	{
		// user has at least one unread global announcement, so return true
		return true;
	}
	// user has no unreads and no unread global announcements, so return false

#
#-----[ FIND ]------------------------------------------
#
	// Only proceed if the post, topic and forum exist and the user is allowed to read it
	if (!$topic_id || !$forum_id || !$auth->acl_get('f_read', $forum_id))
	{
		trigger_error('NO_TOPIC');
	}

#
#-----[ REPLACE WITH ]------------------------------------------
#
	// Only proceed if the post and topic exist and the forum_id is 0 (global announcments) or the user is allowed to read it;
	// so, trigger an error if (a) topic does not exist or (b) forum_id is not 0 and user is not allowed to read it
	if (!$topic_id || ($forum_id && !$auth->acl_get('f_read', $forum_id)))
	{
		trigger_error('NO_TOPIC');
	}

#
#-----[ FIND ]------------------------------------------
#
	// now, tinker with the forums_track and topics_track tables in accorance with these rules:
	//
	//	-	calculate the forum_tracking_info time using the method that appears in display_forums();
	//
	//	-	if a post being marked unread has a post time less than the
	// 		forum_tracking_info, then add a new topics_track entry
	//		(with mark_time = forum_tracking_info before it gets changed)
	//		for each other topic in the forum that meets all of the following tests:
	//
	//			1. does not already have a topics_track entry for the user and
	//
	//			2. has a last post time less than or equal to the then current forum_tracking_info mark_time
	//
	//			3. has a last post time greater than the new $mark_time that will be used for the forums_track table
	//
	//	-	update or insert a forums_track mark_time to the time of the post minus 1
	//
	//	-	make sure that user's forums_track mark_time for forum 0 is the max of all
	//		mark_times for that user in the forums track table

	// first step, calculate the forum_tracking_info (most of the code is adapted from display_forums() in functions_display.php)

	$sql = 'SELECT mark_time
		FROM ' . FORUMS_TRACK_TABLE . '
		WHERE forum_id = ' . $forum_id . '
		AND user_id = ' . $user->data['user_id'];
	$result = $db->sql_query($sql);
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	$forum_tracking_info = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark'];

	// next, check to see if the post being marked unread has a post_time before $forum_tracking _info
	if ($post_time < $forum_tracking_info )
	{
		// ok, post being marked unread has post time before $forum_tracking_info, so we will
		// need to create special topics_track entries for all topics that
		// meet the three tests described in the comment that appears before the $sql definition above
		// (since these are the topics that are currently considered 'read' and would otherwise
		// no longer be considered read when we change the forums_track entry to an earlier mark_time
		// later in the script)

		// so, fetch the topic_ids for the topics in this forum that meet the three tests
		$sql = 'SELECT t.topic_id, t.topic_last_post_time, tt.mark_time
			FROM ' . TOPICS_TABLE . ' t
			LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (t.topic_id = tt.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
			WHERE tt.mark_time IS NULL
			AND t.forum_id = ' . $forum_id . '
			AND t.topic_last_post_time <= ' . $forum_tracking_info . '
			AND	t.topic_last_post_time > ' . $mark_time;

		$result = $db->sql_query($sql);
		while($row = $db->sql_fetchrow($result))
		{
			// for each of the topics meeting the three tests, create a topics_track entry
			$sql = 'INSERT INTO ' . TOPICS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', array(
				'user_id'	=> $user->data['user_id'],
				'topic_id'	=> $row['topic_id'],
				'forum_id'	=> $forum_id,
				'mark_time'	=> $forum_tracking_info,
			));
			$db->sql_query($sql);
		}
		$db->sql_freeresult($result);

		// finally, move the forums_track time back to $mark_time by inserting or updating the relevant row
		// to do that, find out if there already is an entry for this user_id and forum_id
		$sql = 'SELECT forum_id
			FROM ' . FORUMS_TRACK_TABLE . '
			WHERE forum_id = ' . $forum_id . '
				AND user_id = ' . $user->data['user_id'];
		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if (isset($row['forum_id']))
		{
			// in this case there is already an entry for this user and forum_id
			// in the forums_track table, so update the entry for the forum_id
			$sql = 'UPDATE ' . FORUMS_TRACK_TABLE . '
				SET mark_time = ' . $mark_time . '
				WHERE forum_id = ' . $forum_id . '
					AND user_id = ' . $user->data['user_id'];
			$db->sql_query($sql);
		}
		else
		{
			// in this case there is no entry for this user and forum_id
			// in the forums_track table, so insert one
			$sql = 'INSERT INTO ' . FORUMS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', array(
				'user_id'	=> $user->data['user_id'],
				'forum_id'	=> $forum_id,
				'mark_time'	=> $mark_time,
			));
			$db->sql_query($sql);
		}

		// find out if there already is an entry for this user_id and forum_id of 0
		$sql = 'SELECT forum_id
			FROM ' . FORUMS_TRACK_TABLE . '
			WHERE forum_id = 0
				AND user_id = ' . $user->data['user_id'];
		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if (isset($row['forum_id']))
		{
			// in this case there is already an entry for this user and forum_id of 0
			// in the forums_track table, so update the entry to whatever the max mark time
			// is for the user in the forum_tracks table
			$sql = 'SELECT mark_time
				FROM ' . FORUMS_TRACK_TABLE . '
				WHERE forum_id != 0
				AND user_id = ' . $user->data['user_id'] . '
				ORDER BY mark_time DESC';
			$result = $db->sql_query_limit($sql,1);
			$row = $db->sql_fetchrow($result);
			$db->sql_freeresult($result);

			$sql = 'UPDATE ' . FORUMS_TRACK_TABLE . '
				SET mark_time = ' . $row['mark_time'] . '
				WHERE forum_id = 0
					AND user_id = ' . $user->data['user_id'];
			$db->sql_query($sql);
		}
		else
		{
			// in this case there is no entry for this user and forum_id of 0
			// in the forums_track table, so insert one with the new $mark_time
			$sql = 'INSERT INTO ' . FORUMS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', array(
				'user_id'	=> $user->data['user_id'],
				'forum_id'	=> 0,
				'mark_time'	=> $mark_time,
			));
			$db->sql_query($sql);
		}
	}

	$meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
	meta_refresh(3, $meta_info);
	$message = $user->lang['POST_MARKED_UNREAD'] . '<br /><br />';
	$message .= sprintf($user->lang['RETURN_FORUM'], '<a href="' . $meta_info . '">', '</a>') . '<br /><br />';
	$message .= sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
	trigger_error($message);

#
#-----[ REPLACE WITH ]------------------------------------------
#
	// if $forum_id is not zero (so this is not a global announcement), continue with the code below that deals with
	// resettting the forums_track table and then gives user a screen allowing him to redirect to forum or index;
	// but if $forum_id is zero, this is a global announcement so skip the forums_track code and allow user only to
	// redirect to the index
	if ($forum_id)
	{
		// now, tinker with the forums_track and topics_track tables in accorance with these rules:
		//
		//	-	calculate the forum_tracking_info time using the method that appears in display_forums();
		//
		//	-	if a post being marked unread has a post time less than the
		// 		forum_tracking_info, then add a new topics_track entry
		//		(with mark_time = forum_tracking_info before it gets changed)
		//		for each other topic in the forum that meets all of the following tests:
		//
		//			1. does not already have a topics_track entry for the user and
		//
		//			2. has a last post time less than or equal to the then current forum_tracking_info mark_time
		//
		//			3. has a last post time greater than the new $mark_time that will be used for the forums_track table
		//
		//	-	update or insert a forums_track mark_time to the time of the post minus 1
		//
		//	-	make sure that user's forums_track mark_time for forum 0 is the max of all
		//		mark_times for that user in the forums track table

		// first step, calculate the forum_tracking_info (most of the code is adapted from display_forums() in functions_display.php)

		$sql = 'SELECT mark_time
			FROM ' . FORUMS_TRACK_TABLE . '
			WHERE forum_id = ' . $forum_id . '
			AND user_id = ' . $user->data['user_id'];
		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		$forum_tracking_info = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark'];

		// next, check to see if the post being marked unread has a post_time before $forum_tracking _info
		if ($post_time < $forum_tracking_info )
		{
			// ok, post being marked unread has post time before $forum_tracking_info, so we will
			// need to create special topics_track entries for all topics that
			// meet the three tests described in the comment that appears before the $sql definition above
			// (since these are the topics that are currently considered 'read' and would otherwise
			// no longer be considered read when we change the forums_track entry to an earlier mark_time
			// later in the script)

			// so, fetch the topic_ids for the topics in this forum that meet the three tests
			$sql = 'SELECT t.topic_id, t.topic_last_post_time, tt.mark_time
				FROM ' . TOPICS_TABLE . ' t
				LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (t.topic_id = tt.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
				WHERE tt.mark_time IS NULL
				AND t.forum_id = ' . $forum_id . '
				AND t.topic_last_post_time <= ' . $forum_tracking_info . '
				AND	t.topic_last_post_time > ' . $mark_time;

			$result = $db->sql_query($sql);
			while($row = $db->sql_fetchrow($result))
			{
				// for each of the topics meeting the three tests, create a topics_track entry
				$sql = 'INSERT INTO ' . TOPICS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', array(
					'user_id'	=> $user->data['user_id'],
					'topic_id'	=> $row['topic_id'],
					'forum_id'	=> $forum_id,
					'mark_time'	=> $forum_tracking_info,
				));
				$db->sql_query($sql);
			}
			$db->sql_freeresult($result);

			// finally, move the forums_track time back to $mark_time by inserting or updating the relevant row
			// to do that, find out if there already is an entry for this user_id and forum_id
			$sql = 'SELECT forum_id
				FROM ' . FORUMS_TRACK_TABLE . '
				WHERE forum_id = ' . $forum_id . '
					AND user_id = ' . $user->data['user_id'];
			$result = $db->sql_query($sql);
			$row = $db->sql_fetchrow($result);
			$db->sql_freeresult($result);

			if (isset($row['forum_id']))
			{
				// in this case there is already an entry for this user and forum_id
				// in the forums_track table, so update the entry for the forum_id
				$sql = 'UPDATE ' . FORUMS_TRACK_TABLE . '
					SET mark_time = ' . $mark_time . '
					WHERE forum_id = ' . $forum_id . '
						AND user_id = ' . $user->data['user_id'];
				$db->sql_query($sql);
			}
			else
			{
				// in this case there is no entry for this user and forum_id
				// in the forums_track table, so insert one
				$sql = 'INSERT INTO ' . FORUMS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', array(
					'user_id'	=> $user->data['user_id'],
					'forum_id'	=> $forum_id,
					'mark_time'	=> $mark_time,
				));
				$db->sql_query($sql);
			}

			// find out if there already is an entry for this user_id and forum_id of 0
			$sql = 'SELECT forum_id
				FROM ' . FORUMS_TRACK_TABLE . '
				WHERE forum_id = 0
					AND user_id = ' . $user->data['user_id'];
			$result = $db->sql_query($sql);
			$row = $db->sql_fetchrow($result);
			$db->sql_freeresult($result);

			if (isset($row['forum_id']))
			{
				// in this case there is already an entry for this user and forum_id of 0
				// in the forums_track table, so update the entry to whatever the max mark time
				// is for the user in the forum_tracks table
				$sql = 'SELECT mark_time
					FROM ' . FORUMS_TRACK_TABLE . '
					WHERE forum_id != 0
					AND user_id = ' . $user->data['user_id'] . '
					ORDER BY mark_time DESC';
				$result = $db->sql_query_limit($sql,1);
				$row = $db->sql_fetchrow($result);
				$db->sql_freeresult($result);

				$sql = 'UPDATE ' . FORUMS_TRACK_TABLE . '
					SET mark_time = ' . $row['mark_time'] . '
					WHERE forum_id = 0
						AND user_id = ' . $user->data['user_id'];
				$db->sql_query($sql);
			}
			else
			{
				// in this case there is no entry for this user and forum_id of 0
				// in the forums_track table, so insert one with the new $mark_time
				$sql = 'INSERT INTO ' . FORUMS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', array(
					'user_id'	=> $user->data['user_id'],
					'forum_id'	=> 0,
					'mark_time'	=> $mark_time,
				));
				$db->sql_query($sql);
			}
		}

		$meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
		meta_refresh(3, $meta_info);
		$message = $user->lang['POST_MARKED_UNREAD'] . '<br /><br />';
		$message .= sprintf($user->lang['RETURN_FORUM'], '<a href="' . $meta_info . '">', '</a>') . '<br /><br />';
		$message .= sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
		trigger_error($message);
	}

	// if we get here, $forum_id is 0 (global announcement), so redirect to index
	$meta_info = append_sid("{$phpbb_root_path}index.$phpEx", 'f=' . $forum_id);
	meta_refresh(3, $meta_info);
	$message = $user->lang['POST_MARKED_UNREAD'] . '<br /><br />';
	$message .= sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
	trigger_error($message);
Last edited by asinshesq on Thu Mar 13, 2008 9:24 pm, edited 2 times in total.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Thu Mar 13, 2008 9:08 pm

Tazmanian, please give the code in the preceding post a try. It seems to work, but you may need to clear things first by clicking the mark all posts read link that appears on the index. Then you can test and see if it seems to work in every case.

Thanks.

Bramster
Registered User
Posts: 605
Joined: Sun Jul 27, 2003 10:40 am

Re: View or mark unread posts

Post by Bramster » Sat Mar 15, 2008 11:22 am

The mod works only with tracking info in the database
(it is not set up to read tracking info stored in cookies).
For this reason, the mod hides its links from any user who
is a guest and also hides links at any time that the board
is not set to track unread info in the database.
Where in the ACP do I set to track using the databes ?

How many threads does the mod track, I assume there is a limit to it ?
Navy & Merchant Marine Forum:
www.DutchFleet.net

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sat Mar 15, 2008 1:15 pm

Bramster wrote:Where in the ACP do I set to track using the databes ?
acp --> general tab --> server configuration --> load settings --> Enable server-side topic marking:
Bramster wrote:How many threads does the mod track, I assume there is a limit to it ?
This mod doesn't track threads...regular phpbb3 does (this mod just allows the user to list the unread topics that phpbb3 is already tracking and allows the user to manually mark selected topics unread using phpbb3's marking system). I hadn't ever looked into the phpbb3 limit, but on a quick look at functions.php it seems like it limits cookies tracking unreads to 10,000 characters but doesn't appear to have a limit for unreads tracked by database. I may be wrong, however, since I just looked at that very quickly.

Bramster
Registered User
Posts: 605
Joined: Sun Jul 27, 2003 10:40 am

Re: View or mark unread posts

Post by Bramster » Mon Mar 17, 2008 6:22 am

Thanks I have installed the mod and it works like a charm. Today I am going to edite my other templates
Navy & Merchant Marine Forum:
www.DutchFleet.net

modbo
Registered User
Posts: 45
Joined: Wed Jan 12, 2005 10:26 am

Re: View or mark unread posts

Post by modbo » Mon Mar 17, 2008 9:50 am

I´ve added the link "mark forums read" also in search.php for newposts.
Think it`s helpfull.

Code: Select all

serach.php

#----- [FIND] -----
			case 'newposts':
				$l_search_title = $user->lang['SEARCH_NEW'];

#-----[AFTER ADD]-----
			case 'newposts':
				$l_search_title = $user->lang['SEARCH_NEW'];
                                 // start mod view or mark unread posts
                                 $sql = unread_list_sql($l_search_title, $show_results, $sort_key, $sort_dir, $sort_by_sql, $sql_sort, $limit_days, $sort_by_text, $sort_days, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param, $m_approve_fid_sql, $ex_fid_ary, $field);
                                 // end mod view or mark unread posts

v8power
Registered User
Posts: 8
Joined: Fri Feb 22, 2008 2:49 am

Re: View or mark unread posts

Post by v8power » Tue Mar 18, 2008 5:10 am

Alan,

I just had one of my members have an issue, not a problem, but something different:

It seems in 3.0.0 when the users pm box is full(100%), it says that you must remove messages to view a new message. That is displayed only in the "inbox" folder. When the users PM inbox was full and the user would click on the 'unread" messages and try and view the unread message, they would get a " no_auth_read_hold_message" message.

Is this a language/translation that was overlooked?

sovietpop
Registered User
Posts: 14
Joined: Fri Nov 16, 2007 5:15 pm

Re: View or mark unread posts

Post by sovietpop » Sat Mar 22, 2008 11:56 am

Just wanted to let you know, I finally got time to try installing it without the pm bits and its working a treat for me. In an earlier post you asked what it was that made this mod useful. A lot of people use my forum by using the read 'most recent post' button, so when they only had the option of a 'new post' button they were missing topics if they didn't manage to log in every day. Your modification makes so much more sense than the 'new post' button, I'm surprised it wasn't included in phpbb 3 as default.

There is just one thing, I've noticed that the 'subscribe to this topic' option no longer works - as this was the last mod I installed, I was wondering if this could have caused the problem. Has anyone else also had this problem? (I also installed a favicon, but I can't imagine that causing the isssue)

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sat Mar 22, 2008 5:37 pm

sovietpop wrote:There is just one thing, I've noticed that the 'subscribe to this topic' option no longer works - as this was the last mod I installed, I was wondering if this could have caused the problem. Has anyone else also had this problem? (I also installed a favicon, but I can't imagine that causing the isssue)
Seems to work on my test board. Exactly what doesn't work on yours? Do you see the 'subscribe topic' link? If you click and then go back to the same topic, does the text then say 'unsubscribe topic' (indicating it is properly tracking your preference)? Or is it just that it doesn't actually send emails the way it is supposed to when you subscribe?

If you subscribe, note that I think it only notifies you of the first post made since the last time you visited the topic so that once you get an email notification, you will not get another one until you visit the topic and then another post is subsequently made. (At least, that is how phpbb2 worked and I would guess phpbb3 is set up the same way to avoid the user being bombarded with multiple notifications for a single topic.)

sovietpop
Registered User
Posts: 14
Joined: Fri Nov 16, 2007 5:15 pm

Re: View or mark unread posts

Post by sovietpop » Sat Mar 22, 2008 10:10 pm

asinshesq wrote:Exactly what doesn't work on yours? Do you see the 'subscribe topic' link? If you click and then go back to the same topic, does the text then say 'unsubscribe topic' (indicating it is properly tracking your preference)?
yes it does

asinshesq wrote:Or is it just that it doesn't actually send emails the way it is supposed to when you subscribe?
It doesn't seem to send me emails at all. I've tested it a bit - subscribing to different topics and forums but never seem to get a notification.

Locked

Return to “[3.0.x] MOD Database Releases”