############################################################## 
## MOD Title: Categories hierarchy - upgrade from 2.0.2 to 2.0.3 - special fix
## MOD Author: Ptirhiik < ptirhiik@clanmckeen.com > (Pierre) http://rpgnet.clanmckeen.com
## MOD Description:
##		This fix will get your old functions.php categories hierarchy functions to
##		the last level. It has to be used only if you have copy them from functions.php
##		to functions_categories_hierarchy.php, overwriting the file.
##
## MOD Version: 2.0.3
## 
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit:
##		includes/functions.php
##		includes/page_header.php
##		language/lang_english/lang_admin.php
##		language/lang_english/lang_main.php
##
## Included Files:
##		functions_categories_hierarchy.php
##		lang_extend_categories_hierarchy.php
##		mod-lang_settings/lang_extend_mac.php
##		mod-mods_settings/lang_extend_mods_settings.php
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
##
## Author Notes: 
##
##	This fix will get your old functions.php categories hierarchy functions to the last level. 
##	It has to be used only if you have copy them from functions.php to functions_categories_hierarchy.php, 
##	overwriting the file.
##
############################################################## 
## MOD History: 
## 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions_categories_hierarchy.php
#
#-----[ FIND ]------------------------------------------------
#
			if ( $sub && !$pull_down && (intval($board_config['sub_level_links']) > 0) && ((($real_level == 0) && ($sub_forum == 1)) || ($real_level == 1) || ($sub_forum == 2)) )
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
			if ( $sub && ( !$pull_down || ( ($type == POST_FORUM_URL) && ($sub_forum > 0) ) ) && (intval($board_config['sub_level_links']) > 0) )
#
#-----[ FIND ]------------------------------------------------
#
	//
	// Obtain list of moderators of each forum
	// First users, then groups ... broken into two queries
	//
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
	// extended auth compliancy
	$sql_extend_auth = '';
	if ( defined('EXTEND_AUTH_INSTALLED') )
	{
		$sql_extend_auth = ' AND aa.auth_type = ' . POST_FORUM_URL;
	}

#
#-----[ FIND ]------------------------------------------------
#
		GROUP BY u.user_id, u.username, aa.forum_id 
		ORDER BY aa.forum_id, u.user_id";
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
			$sql_extend_auth
#
#-----[ FIND ]------------------------------------------------
#
		GROUP BY g.group_id, g.group_name, aa.forum_id 
		ORDER BY aa.forum_id, g.group_id";
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
			$sql_extend_auth
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM