##############################################################
## MOD Title: 		phpBB3 SEO No Duplicate MAJ 0.4.0 => 0.4.2
## MOD Author: 		dcz <n/a> http://www.phpbb-seo.com/
## MOD Description: 	Ceci est la procdure de mise  jour du MOD phpBB3 SEO No Duplicate pour la transition version 0.4.0 => 0.4.2.
## 			Rendez-vous sur http://www.phpbb-seo.com/forums/toolkit-phpbb3-seo/no-duplicate-phpbb3-seo-vt1506.html
## 			pour toujours obtenir la dernire version ou de l'aide pour ce MOD.
##
## MOD Version: 	1.0
##
## Installation Level: 	Easy
## Installation Time: 	2 Minutes
## Files To Edit: 	1
##			includes/functions_display.php
##
## Included Files:	0
##
##############################################################
## Author Notes:
## _____________
##
## Voici les instructions de mise  jour : phpBB3 SEO No Duplicate 0.4.0 => 0.4.2
##
##############################################################
## MOD History:
##
##	2008-04-21 - 1.0
##		- First version released
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


#
#-----[ OPEN ]------------------------------------------
#

includes/functions_display.php

#
#-----[ FIND ]------------------------------------------
#

	// www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
	if ($phpbb_seo->seo_opt['no_dupe']['on']) {
		$sql_array['SELECT'] .= ', t.topic_id, t.topic_title, t.topic_replies, t.topic_replies_real, t.topic_type';
		$sql_array['LEFT_JOIN'][] = array(
			'FROM'	=> array(TOPICS_TABLE => 't'),
			'ON'	=> "t.topic_last_post_id = f.forum_last_post_id" 
		);
	}
	// www.phpBB-SEO.com SEO TOOLKIT END -> no dupe

#
#-----[ REPLACE WITH ]------------------------------------------
#
	// www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
	if ($phpbb_seo->seo_opt['no_dupe']['on']) {
		$sql_array['SELECT'] .= ', t.topic_id, t.topic_title, t.topic_replies, t.topic_replies_real, t.topic_status, t.topic_type, t.topic_moved_id';
		$sql_array['LEFT_JOIN'][] = array(
			'FROM'	=> array(TOPICS_TABLE => 't'),
			'ON'	=> "t.topic_last_post_id = f.forum_last_post_id" 
		);
	}
	// www.phpBB-SEO.com SEO TOOLKIT END -> no dupe

#
#-----[ FIND ]------------------------------------------
#

		// www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
		if ($auth->acl_get('m_approve', $forum_id)) {
			$row['forum_topics'] = $row['forum_topics_real'];
			$replies = $row['topic_replies_real'];
		} else {
			$row['forum_topics'] = $row['forum_topics'];
			$replies = $row['topic_replies'];
		}
		if ( empty($phpbb_seo->seo_url['topic'][$row['topic_id']]) ) {
			$phpbb_seo->seo_url['topic'][$row['topic_id']] = $phpbb_seo->format_url($row['topic_title']);
		}
		$phpbb_seo->seo_opt['topic_forum_id'][$row['topic_id']] = $row['real_forum_id'];
		if (($replies + 1) > $phpbb_seo->seo_opt['topic_per_page']) {
			$phpbb_seo->seo_opt['topic_last_page'][$row['topic_id']] = floor($replies / $phpbb_seo->seo_opt['topic_per_page']) * $phpbb_seo->seo_opt['topic_per_page'];
		}
		// www.phpBB-SEO.com SEO TOOLKIT END -> no dupe

#
#-----[ REPLACE WITH ]------------------------------------------
#
		// www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
		if ($phpbb_seo->seo_opt['no_dupe']['on']) {
			if ($row['topic_status'] == ITEM_MOVED) {
				$row['topic_id'] = $row['topic_moved_id'];
			}
			if ( empty($phpbb_seo->seo_url['topic'][$row['topic_id']]) ) {
				if ($row['topic_type'] == POST_GLOBAL) {
					$phpbb_seo->seo_opt['topic_type'][$row['topic_id']] = POST_GLOBAL;
				}
				$phpbb_seo->seo_censored[$row['topic_id']] = censor_text($row['topic_title']);
				$phpbb_seo->seo_url['topic'][$row['topic_id']] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$row['topic_id']]);
				$phpbb_seo->seo_opt['topic_forum_name'][$row['topic_id']] = $row['forum_name']; 

			}
			if ($auth->acl_get('m_approve', $forum_id)) {
				$row['forum_topics'] = $row['forum_topics_real'];
				$replies = $row['topic_replies_real'];
			} else {
				$row['forum_topics'] = $row['forum_topics'];
				$replies = $row['topic_replies'];
			}
			if (($replies + 1) > $phpbb_seo->seo_opt['topic_per_page']) {
				$phpbb_seo->seo_opt['topic_last_page'][$row['topic_id']] = floor($replies / $phpbb_seo->seo_opt['topic_per_page']) * $phpbb_seo->seo_opt['topic_per_page'];
			}
		} else {
			$row['forum_topics'] = ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'];
		}
		// www.phpBB-SEO.com SEO TOOLKIT END -> no dupe
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
