############################################################## 
## MOD Title: Categories hierarchy - upgrade from 2.0.1 to 2.0.2
## MOD Author: Ptirhiik < ptirhiik@clanmckeen.com > (Pierre) http://rpgnet.clanmckeen.com
## MOD Description:
##		Upgrade for categories hierarchy from 2.0.1 to 2.0.2
##
## MOD Version: 2.0.2
## 
## Installation Level: (Easy/Moderate/Advanced)
## Installation Time: 3 Minutes
## Files To Edit:
##		includes/functions.php 
##		language/lang_english/lang_main.php 
##		templates/subSilver/index_box.tpl 
##
## Included Files: (n/a)
############################################################## 
## 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: 
## 
############################################################## 
## MOD History: 
## 
##   2003-09-24 - Version 2.0.2
##      - fix the missing categories name in admin drop down box,
##	- remove HTML in overviewed forum/cat descriptions,
##	- add cat desc overview on category heads,
##	- remove extra line between forum desc, moderators and links on index,
##	- add the $lang['Subforums'] entry to display in front of the mini links on index (default is blank)
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------------
#
function get_object_lang($cur, $field)
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
function get_object_lang($cur, $field, $all=false)
#
#-----[ FIND ]------------------------------------------------
#
		$res = ($tree['auth'][$cur]['auth_view']) ? $tree['data'][$this][$field] : '';
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
		$res = ($tree['auth'][$cur]['auth_view'] || $all) ? $tree['data'][$this][$field] : '';
#
#-----[ FIND ]------------------------------------------------
#
				LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = p.post_id AND t.forum_id = f.forum_id)
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
				LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_id = p.topic_id AND t.forum_id = f.forum_id)
#
#-----[ FIND ]------------------------------------------------
#
			$name = get_object_lang($keys['id'][$i], 'name');
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
			$name = get_object_lang($keys['id'][$i], 'name', $all);
#
#-----[ FIND ]------------------------------------------------
#
				'CAT_TITLE'			=> get_object_lang($cur, 'name'),
#
#-----[ AFTER, ADD ]------------------------------------------
#
				'CAT_DESC'			=> ereg_replace('<[^>]+>', '', get_object_lang($cur, 'desc')),
#
#-----[ FIND ]------------------------------------------------
#
			// moderators list
			$l_moderators	= '&nbsp;';
			$moderator_list = '&nbsp;';
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
			// moderators list
			$l_moderators	= '';
			$moderator_list = '';
#
#-----[ FIND ]------------------------------------------------
#
					$link = '';
#
#-----[ AFTER, ADD ]------------------------------------------
#
					$wdesc = ereg_replace('<[^>]+>', '', $wdesc);
#
#-----[ FIND ]------------------------------------------------
#
				'L_MODERATOR'			=> $l_moderators,
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
				'L_MODERATOR'			=> empty($moderator_list) ? '' : ( empty($l_moderators) ? '<br />' : '<br /><b>' . $l_moderators . ':</b>&nbsp;' ),
				'L_LINKS'				=> empty($links) ? '' : ( empty($lang['Subforums']) ? '<br />' : '<br /><b>' . $lang['Subforums'] . ':</b>&nbsp;' ),
				'LINKS'					=> $links,
#
#-----[ FIND ]------------------------------------------------
#
			}

			// add the links row
			if (!empty($links))
			{
				$template->assign_block_vars('catrow.forumrow.links', array(
					'L_LINKS'	=> (empty($moderator_list) ? '' : '<br />'),
					'LINKS'		=> $links,
					)
				);
			}
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
			}
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------
#
//-- fin mod : categories hierarchy ----------------------------------------------------------------
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
$lang['Subforums']					= ''; // 'Subforums';
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/index_box.tpl
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
<a href="{catrow.cathead.U_VIEWCAT}" class="cattitle">
#
#-----[ IN-LINE FIND ]---------------------------------------- 
#
class="cattitle"
#
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
#
 title="{catrow.cathead.CAT_DESC}"
#
#-----[ FIND ]------------------------------------------------
#
	<td class="row1" width="100%" height="50" colspan="{catrow.forumrow.INC_SPAN}">
		<span class="forumlink"><a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br /></span>
		<span class="genmed">{catrow.forumrow.FORUM_DESC}<br /></span>
		<span class="gensmall">
			{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}
			<!-- BEGIN links -->
			{catrow.forumrow.links.L_LINKS} {catrow.forumrow.links.LINKS}
			<!-- END links -->
		</span>
	</td>
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
	<td class="row1" width="100%" height="50" colspan="{catrow.forumrow.INC_SPAN}" valign="top">
		<span class="forumlink"><a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br /></span>
		<span class="genmed">{catrow.forumrow.FORUM_DESC}</span>
		<span class="gensmall">{catrow.forumrow.L_MODERATOR}{catrow.forumrow.MODERATORS}{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}</span>
	</td>
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM