##############################################################
## MOD Title:		View or mark unread posts or pms
## MOD Author: asinshesq < N/A > (Alan) N/A
## MOD Description:	Toggles text of unread post link between 'View unread posts' and
##					'You have no unread posts' (depending on whether the user has unread posts).
##					Also adds a 'Mark post as unread' link at the bottom of each post and a mark
##					pm as unread link at the bottom of each private message as well as
##					a folder in the private messages part of the UCP for unread pms.
##
## MOD Version:		1.0.9
##
## Installation Level:	Easy
## Installation Time:	20 Minutes
##
## Files To Edit:	common.php
##					search.php
##					viewtopic.php
##					includes/constants.php
##					includes/functions.php
##					includes/functions_display.php
##					includes/functions_privmsgs.php
##					includes/ucp/ucp_pm.php
##					includes/ucp/ucp_pm_viewfolder.php
##					language/en/common.php
##					styles/prosilver/template/index_body.html
##					styles/prosilver/template/search_results.html
##					styles/prosilver/template/ucp_pm_viewmessage.html
##					styles/prosilver/template/viewtopic_body.html
##
## Included Files:	includes/functions_view_or_mark_unread_posts.php
##
## License:			http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:	I have included extensive author notes in a separate file called author_notes.txt
##					that appears in the contrib/readme_files folder.
##					Please read that because it gives lots of information about how to customize
##					this mod and answers lots of questions.
##############################################################
## MOD History:
##
##  2012-01-15 - Version 1.0.9
##			minor change required to install into phpbb 3.0.9 or above<
##
##  2010-11-26 - Version 1.0.8
##			minor changes required to install into phpbb 3.0.8
##
##  2009-12-19 - Version 1.0.7
##			corrected bugs in feature to use drop down to mark multiple pms read or unread
##
##  2009-10-14 - Version 1.0.6
##			changed mod to conform to changes introduced in phpbb 3.0.6
##
##			added 'Mark marked as read' and 'Mark marked unread' as options in the private message area dropdown menu
##
##  2008-12-29 - Version 1.0.5c
##			cleaned up the code in the mark_post_unread() function (should speed up the db queries)
##			and re-wrote the unread_tracking_info.txt file that appears in the readme folder
##			(if you already have 1.0.5 or 1.0.5a installed you just need to replace functions_view_or_mark_unread_posts.php
##			and re-do the changes to viewtopic that the install.xml file tells you to make)
##
##  2008-12-24 - Version 1.0.5b
##			revised code to deal with global announcements more dependibly
##			and revised various readme and notes files (if you already
##			have 1.0.5 or 1.0.5a installed you just need to replace functions_view_or_mark_unread_posts.php
##			and re-do the changes to viewtopic that the install.xml file tells you to make)
##
##  2008-12-10 - Version 1.0.5a
##			added changes to dovetail with phpbb3.0.3 changes
##
##			fixed bug that caused unreads to show up in unread box even if
##			user is over the pm limit and the unread pm should really
##			only appear in the hold box
##
##			fixed bug that prevented a forum from being shown as unread on
##			the index page if the only unread post in the forum is the 
##			latest post in the forum
##
##			fixed bug that sometimes caused the link not to toggle to
##			"View your unread posts" when the user is in viewforum for a 
##			category or forum that has subforums
##
##			added code to supress 'move to unreadbox' entry in pm dropdown menu
##
##			re-did code in functions_view_or_mark_unread_posts.php to properly
##			deal with unread global announcments (but note that this will take
##			an extra query so people with huge boards who want to save a query
##			should read the authors notes carefully)
##
##			Note: all changes from version 1.0.4 to 1.0.5a have been posted
##			on the phpbb.com topic for this mod on or before December 10, 2008.
##			If you have already made these changes you do not need to upgrade
##			your mod installation other than as set forth in the entry for
##			version 1.0.5b above, but for people who have not made these changes
##			I include an upgrade_1-0-4_to_1-0-5b mod in the contrib folder
##
##  2008-02-04 - Version 1.0.4
##			fixed bug that caused unreadbox to display instead of other mailboxes
##
##  2008-02-03 - Version 1.0.3
##			added an 'Unread messages' folder that appears right under the
##			'Sentmessages' folder in the private messages area of the UCP
##
##			because there is now a unread pm folder, got rid of code that
##			assigned a url to a link for viewing pms that could be added
##			in other parts of the forum
##
##			added link in search results that appears only when viewing
##			the unread post list and that allows user to mark all forums
##			read (thanks to moifest for the idea)
##
##			added code so that, when a user's browser navigates to the unread
##			post search list but the user is not logged in, the user gets
##			redirected to a login screen with a message saying the user
##			can only view the list of unread posts if he is logged in	 
##			(thanks to ChriZathens for the idea and some of the code) 
##
##			fixed bug that could lead to odd behavior when a user used
##			mark post unread feature in different forums
##
##  2008-01-27 - Version 1.0.2
##			added a line in functions_view_or_mark_unread_posts.php to update the unread pm count
##			immediately after a user marks a pm unread (rather than waiting for the regular updating
##			that phpbb3 would do later on)
##
##  2007-12-25 - Version 1.0.1
##			fixed bug that would, in determining whether the link should read 'view unread posts' or
##			'you have no unread posts', ignore unread posts in subforums
##
##			added feature to mark pms unread and to list all unread pms
##
##			made other small changes required for validation
##
##  2007-09-15 - Version 1.0.0
##			updated instructions to reflect the deletion of the bugfix change in version 0.0.4
##
##			converted mod script to modx, submitted mod to moddb for validation
##
##  2007-07-04 - Version 0.0.4
##			deleted a RC1 bugfix change that has now been fixed in RC2
##
##  2007-06-12 - Version 0.0.3
##			fixed small bug that would generate non-fatal php notices when using phpbb in debug mode
##
##  2007-06-04 - Version 0.0.2
##			fixed toggling of link text ('View unread posts' to 'You have no unread posts')
##
##  2007-05-31 - Version 0.0.1
##			initial version
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]------------------------------------------------
#
copy root/includes/functions_view_or_mark_unread_posts.php to includes/functions_view_or_mark_unread_posts.php

#
#-----[ OPEN ]------------------------------------------
#
common.php

#
#-----[ FIND ]------------------------------------------
#
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#
// start mod view or mark unread posts
require($phpbb_root_path . 'includes/functions_view_or_mark_unread_posts.' . $phpEx);
// end mod view or mark unread posts

#
#-----[ OPEN ]------------------------------------------
#
search.php

#
#-----[ FIND ]------------------------------------------
#
				$l_search_title = $user->lang['SEARCH_UNREAD'];

#
#-----[ BEFORE, ADD ]------------------------------------------
#
				// start mod view or mark unread posts
				$template->assign_vars(array(
					'U_MARK_FORUMS'				=> append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&amp;mark=forums'),
					'S_SHOW_MARK_FORUMS_LINK'	=> true));
				// end mod view or mark unread posts

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
$hilit_words	= request_var('hilit', '', true);

#
#-----[ AFTER, ADD ]------------------------------------------
#
// start mod view or mark unread posts
$unread_post_id	= request_var('mu', 0);
if ($unread_post_id)
{
	mark_unread_post($unread_post_id, $forum_id);
}
// end mod view or mark unread posts

#
#-----[ FIND ]------------------------------------------
# Note: actual line is longer
	'S_ENABLE_FEEDS_TOPIC'

#
#-----[ AFTER, ADD ]------------------------------------------
#
	// start mod view or mark unread posts - set flag that determines if user will see mark post unread links in the posts
	'S_INC_UNREAD_LINK'		=> ($config['load_db_lastread'] && $user->data['is_registered']) ? true : false,
	// end mod  view or mark unread posts

#
#-----[ FIND ]------------------------------------------
# Note: actual line is longer
		'U_DELETE'

#
#-----[ AFTER, ADD ]------------------------------------------
#
		// start mod view or mark unread posts
		'U_MARK_UNREAD'		=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'mu=' . $row['post_id'] . '&amp;f=' . $forum_id),
		// end mod  view or mark unread posts

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

#
#-----[ FIND ]------------------------------------------
#
// Private messaging - Do NOT change these values

#
#-----[ AFTER, ADD ]------------------------------------------
#
// start mod view or mark unread posts (and end mod too)...added the next line
define('PRIVMSGS_UNREADBOX', -5);

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

#
#-----[ FIND ]------------------------------------------
#
				 t.topic_last_post_time > $last_mark AND
				(
				(tt.mark_time IS NOT NULL AND t.topic_last_post_time > tt.mark_time) OR
				(tt.mark_time IS NULL AND ft.mark_time IS NOT NULL AND t.topic_last_post_time > ft.mark_time) OR
				(tt.mark_time IS NULL AND ft.mark_time IS NULL)
				)
				$sql_extra
				$sql_sort",
		);

#
#-----[ REPLACE WITH ]------------------------------------------
#
				(
				(tt.mark_time IS NOT NULL AND t.topic_last_post_time > tt.mark_time) OR
				(tt.mark_time IS NULL AND ft.mark_time IS NOT NULL AND t.topic_last_post_time > ft.mark_time) OR
				(tt.mark_time IS NULL AND ft.mark_time IS NULL AND t.topic_last_post_time > $last_mark)
				)
				$sql_extra
				$sql_sort",
		);
		// start mod view or mark unread posts (and end mod too)...reverted a 3.0.9 change to the WHERE clause above since that change is inconsistent with this mod

#
#-----[ FIND ]------------------------------------------
#
	// The following assigns all _common_ variables that may be used at any point in a template.

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	// start mod view or mark unread posts - set flag that toggles text for link to unreads (if user not logged in or board not using db for unreads, set to true so that text will always read view unreads
	$s_exists_unreads = check_unread_posts();
	// end mod view or mark unread posts

#
#-----[ FIND ]------------------------------------------
# Note: actual line is longer
		'U_SEARCH_UNREAD'

#
#-----[ BEFORE, ADD ]------------------------------------------
#
		// start mod view or mark unread posts
		'S_EXISTS_UNREADS'		=> $s_exists_unreads,
		// end mod view or mark unread posts

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

#
#-----[ FIND ]------------------------------------------
#
	foreach ($forum_rows as $row)

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	// start mod view or mark unread post
	// initialize the flag $exists_unread to signal that we have already checked unreads in functions_display()
	// so that when check_unread_posts() is called in the future it can skip the sql query and give the
	// answer that there are none (this gets reset to '1' later on in functions_display() if there are unreads),
	// but do NOT initialize if the user is on viewforum since the test for unreads may give false negatives in that context
	if (!$sql_where)
	{
		global $exists_unreads;
		$exists_unreads = -1;
	}
	// end mod view or mark unread posts

#
#-----[ FIND ]------------------------------------------
#
		// Which folder should we display?

#
#-----[ BEFORE, ADD ]------------------------------------------
#
		// start mod view or mark unread posts
		if ($forum_unread)
		{
			// if there are any unread topics, set $exists_unreads flag to 1 so that
			// when check_unreads_flag() is called in the future it can skip the sql query
			// and give the answer that there are unread posts'
			$exists_unreads = 1;
		}
		// end mod view or mark unread posts

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

#
#-----[ FIND ]------------------------------------------
#
	while ($row = $db->sql_fetchrow($result))
	{
		$num_messages[(int) $row['folder_id']] = $row['num_messages'];
		$num_unread[(int) $row['folder_id']] = $row['num_unread'];
	}

#
#-----[ REPLACE WITH ]------------------------------------------
#
	// start mod view or mark unread posts
	// edited the block below to keep track of $total_board_unreads
	$total_board_unreads = 0;
	while ($row = $db->sql_fetchrow($result))
	{
		$num_messages[(int) $row['folder_id']] = $row['num_messages'];
		$num_unread[(int) $row['folder_id']] = $row['num_unread'];
		$total_board_unreads += $row['num_unread'];
	}
	// end mod view or mark unread posts

#
#-----[ FIND ]------------------------------------------
#
	// Define Folder Array for template designers (and for making custom folders usable by the template too)
	foreach ($folder as $f_id => $folder_ary)
	{
		$folder_id_name = ($f_id == PRIVMSGS_INBOX) ? 'inbox' : (($f_id == PRIVMSGS_OUTBOX) ? 'outbox' : 'sentbox');

#
#-----[ REPLACE WITH ]------------------------------------------
#
	// start mod view or mark unread posts
	$folder[PRIVMSGS_UNREADBOX] = array(
		'folder_name'		=> $user->lang['UNREAD_MESSAGES'],
		'num_messages'		=> $total_board_unreads,
		'unread_messages'	=> $total_board_unreads
	);
	//end mod view or mark unread posts

	// Define Folder Array for template designers (and for making custom folders usable by the template too)
	foreach ($folder as $f_id => $folder_ary)
	{
		// start mod view or mark unread posts (and end mod too)...added reference to unreads in next line
		$folder_id_name = ($f_id == PRIVMSGS_INBOX) ? 'inbox' : (($f_id == PRIVMSGS_OUTBOX) ? 'outbox' : (($f_id == PRIVMSGS_UNREADBOX) ? 'unreadbox' : 'sentbox'));

#
#-----[ FIND ]------------------------------------------
#
	switch ($mark_action)

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	// start mod view or mark unread posts (and end mod too)...in next line,
	// we define a variable that will allow us to ignore $cur_folder_id constraint
	// in queries when we are talking about unreadbox (since that's not a real folder);
	// then, we use that variable rather than 'folder_id = $cur_folder_id' in the first three cases in the switch below.
	$cur_folder_sql = ($cur_folder_id != PRIVMSGS_UNREADBOX) ? "folder_id = $cur_folder_id AND" : '';

#
#-----[ FIND ]------------------------------------------
#
		case 'mark_important':

#
#-----[ BEFORE, ADD ]------------------------------------------
#
		// start mod view or mark unread posts
		case 'mark_marked_read':

			$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
				SET pm_unread = 0
				WHERE $cur_folder_sql
					user_id = $user_id
					AND " . $db->sql_in_set('msg_id', $msg_ids);
			$db->sql_query($sql);
			update_pm_counts();

		break;

		case 'mark_marked_unread':

			$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
				SET pm_unread = 1
				WHERE $cur_folder_sql
					user_id = $user_id
					AND " . $db->sql_in_set('msg_id', $msg_ids);
			$db->sql_query($sql);
			update_pm_counts();

		break;
		// end mod view or mark unread posts

#
#-----[ FIND ]------------------------------------------
#
				WHERE folder_id = $cur_folder_id
					AND user_id = $user_id

#
#-----[ REPLACE WITH ]------------------------------------------
#
				WHERE $cur_folder_sql
					user_id = $user_id

#
#-----[ FIND ]------------------------------------------
#
	$folder_id	= (int) $folder_id;

#
#-----[ AFTER, ADD ]------------------------------------------
#
	// start mod view or mark unread posts (and end mod too)...in next line,
	// we define a variable that will allow us to ignore $folder_id constraint
	// in queries when we are talking about unreadbox (since that's not a real folder);
	// then, we use that variable rather than 'folder_id = $folder_id' in several queries below.
	$folder_sql = ($folder_id != PRIVMSGS_UNREADBOX) ? "AND folder_id = $folder_id" : '';

#
#-----[ FIND ]------------------------------------------
#
			AND folder_id = $folder_id

#
#-----[ REPLACE WITH ]------------------------------------------
#
			$folder_sql

#
#-----[ FIND ]------------------------------------------
#
				AND folder_id = $folder_id

#
#-----[ REPLACE WITH ]------------------------------------------
#
				$folder_sql

#
#-----[ OPEN ]------------------------------------------
#
includes/ucp/ucp_pm.php

#
#-----[ FIND ]------------------------------------------
#
		if (!in_array($folder_specified, array('inbox', 'outbox', 'sentbox')))
		{
			$folder_specified = (int) $folder_specified;
		}
		else
		{
			$folder_specified = ($folder_specified == 'inbox') ? PRIVMSGS_INBOX : (($folder_specified == 'outbox') ? PRIVMSGS_OUTBOX : PRIVMSGS_SENTBOX);
		}

#
#-----[ REPLACE WITH ]------------------------------------------
#
		// start mod view or mark unread posts
		$msg_id = request_var('mu', 0);
		if ($msg_id)
		{
			mark_unread_pm($msg_id);
		}

		// the block below is in regular phpbb3 but I added refences to unreadbox
		if (!in_array($folder_specified, array('inbox', 'outbox', 'unreadbox', 'sentbox')))
		{
			$folder_specified = (int) $folder_specified;
		}
		else
		{
			$folder_specified = ($folder_specified == 'inbox') ? PRIVMSGS_INBOX : (($folder_specified == 'outbox') ? PRIVMSGS_OUTBOX : (($folder_specified == 'unreadbox') ? PRIVMSGS_UNREADBOX : PRIVMSGS_SENTBOX));
		}
		// end mod view or mark unread posts

#
#-----[ FIND ]------------------------------------------
#
				if (!in_array($mark_option, array('mark_important', 'delete_marked')) && $submit_mark)

#
#-----[ REPLACE WITH ]------------------------------------------
#
				// start mod view or mark unread posts (and end mod too)...added mark_marked_read and mark_marked_unread options to next line
				if (!in_array($mark_option, array('mark_important', 'mark_marked_read', 'mark_marked_unread', 'delete_marked')) && $submit_mark)

#
#-----[ FIND ]------------------------------------------
#
					$s_to_folder_options .= ($f_id != PRIVMSGS_OUTBOX && $f_id != PRIVMSGS_SENTBOX) ? $option : '';

#
#-----[ REPLACE WITH ]------------------------------------------
#
					// start mod view or mark unread posts (and end mod too)...added reference to unreadbox in next line to supress move to unread box entry in dropdown menu
					$s_to_folder_options .= ($f_id != PRIVMSGS_OUTBOX && $f_id != PRIVMSGS_SENTBOX && $f_id != PRIVMSGS_UNREADBOX) ? $option : '';

#
#-----[ FIND ]------------------------------------------
#
					'U_INBOX'				=> $this->u_action . '&amp;folder=inbox',

#
#-----[ AFTER, ADD ]------------------------------------------
#
					'U_MARK_UNREAD'			=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;f=' . $folder_id . '&amp;mu=' . $msg_id),
					// start mod view or mark unread posts (and end mod too)...added the preceding line about marking unread pms

#
#-----[ OPEN ]------------------------------------------
#
includes/ucp/ucp_pm_viewfolder.php

#
#-----[ FIND ]------------------------------------------
#
		$mark_options = array('mark_important', 'delete_marked');

#
#-----[ REPLACE WITH ]------------------------------------------
#
		// start mod view or mark unread posts (and end mod too)...added mark_marked_read and mark_marked_unread options to next line
		$mark_options = array('mark_important', 'mark_marked_read', 'mark_marked_unread', 'delete_marked');

#
#-----[ FIND ]------------------------------------------
#
				if ($f_id == PRIVMSGS_OUTBOX || $f_id == PRIVMSGS_SENTBOX || $f_id == $folder_id)

#
#-----[ REPLACE WITH ]------------------------------------------
#
				// start mod view or mark unread posts (and end mod too)...added refernce to unreadbox in next line to supress move to unread box entry in dropdown menu
				if ($f_id == PRIVMSGS_OUTBOX || $f_id == PRIVMSGS_SENTBOX || $f_id == $folder_id || $f_id == PRIVMSGS_UNREADBOX)

#
#-----[ FIND ]------------------------------------------
# Note: actual line is longer
				$view_message_url =

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$folder_id

#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
" . $row['folder_id'] . "

#
#-----[ AFTER, ADD ]------------------------------------------
#
				// start mod view or mark unread posts (and end mod too)...changed $folder_id to $row['folder_id']
				// since items in the 'unread box' actually come from different folders

#
#-----[ FIND ]------------------------------------------
#
	$folder_sql = 't.folder_id = ' . (int) $folder_id;

#
#-----[ REPLACE WITH ]------------------------------------------
#
	// start mod view or mark unread posts (and end mod too)...added test for unreads in next line
	$folder_sql = ($folder_id == PRIVMSGS_UNREADBOX) ? '((t.pm_new = 1 OR t.pm_unread = 1) AND t.folder_id != ' . PRIVMSGS_HOLD_BOX . ')' : 't.folder_id = ' . (int) $folder_id;

#
#-----[ OPEN ]------------------------------------------
#
language/en/common.php

#
#-----[ FIND ]------------------------------------------
#
	'datetime'			=> array(

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	// start mod view or mark unread posts
	'LOGIN_EXPLAIN_VIEWUNREADS'	=> 'You must be logged in to view your unread post list',
	'MARK_MARKED_READ'			=> 'Mark marked as read',
	'MARK_MARKED_UNREAD'		=> 'Mark marked as unread',
	'MARK_PM_UNREAD'			=> 'Mark pm as unread',
	'MARK_POST_UNREAD'			=> 'Mark post as unread',
	'NO_UNREADS'				=> 'You have no unread posts',
	'PM_MARKED_UNREAD'			=> 'Private message marked as unread',
	'POST_MARKED_UNREAD'		=> 'Post marked as unread',
	'RETURN_INBOX'				=> 'Return to pm inbox',
	'VIEW_UNREAD_PMS'			=> 'View unread pms',
	// end mod view or mark unread posts

#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/index_body.html

#
#-----[ FIND ]------------------------------------------
#
		<li><a href="{U_SEARCH_UNANSWERED}">

#
#-----[ IN-LINE FIND ]------------------------------------------
#
<a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a>

#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
<!-- IF S_EXISTS_UNREADS --><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ELSE --><a href="{U_SEARCH_UNREAD}">{L_NO_UNREADS}</a><!-- ENDIF -->

#
#-----[ AFTER, ADD ]------------------------------------------
#
		<!-- start mod view or mark unread posts (and end mod too) ... added code in preceding line to toggle link text between view unread and no unreads -->

#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/search_results.html

#
#-----[ FIND ]------------------------------------------
#
	<p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_RETURN_TO_SEARCH_ADV}</a></p>

#
#-----[ IN-LINE FIND ]------------------------------------------
#
</p>

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
<!-- IF S_SHOW_MARK_FORUMS_LINK --><br /><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_MARK_FORUMS}" title="{L_MARK_FORUMS_READ}">{L_MARK_FORUMS_READ}</a><!-- ENDIF -->

#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/ucp_pm_viewmessage.html

#
#-----[ FIND ]------------------------------------------
#
	<div class="back2top"><a href="#top" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>

#
#-----[ IN-LINE FIND ]------------------------------------------
#
{L_BACK_TO_TOP}</a>

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<a href="{U_MARK_UNREAD}" class="post" title="{L_MARK_PM_UNREAD}">{L_MARK_PM_UNREAD}</a>

#
#-----[ AFTER, ADD ]------------------------------------------
#
	<!-- start mod view or mark unread posts (and end mod too) ... added mark_pm_unread references in the preceding line -->

#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/viewtopic_body.html

#
#-----[ FIND ]------------------------------------------
#
		<div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>

#
#-----[ IN-LINE FIND ]------------------------------------------
#
{L_BACK_TO_TOP}</a>

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<!-- IF S_INC_UNREAD_LINK --><a href="{postrow.U_MARK_UNREAD}" class="post" title="{L_MARK_POST_UNREAD}">{L_MARK_POST_UNREAD}</a><!-- ENDIF -->

#
#-----[ AFTER, ADD ]------------------------------------------
#
		<!-- start mod view or mark unread posts (and end mod too) ... added preceding line -->

#
#-----[ DIY INSTRUCTIONS ]-------------------------------------------------
#
Go into the ACP styles section and click 'refresh' (and confirm) for
prosilver's templates.

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM