Author Notes

1..	The mark posts unread feature works only with tracking info in the database
	(it is not set up to work with tracking info stored in cookies).
	For this reason, the mod hides the mark post unread link from any user who
	is a guest and also hides that link at any time that the board
	is not set to track unread info in the database.

2.	This mod requires an extra cople of queries in order to toggle the link
	between "You have no unread posts" and "View unread posts" on pages other than index.php.
	These queries should be pretty fast (they only need to go through entries for each of the forums
	so that's just a handful).  However, if you have a big board and you are
	concerned about every additional query, and you don't care about whether that
	link toggles for unread posts on pages other than index.php (or if you are running
	prosilver which only shows the link on the index page anyway so that there is
	no reason to run that extra query), do this:

	OPEN
	includes/functions_view_or_mark_unread_posts.php

	FIND
	// user not on index so we need to check whether there are unreads

	BEFORE, ADD
	return true;

	If you make that change, the link on pages other than the index will
	no longer toggle and instead will always read "View unread posts".
	If you think that having the link text toggle on the index page
	but not others is confusing, you can disable link text toggling
	everywhere (including the index page) by doing this instead of
	the change I describe above:

	OPEN
	includes/functions_view_or_mark_unread_posts.php

	FIND
	global $db, $user, $auth, $exists_unreads;

	BEFORE, ADD
	return true;

3.	When a user marks a post unread, this mod inserts a row in the topics_track table
	for each already read topic in the relevant forum with a last_post_time after
	the post_time of the post being marked unread.  On a big board with a huge number
	of posts, it is conceivable that a lot of db storage could be used for this
	feature (e.g. if a lot of your users mark really old posts unread).  If you want to
	disable this feature, leave out the changes this mod makes to viewtopic.php and
	viewtopic_body.html and delete the mark_post_unread() function that appears in 
	functions_view_or_mark_unread_posts.php.  Alternatively, you could limit the feature
	to posts that are no more than a specified number of seconds old.  To do that, you
	would do the following (I've used one week, or 604800 seconds, as the age limit
	in this example but you can set the number at whatever age limit you want):
	
	OPEN
	viewtopic.php
	
	FIND (actual line is longer)
	'S_INC_UNREAD_LINK'		=> ($config['load_db_lastread'] && $user->data['is_registered']) ? true : false,

	REPLACE WITH (you can replace the 604800 with whatever age limit you want, expressed in seconds)
	'S_INC_UNREAD_LINK'		=> ($config['load_db_lastread'] && $user->data['is_registered'] && (time() - $row['post_time'] < 604800)) ? true : false,
	
4.	When the user clicks the view unread posts link, the resulting list
	of unread posts has the same look and feel as a regular list of search
	results, and that means that the orange icon to the left of the topic
	title is a link to the first unread post in the topic but the topic name
	itself is only a link to the beginning of the topic.  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:

	OPEN
	search.php

	FIND
	'U_VIEW_TOPIC'		=> $view_topic_url,

	REPLACE WITH
	'U_VIEW_TOPIC'		=> ($search_id == 'unread') ? $view_topic_url . '&amp;view=unread#unread' : $view_topic_url,

5.	Users may find it confusing to have phpbb3's regular 'View new posts' link next to the 
	'View unread posts' link, especially because the behavior of phpbb3's 'View new posts' link
	is sometimes counterintuitive.  If you want to get rid of the 'View new posts' link altogether,
	you can do this:

	OPEN
	styles/prosilver/template/index_body.html

	FIND (note: actual line is longer)
	<li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}

	IN-LINE FIND AND DELETE
	&bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a>

	OPEN
	styles/subsilver2/template/overall_header.html

	FIND (note: actual line is longer)
	<span style="float: {S_CONTENT_FLOW_END};">

	IN-LINE FIND AND DELETE
	<a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | 

6.	Many users have asked whether there is a way to show the number of unread posts
	right next to the unread post link.	My stock answer to that question
	is in my first post in the topic for this mod, which you can
	find here: http://www.phpbb.com/community/viewtopic.php?p=4455445#p4455445
	You will see in an edit to that post that I have in fact posted code for functions
	which will count the number of unread posts and the number of topics with unread
	posts...using one of those functions should make it pretty easy for you to add this
	feature if you want it (though I think it's really not that helpful for users).

7.	For a way to have this mod ignore unread posts from a specific forum,
	see http://www.phpbb.com/community/viewtopic.php?p=6191825#p6191825

8.	Note that the link to pms in the prosilver header says how many new pms the user has,
	and that is quite different from the number of unread pms the user has.  If you want
	that link to say how many unread pms the user has, you can do this:

	OPEN
	styles/prosilver/template/overall_header.html

	FIND
	<!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF --> &bull; 

	REPLACE WITH
	<!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}"><!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->{PRIVATE_MESSAGE_INFO_UNREAD}<!-- ELSE -->{L_NO_UNREAD_PM}<!-- ENDIF --></a>)<!-- ENDIF --> &bull;

	When you are done with that, go to the styles tab in the ACP and refresh the prosilver templates.

	If you don't like the text that appears when there are no unread pms you can do something like this:

	OPEN
	language/en/common.php

	FIND
		'NO_UNREAD_PM'				=> '<strong>0</strong> unread messages',

	REPLACE WITH
		'NO_UNREAD_PM'				=> 'you have no unread pms',

	And if you don't like the text that appears when there are unread pms, you can do something like this:

	OPEN
	language/en/common.php

	FIND
		'UNREAD_PM'				=> '<strong>%d</strong> unread message',
		'UNREAD_PMS'			=> '<strong>%d</strong> unread messages',

	REPLACE WITH
		'UNREAD_PM'				=> 'you have <strong>%d</strong> unread pms',
		'UNREAD_PMS'			=> 'you have <strong>%d</strong> unread pms',

9.	If you do not want the part of this mod that deals with unread private messages,
	see http://www.phpbb.com/community/viewtopic.php?p=4639565#p4639565

10.	For a german translation (courtesy of Tuxman), see http://www.phpbb.com/community/viewtopic.php?p=6255605#p6255605

11.	For a greek translation (courtesy of ChriZathens), see http://www.phpbb.com/community/viewtopic.php?p=10819145#p10819145

12.	To replace the textual link for marking posts unread (which appears in viewtopic)
	with a really nice image (again, courtesy of ChrisZathens - thanks!),
	see http://www.phpbb.com/community/viewtopic.php?p=10819145#p10819145

13.	For those who are technically inclined, I have written a technical description about how phpbb3 tracks unread posts
	and how this mod allows users to mark read posts as unread.  You can find that description in a file called
	technical_notes.txt that appears in the same readme_files folder in which you found these Author Notes.