##############################################################
## MOD Title:		View or mark unread posts (upgrade from version 1.0.8 to 1.0.9)
## MOD Author: asinshesq < N/A > (Alan) N/A
## MOD Description:	Upgrades view or mark unread posts from version 1.0.8 to 1.0.9
##
## MOD Version:		1.0.9
##
## Installation Level:	Easy
## Installation Time:	5 Minutes
##
## Files To Edit:	N/A
##
## Included Files:	N/A
##
## 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:	Important: this is just an upgrade mod.  To use it, you must have
##					view or mark unread posts version 1.0.8 already installed.
##					If you haven't already installed any version of view or mark unread posts,
##					you should install the latest version of view or mark unread posts or pms
##					directly in the most recent version of phpbb and you should not use this upgrade mod at all.
##
##					Note: the changes from version 1.0.8 to 1.0.9 that appear below were posted in a faq for
##					this mod that I posted when phpbb3.0.9 came out.  If you have already made those changes you don't need to do anything more.
##
##############################################################
## MOD History: see mod history in the main install file
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ 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

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