##############################################################
## MOD Title:		Cache
## MOD Author:		Ptirhiik < ptirhiik@clanmckeen.com > (Pierre) http://rpgnet.clanmckeen.com
## MOD Description:
##			This mod will cache some tables. Used in Categories hierarchy and Profile Control Panel
## MOD Version:		0.0.3
##
## Installation Level:	Easy
## Installation Time:	~20 Minutes
## Files To Edit:
##			viewtopic.php (not necessary with PCP)
##
##			admin/admin_forumauth.php
##			admin/admin_ranks.php
##			admin/admin_smilies.php
##			admin/admin_styles.php
##			admin/admin_ug_auth.php
##			admin/admin_users.php
##			admin/admin_words.php
##
##			includes/bbcode.php
##			includes/functions.php
##			includes/functions_admin.php
##			includes/functions_post.php
##			includes/usercp_register.php
##
## Included Files:
##			includes/def_birthday.php
##			includes/def_ranks.php
##			includes/def_smilies.php
##			includes/def_themes.php
##			includes/def_tree.php
##			includes/def_words.php
##
##			includes/functions_cache.php
##
##			includes/cache_tpls/def_birthday_def.tpl
##			includes/cache_tpls/def_ranks_def.tpl
##			includes/cache_tpls/def_smilies_def.tpl
##			includes/cache_tpls/def_themes_def.tpl
##			includes/cache_tpls/def_tree_def.tpl
##			includes/cache_tpls/def_words_def.tpl
##
##############################################################
## 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:
##
##	Files to CHMOD 666 :
##			includes/def_birthday.php
##			includes/def_ranks.php
##			includes/def_smilies.php
##			includes/def_themes.php
##			includes/def_tree.php
##			includes/def_words.php
##
## Reminder : clean index.php with categories hierarchy installed on the board stats
## Required categories hierarchy 2.0.5 and +
##
##############################################################
## MOD History:
##
##   2004-07-21 - Version 0.0.3
##      - some bugs updated and cache extension
##	- compliance PHP v5.x.x
##
##   2003-12-21 - Version 0.0.2
##      - first stand-alone publication
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------------
#
#		copy includes/*.* to includes/*.*
#
copy includes/def_birthday.php to includes/def_birthday.php
copy includes/def_ranks.php to includes/def_ranks.php
copy includes/def_smilies.php to includes/def_smilies.php
copy includes/def_themes.php to includes/def_themes.php
copy includes/def_tree.php to includes/def_tree.php
copy includes/def_words.php to includes/def_words.php
#
#-----[ COPY ]------------------------------------------------
#
copy includes/functions_cache.php to includes/functions_cache.php
#
#-----[ COPY ]------------------------------------------------
#
#		copy includes/cache_tpls/*.* to includes/cache_tpls/*.*
#
copy includes/cache_tpls/def_birthday_def.tpl to includes/cache_tpls/def_birthday_def.tpl
copy includes/cache_tpls/def_ranks_def.tpl to includes/cache_tpls/def_ranks_def.tpl
copy includes/cache_tpls/def_smilies_def.tpl to includes/cache_tpls/def_smilies_def.tpl
copy includes/cache_tpls/def_themes_def.tpl to includes/cache_tpls/def_themes_def.tpl
copy includes/cache_tpls/def_tree_def.tpl to includes/cache_tpls/def_tree_def.tpl
copy includes/cache_tpls/def_words_def.tpl to includes/cache_tpls/def_words_def.tpl
#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
$sql = "SELECT *
	FROM " . RANKS_TABLE . "
	ORDER BY rank_special, rank_min";
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
$ranks = array();
$ranksrow = array();
if ( defined('CACHE_RANKS') )
{
	@include( $phpbb_root_path . './includes/def_ranks.' . $phpEx );
	if ( empty($ranks) )
	{
		cache_ranks();
		include( $phpbb_root_path . './includes/def_ranks.' . $phpEx );
	}
	@reset($ranks);
	while ( list($rank_id, $rank_data) = @each($ranks) )
	{
		$ranksrow[] = $rank_data;
	}
}
if ( empty($ranks) && !defined('CACHE_RANKS') )
{
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
	$ranksrow[] = $row;
}
$db->sql_freeresult($result);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
}
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_forumauth.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
	$message = $lang['Forum_auth_updated']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	cache_tree(true);
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_ranks.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
		$message .= "<br /><br />" . sprintf($lang['Click_return_rankadmin']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
		cache_ranks();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
			$message = $lang['Rank_removed']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			cache_ranks();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_smilies.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
		$message = $lang['smiley_import_success']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
		cache_smilies();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
			$message = $lang['smiley_del_success']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			cache_smilies();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
			$message = $lang['smiley_edit_success']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			cache_smilies();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
			$message = $lang['smiley_add_success']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			cache_smilies();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_styles.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
			$message = $lang['Theme_installed']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			cache_themes();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
				$message = $lang['Theme_updated']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
				cache_themes();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
				$message = $lang['Theme_created']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
				cache_themes();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
			$message = $lang['Theme_info_saved']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			cache_themes();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
			$message = $lang['Style_removed']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			cache_themes();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_ug_auth.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
		$message = $lang['Auth_updated']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
		cache_tree(true);
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
		if ( $unset_mod != '' )
		{
			$sql = "UPDATE " . USERS_TABLE . " 
				SET user_level = " . USER . " 
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
		cache_tree(true);
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
			$message = $lang['User_deleted'] . '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . append_sid("admin_users.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			users_stats();
			cache_birthday();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
			$message .= '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . append_sid("admin_users.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			// the username may have changed
			users_stats();
			cache_birthday();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_words.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
		$message .= "<br /><br />" . sprintf($lang['Click_return_wordadmin']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
		cache_words();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full-line is longer
#
			$message = $lang['Word_removed']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			cache_words();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
	if (!isset($orig))
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	global $phpEx, $phpbb_root_path, $smilies, $board_config;

	if ( defined('CACHE_SMILIES') )
	{
		@include( $phpbb_root_path . './includes/def_smilies.' . $phpEx );
		if ( empty($smilies) )
		{
			cache_smilies();
			include( $phpbb_root_path . './includes/def_smilies.' . $phpEx );
		}
	}
	else
	{
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
		$smilies = $db->sql_fetchrowset($result);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
		}
	}
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
	}

	if (count($orig))
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- delete
//	}
//-- fin mod : cache -------------------------------------------------------------------------------

	if (count($orig))
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *
 ***************************************************************************/
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
include_once( $phpbb_root_path . './includes/functions_cache.' . $phpEx);
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
function get_db_stat($mode)
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	global $board_config;

	// first inits
	if ( !isset($board_config['max_users']) || !isset($board_config['record_last_user_id']) || !isset($board_config['record_last_username']) )
	{
		users_stats();
		cache_birthday();
	}
	if ( !isset($board_config['max_posts']) || !isset($board_config['max_topics']) )
	{
		board_stats();
	}
	switch ( $mode )
	{
		case 'usercount':
			return intval($board_config['max_users']);
			break;
		case 'newestuser':
			$row = array( 'user_id' => intval($board_config['record_last_user_id']), 'username' => $board_config['record_last_username']);
			return $row;
			break;
		case 'postcount':
			return intval($board_config['max_posts']);
			break;
		case 'topiccount':
			return intval($board_config['max_topics']);
			break;
	}
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
	$sql = "SELECT *
		FROM " . THEMES_TABLE . "
		WHERE themes_id = $style";
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	global $phpEx, $themes_style;

	if ( defined('CACHE_THEMES') )
	{
		@include( $phpbb_root_path . './includes/def_themes.' . $phpEx );
		if ( empty($themes_style) )
		{
			cache_themes();
			include( $phpbb_root_path . './includes/def_themes.' . $phpEx );
		}
	}
	if ( !empty($themes_style[$style]) )
	{
		$row = $themes_style[$style];
	}
	else
	{
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
		message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]");
	}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	}
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
function obtain_word_list(&$orig_word, &$replacement_word)
{
	global $db;
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	global $phpbb_root_path, $phpEx;

	// not processed yet
	if ( empty($orig_word) )
	{
		// take them from the cache
		if ( defined('CACHE_WORDS') )
		{
			@include($phpbb_root_path . './includes/def_words.' . $phpEx);
			if ( !isset($censored_words) )
			{
				$censored_words = array();
				cache_words();
				include($phpbb_root_path . './includes/def_words.' . $phpEx);
			}

			// convert
			$orig_word = array();
			$replacement_word = array();
			@reset($censored_words);
			while ( list($word_id, $row) = @each($censored_words) )
			{
				$orig_word[] = '#\b(' . str_replace('\*', '\w*?', phpbb_preg_quote($row['word'], '#')) . ')\b#i';
				$replacement_word[] = $row['replacement'];
			}
		}
		else
		{
			// get them from the database
			$sql = "SELECT * FROM  " . WORDS_TABLE;
			if ( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not get censored words from database', '', __LINE__, __FILE__, $sql);
			}
			// get the data
			$censored_words = array();
			while ( $row = $db->sql_fetchrow($result) )
			{
				$orig_word[] = '#\b(' . str_replace('\*', '\w*?', phpbb_preg_quote($row['word'], '#')) . ')\b#i';
				$replacement_word[] = $row['replacement'];
			}
		}
	}

	// end the function
	return true;
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions_admin.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
	return true;
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	global $board_config;
	board_stats();
	cache_tree(true);
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
	$message = $lang['Stored']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	board_stats();
	cache_tree(true);
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
	return;
}

//
// Delete a post/poll
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	board_stats();
	cache_tree(true);
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
	return;
}

//
// Handle user notification on new post
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	board_stats();
	cache_tree(true);
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
	$sql = "SELECT emoticon, code, smile_url   
		FROM " . SMILIES_TABLE . " 
		ORDER BY smilies_id";
	if ($result = $db->sql_query($sql))
	{
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
	if ( defined('CACHE_SMILIES') )
	{
		@include( $phpbb_root_path . './includes/def_smilies.' . $phpEx );
		if ( empty($smilies) )
		{
			cache_smilies();
			include( $phpbb_root_path . './includes/def_smilies.' . $phpEx );
		}
	}
	if ( empty($smilies) && !defined('CACHE_SMILIES') )
	{
		$smilies = array();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			while ( $row = $db->sql_fetchrow($result) )
			{
				$smilies[] = $row;
			}
		}
	}
	if ( !empty($smilies) )
	{
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
		$num_smilies = 0;
		$rowset = array();
		while ($row = $db->sql_fetchrow($result))
#
#-----[ REPLACE WITH ]---------------------------------------- 
#
		$num_smilies = 0;
		$rowset = array();
//-- mod : cache -----------------------------------------------------------------------------------
//-- delete
//		while ($row = $db->sql_fetchrow($result))
//-- add
		@reset($smilies);
		while ( list($row_id, $row) = @each($smilies) )
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
				$message = $lang['Profile_updated'] . '<br /><br />' . sprintf($lang['Click_return_index'],  '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			// the username may have changed
			users_stats();
			cache_birthday();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
			$message = $message . '<br /><br />' . sprintf($lang['Click_return_index']
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : cache -----------------------------------------------------------------------------------
//-- add
			users_stats();
			cache_birthday();
//-- fin mod : cache -------------------------------------------------------------------------------
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM