############################################################## 
## MOD Title: phpBB 2.0.19 to phpBB 2.0.20 Code Changes
## MOD Author: Acyd Burn < N/A > (Meik Sievertsen) N/A 
## MOD Description: 
##		
##		
##		These are the Changes from phpBB 2.0.19 to phpBB 2.0.20 summed up into a little
##		Mod. This might be very helpful if you want to update your Board and have
##		installed a bunch of Mods. Then it's normally easier to apply the Code Changes
##		than to install all Mods again.
##		
##		When you find a 'AFTER, ADD'-Statement, the Code have to be added after the last
##		line quoted in the 'FIND'-Statement.
##		When you find a 'BEFORE, ADD'-Statement, the Code have to be added before the
##		first line quoted in the 'FIND'-Statement.
##		When you find a 'REPLACE WITH'-Statement, the Code quoted in the
##		'FIND'-Statement have to be replaced completely with the quoted Code in the
##		'REPLACE WITH'-Statement.
##		
##		When you find more than one 'FIND'-Statement it just means that you go down the
##		code within the order of the 'FIND'-Statements, if you found the lines for the
##		first 'FIND'-Statement, you continue to search the lines for the second
##		'FIND'-Statement. The last 'FIND'-Statement includes the codeblock to work
##		with.
##		
##		For a comprehensive explanation about installing MODs, please visit this url:
##		http://www.phpbb.com/kb/article.php?article_id=150
##		
##		After you have finished this tutorial, you have to upload the
##		install/update_to_latest.php file, execute it and then delete it from your
##		webspace.
##		
##		
##		
## MOD Version: 1.0.1 
## 
## Installation Level: Easy
## Installation Time: 45 Minutes 
## Files To Edit: 
##		admin/admin_board.php
##		admin/admin_db_utilities.php
##		admin/admin_forums.php
##		admin/admin_groups.php
##		admin/admin_ranks.php
##		admin/admin_smilies.php
##		admin/admin_users.php
##		admin/admin_words.php
##		admin/page_header_admin.php
##		admin/pagestart.php
##		common.php
##		db/mssql.php
##		includes/auth.php
##		includes/bbcode.php
##		includes/functions.php
##		includes/functions_post.php
##		includes/prune.php
##		includes/sessions.php
##		includes/usercp_avatar.php
##		includes/usercp_confirm.php
##		includes/usercp_register.php
##		index.php
##		language/lang_english/email/group_request.tpl
##		language/lang_english/email/user_activate_passwd.tpl
##		language/lang_english/lang_admin.php
##		language/lang_english/lang_main.php
##		login.php
##		memberlist.php
##		modcp.php
##		posting.php
##		privmsg.php
##		profile.php
##		search.php
##		templates/subSilver/admin/board_config_body.tpl
##		templates/subSilver/confirm_body.tpl
##
## Included Files: install/update_to_latest.php
##		templates/subSilver/admin/confirm_body.tpl
## 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: 
## 
##	
############################################################## 
## MOD History: 
## 
##   2006-04-08 - Version 1.0.1 
##      - fixed some missing instructions in privmsg.php
##
##   2006-04-05 - Version 1.0.0 
##      - first release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

#
#-----[ COPY ]------------------------------------------
#
copy templates/subSilver/admin/confirm_body.tpl to templates/subSilver/admin/confirm_body.tpl

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_board.php

#
#-----[ FIND ]---------------------------------------------
# Line 47
			$cookie_name = str_replace('.', '_', $new['cookie_name']);
		}


#
#-----[ REPLACE WITH ]---------------------------------------------
#
			$new['cookie_name'] = str_replace('.', '_', $new['cookie_name']);
		}

		// Attempt to prevent a common mistake with this value,
		// http:// is the protocol and not part of the server name
		if ($config_name == 'server_name')
		{
			$new['server_name'] = str_replace('http://', '', $new['server_name']);
		}


#
#-----[ FIND ]---------------------------------------------
# Line 196
	"L_DISABLED" => $lang['Disabled'], 
	"L_ABILITIES_SETTINGS" => $lang['Abilities_settings'],
	"L_MAX_POLL_OPTIONS" => $lang['Max_poll_options'],
	"L_FLOOD_INTERVAL" => $lang['Flood_Interval'],
	"L_FLOOD_INTERVAL_EXPLAIN" => $lang['Flood_Interval_explain'], 

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	"L_SEARCH_FLOOD_INTERVAL" => $lang['Search_Flood_Interval'],
	"L_SEARCH_FLOOD_INTERVAL_EXPLAIN" => $lang['Search_Flood_Interval_explain'], 

#
#-----[ FIND ]---------------------------------------------
# Line 283
	'AUTOLOGIN_TIME' => (int) $new['max_autologin_time'],
	"BOARD_EMAIL_FORM_ENABLE" => $board_email_form_yes, 
	"BOARD_EMAIL_FORM_DISABLE" => $board_email_form_no, 
	"MAX_POLL_OPTIONS" => $new['max_poll_options'], 
	"FLOOD_INTERVAL" => $new['flood_interval'],

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	"SEARCH_FLOOD_INTERVAL" => $new['search_flood_interval'],

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_db_utilities.php

#
#-----[ FIND ]---------------------------------------------
# Line 497
		unset($schema_vals);
		unset($schema_fields);
		unset($schema_insert);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		$schema_vals = '';
		$schema_fields = '';
		$schema_insert = '';

#
#-----[ FIND ]---------------------------------------------
# Line 514
				$strEmpty = "";
				$strVal = addslashes($strVal);
			}
			elseif (eregi("date|timestamp", $aryType[$i]))
			{

#
#-----[ FIND ]---------------------------------------------
# Line 519
				if ($empty($strVal))

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				if (empty($strVal))

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_forums.php

#
#-----[ FIND ]---------------------------------------------
# Line 37
	"auth_post" => AUTH_ALL, 
	"auth_reply" => AUTH_ALL, 

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	"auth_post" => AUTH_REG, 
	"auth_reply" => AUTH_REG, 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_groups.php

#
#-----[ FIND ]---------------------------------------------
# Line 102
	$sql = "SELECT user_id, username
		FROM " . USERS_TABLE . "
		WHERE user_id <> " . ANONYMOUS . "
		ORDER BY username";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not obtain user info for moderator list', '', __LINE__, __FILE__, $sql);
	}

	while ( $row = $db->sql_fetchrow($result) )
	{
		if ( $row['user_id'] == $group_info['group_moderator'] ) 
		{
			$group_moderator = $row['username'];
		}

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	if ($group_info['group_moderator'] != '')
	{
		$sql = "SELECT user_id, username
			FROM " . USERS_TABLE . "
			WHERE user_id = " . $group_info['group_moderator'];
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not obtain user info for moderator list', '', __LINE__, __FILE__, $sql);
		}

		if ( !($row = $db->sql_fetchrow($result)) )
		{
			message_die(GENERAL_ERROR, 'Could not obtain user info for moderator list', '', __LINE__, __FILE__, $sql);
		}

		$group_moderator = $row['username'];
	}
	else
	{
		$group_moderator = '';

#
#-----[ FIND ]---------------------------------------------
# Line 253
		$group_name = isset($HTTP_POST_VARS['group_name']) ? trim($HTTP_POST_VARS['group_name']) : '';

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		$group_name = isset($HTTP_POST_VARS['group_name']) ? htmlspecialchars(trim($HTTP_POST_VARS['group_name'])) : '';

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_ranks.php

#
#-----[ FIND ]---------------------------------------------
# Line 17
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/


#
#-----[ FIND ]---------------------------------------------
# Line 22
define('IN_PHPBB', 1);


#
#-----[ REPLACE WITH ]---------------------------------------------
# Just remove/delete the lines (replacing with an empty line)


#
#-----[ FIND ]---------------------------------------------
# Line 23
{
	$file = basename(__FILE__);
	$module['Users']['Ranks'] = $file;
	return;
}

#
#-----[ AFTER, ADD ]---------------------------------------------
#

define('IN_PHPBB', 1);

#
#-----[ FIND ]---------------------------------------------
# Line 35
	$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	$mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];

#
#-----[ FIND ]---------------------------------------------
# Line 57
	{
		$mode = "";
	}
}


#
#-----[ AFTER, ADD ]---------------------------------------------
#
// Restrict mode input to valid options
$mode = ( in_array($mode, array('add', 'edit', 'save', 'delete')) ) ? $mode : '';

#
#-----[ FIND ]---------------------------------------------
# Line 213
		}
		else
		{
			$rank_id = 0;
		}

#
#-----[ FIND ]---------------------------------------------
# Line 218
		
		if( $rank_id )

#
#-----[ REPLACE WITH ]---------------------------------------------
#

		$confirm = isset($HTTP_POST_VARS['confirm']);
		
		if( $rank_id && $confirm )

#
#-----[ FIND ]---------------------------------------------
# Line 240
		else
		{
			message_die(GENERAL_MESSAGE, $lang['Must_select_rank']);
		}
	}
	else
	{
		//
		// They didn't feel like giving us any information. Oh, too bad, we'll just display the
		// list then...
		//
		$template->set_filenames(array(
			"body" => "admin/ranks_list_body.tpl")
		);
		
		$sql = "SELECT * FROM " . RANKS_TABLE . "
			ORDER BY rank_min, rank_title";
		if( !$result = $db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql);
		}
		
		$rank_rows = $db->sql_fetchrowset($result);
		$rank_count = count($rank_rows);
		
		$template->assign_vars(array(
			"L_RANKS_TITLE" => $lang['Ranks_title'],
			"L_RANKS_TEXT" => $lang['Ranks_explain'],
			"L_RANK" => $lang['Rank_title'],
			"L_RANK_MINIMUM" => $lang['Rank_minimum'],
			"L_SPECIAL_RANK" => $lang['Special_rank'],
			"L_EDIT" => $lang['Edit'],
			"L_DELETE" => $lang['Delete'],
			"L_ADD_RANK" => $lang['Add_new_rank'],
			"L_ACTION" => $lang['Action'],
			
			"S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx"))
		);
		
		for( $i = 0; $i < $rank_count; $i++)
		{
			$rank = $rank_rows[$i]['rank_title'];
			$special_rank = $rank_rows[$i]['rank_special'];
			$rank_id = $rank_rows[$i]['rank_id'];
			$rank_min = $rank_rows[$i]['rank_min'];

			if($special_rank)
			{
				$rank_min = $rank_max = "-";
			}
			
			$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
			$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
	
			$template->assign_block_vars("ranks", array(
				"ROW_COLOR" => "#" . $row_color,
				"ROW_CLASS" => $row_class,
				"RANK" => $rank,
				"RANK_MIN" => $rank_min,

				"SPECIAL_RANK" => ( $special_rank == 1 ) ? $lang['Yes'] : $lang['No'],

				"U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&amp;id=$rank_id"),
				"U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&amp;id=$rank_id"))
			);
		}
	}
}
else
{
	//
	// Show the default page
	//
	$template->set_filenames(array(
		"body" => "admin/ranks_list_body.tpl")
	);
	
	$sql = "SELECT * FROM " . RANKS_TABLE . "
		ORDER BY rank_min ASC, rank_special ASC";
	if( !$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql);
	}
	$rank_count = $db->sql_numrows($result);

	$rank_rows = $db->sql_fetchrowset($result);
	
	$template->assign_vars(array(
		"L_RANKS_TITLE" => $lang['Ranks_title'],
		"L_RANKS_TEXT" => $lang['Ranks_explain'],
		"L_RANK" => $lang['Rank_title'],
		"L_RANK_MINIMUM" => $lang['Rank_minimum'],
		"L_SPECIAL_RANK" => $lang['Rank_special'],
		"L_EDIT" => $lang['Edit'],
		"L_DELETE" => $lang['Delete'],
		"L_ADD_RANK" => $lang['Add_new_rank'],
		"L_ACTION" => $lang['Action'],
		
		"S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx"))
	);
	
	for($i = 0; $i < $rank_count; $i++)
	{
		$rank = $rank_rows[$i]['rank_title'];
		$special_rank = $rank_rows[$i]['rank_special'];
		$rank_id = $rank_rows[$i]['rank_id'];
		$rank_min = $rank_rows[$i]['rank_min'];
		
		if( $special_rank == 1 )
		{
			$rank_min = $rank_max = "-";
		}

		$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
		$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

		$rank_is_special = ( $special_rank ) ? $lang['Yes'] : $lang['No'];
		
		$template->assign_block_vars("ranks", array(
			"ROW_COLOR" => "#" . $row_color,
			"ROW_CLASS" => $row_class,
			"RANK" => $rank,
			"SPECIAL_RANK" => $rank_is_special,
			"RANK_MIN" => $rank_min,

			"U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&amp;id=$rank_id"),
			"U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&amp;id=$rank_id"))
		);
	}

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		elseif( $rank_id && !$confirm)
		{
			// Present the confirmation screen to the user
			$template->set_filenames(array(
				'body' => 'admin/confirm_body.tpl')
			);

			$hidden_fields = '<input type="hidden" name="mode" value="delete" /><input type="hidden" name="id" value="' . $rank_id . '" />';

			$template->assign_vars(array(
				'MESSAGE_TITLE' => $lang['Confirm'],
				'MESSAGE_TEXT' => $lang['Confirm_delete_rank'],

				'L_YES' => $lang['Yes'],
				'L_NO' => $lang['No'],

				'S_CONFIRM_ACTION' => append_sid("admin_ranks.$phpEx"),
				'S_HIDDEN_FIELDS' => $hidden_fields)
			);
		}
		else
		{
			message_die(GENERAL_MESSAGE, $lang['Must_select_rank']);
		}
	}

	$template->pparse("body");

	include('./page_footer_admin.'.$phpEx);
}

//
// Show the default page
//
$template->set_filenames(array(
	"body" => "admin/ranks_list_body.tpl")
);

$sql = "SELECT * FROM " . RANKS_TABLE . "
	ORDER BY rank_min ASC, rank_special ASC";
if( !$result = $db->sql_query($sql) )
{
	message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql);
}
$rank_count = $db->sql_numrows($result);

$rank_rows = $db->sql_fetchrowset($result);

$template->assign_vars(array(
	"L_RANKS_TITLE" => $lang['Ranks_title'],
	"L_RANKS_TEXT" => $lang['Ranks_explain'],
	"L_RANK" => $lang['Rank_title'],
	"L_RANK_MINIMUM" => $lang['Rank_minimum'],
	"L_SPECIAL_RANK" => $lang['Rank_special'],
	"L_EDIT" => $lang['Edit'],
	"L_DELETE" => $lang['Delete'],
	"L_ADD_RANK" => $lang['Add_new_rank'],
	"L_ACTION" => $lang['Action'],
	
	"S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx"))
);

for($i = 0; $i < $rank_count; $i++)
{
	$rank = $rank_rows[$i]['rank_title'];
	$special_rank = $rank_rows[$i]['rank_special'];
	$rank_id = $rank_rows[$i]['rank_id'];
	$rank_min = $rank_rows[$i]['rank_min'];
	
	if( $special_rank == 1 )
	{
		$rank_min = $rank_max = "-";
	}

	$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
	$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

	$rank_is_special = ( $special_rank ) ? $lang['Yes'] : $lang['No'];
	
	$template->assign_block_vars("ranks", array(
		"ROW_COLOR" => "#" . $row_color,
		"ROW_CLASS" => $row_class,
		"RANK" => $rank,
		"SPECIAL_RANK" => $rank_is_special,
		"RANK_MIN" => $rank_min,

		"U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&amp;id=$rank_id"),
		"U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&amp;id=$rank_id"))
	);

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_smilies.php

#
#-----[ FIND ]---------------------------------------------
# Line 314
			$sql = "DELETE FROM " . SMILIES_TABLE . "
				WHERE smilies_id = " . $smiley_id;
			$result = $db->sql_query($sql);
			if( !$result )
			{
				message_die(GENERAL_ERROR, "Couldn't delete smiley", "", __LINE__, __FILE__, $sql);
			}

			$message = $lang['smiley_del_success'] . "<br /><br />" . sprintf($lang['Click_return_smileadmin'], "<a href=\"" . append_sid("admin_smilies.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			message_die(GENERAL_MESSAGE, $message);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			$confirm = isset($HTTP_POST_VARS['confirm']);

			if( $confirm )
			{
				$sql = "DELETE FROM " . SMILIES_TABLE . "
					WHERE smilies_id = " . $smiley_id;
				$result = $db->sql_query($sql);
				if( !$result )
				{
					message_die(GENERAL_ERROR, "Couldn't delete smiley", "", __LINE__, __FILE__, $sql);
				}

				$message = $lang['smiley_del_success'] . "<br /><br />" . sprintf($lang['Click_return_smileadmin'], "<a href=\"" . append_sid("admin_smilies.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

				message_die(GENERAL_MESSAGE, $message);
			}
			else
			{
				// Present the confirmation screen to the user
				$template->set_filenames(array(
					'body' => 'admin/confirm_body.tpl')
				);

				$hidden_fields = '<input type="hidden" name="mode" value="delete" /><input type="hidden" name="id" value="' . $smiley_id . '" />';

				$template->assign_vars(array(
					'MESSAGE_TITLE' => $lang['Confirm'],
					'MESSAGE_TEXT' => $lang['Confirm_delete_smiley'],

					'L_YES' => $lang['Yes'],
					'L_NO' => $lang['No'],

					'S_CONFIRM_ACTION' => append_sid("admin_smilies.$phpEx"),
					'S_HIDDEN_FIELDS' => $hidden_fields)
				);
				$template->pparse('body');
			}

#
#-----[ FIND ]---------------------------------------------
# Line 426
			$smile_code = ( isset($HTTP_POST_VARS['smile_code']) ) ? trim($HTTP_POST_VARS['smile_code']) : trim($HTTP_GET_VARS['smile_code']);
			$smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? trim($HTTP_POST_VARS['smile_url']) : trim($HTTP_GET_VARS['smile_url']);
			$smile_url = phpbb_ltrim(basename($smile_url), "'");
			$smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? trim($HTTP_POST_VARS['smile_emotion']) : trim($HTTP_GET_VARS['smile_emotion']);
			$smile_id = ( isset($HTTP_POST_VARS['smile_id']) ) ? intval($HTTP_POST_VARS['smile_id']) : intval($HTTP_GET_VARS['smile_id']);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			$smile_code = ( isset($HTTP_POST_VARS['smile_code']) ) ? trim($HTTP_POST_VARS['smile_code']) : '';
			$smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? trim($HTTP_POST_VARS['smile_url']) : '';
			$smile_url = phpbb_ltrim(basename($smile_url), "'");
			$smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? htmlspecialchars(trim($HTTP_POST_VARS['smile_emotion'])) : '';
			$smile_id = ( isset($HTTP_POST_VARS['smile_id']) ) ? intval($HTTP_POST_VARS['smile_id']) : 0;
			$smile_code = trim($smile_code);
			$smile_url = trim($smile_url);

#
#-----[ FIND ]---------------------------------------------
# Line 471
			$smile_code = ( isset($HTTP_POST_VARS['smile_code']) ) ? $HTTP_POST_VARS['smile_code'] : $HTTP_GET_VARS['smile_code'];
			$smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? $HTTP_POST_VARS['smile_url'] : $HTTP_GET_VARS['smile_url'];
			$smile_url = phpbb_ltrim(basename($smile_url), "'");
			$smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? $HTTP_POST_VARS['smile_emotion'] : $HTTP_GET_VARS['smile_emotion'];
			$smile_code = trim($smile_code);
			$smile_url = trim($smile_url);
			$smile_emotion = trim($smile_emotion);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			$smile_code = ( isset($HTTP_POST_VARS['smile_code']) ) ? $HTTP_POST_VARS['smile_code'] : '';
			$smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? $HTTP_POST_VARS['smile_url'] : '';
			$smile_url = phpbb_ltrim(basename($smile_url), "'");
			$smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? htmlspecialchars(trim($HTTP_POST_VARS['smile_emotion'])) : '';
			$smile_code = trim($smile_code);
			$smile_url = trim($smile_url);

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_users.php

#
#-----[ FIND ]---------------------------------------------
# Line 259
		$user_style = ( $HTTP_POST_VARS['style'] ) ? intval( $HTTP_POST_VARS['style'] ) : $board_config['default_style'];
		$user_lang = ( $HTTP_POST_VARS['language'] ) ? $HTTP_POST_VARS['language'] : $board_config['default_lang'];
		$user_timezone = ( isset( $HTTP_POST_VARS['timezone']) ) ? doubleval( $HTTP_POST_VARS['timezone'] ) : $board_config['board_timezone'];
		$user_template = ( $HTTP_POST_VARS['template'] ) ? $HTTP_POST_VARS['template'] : $board_config['board_template'];

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		$user_style = ( isset( $HTTP_POST_VARS['style'] ) ) ? intval( $HTTP_POST_VARS['style'] ) : $board_config['default_style'];
		$user_lang = ( $HTTP_POST_VARS['language'] ) ? $HTTP_POST_VARS['language'] : $board_config['default_lang'];
		$user_timezone = ( isset( $HTTP_POST_VARS['timezone']) ) ? doubleval( $HTTP_POST_VARS['timezone'] ) : $board_config['board_timezone'];

#
#-----[ FIND ]---------------------------------------------
# Line 693
				
				$message .= $lang['Admin_user_updated'];
			}
			else
			{
				$error = TRUE;
				$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Admin_user_fail'];

#
#-----[ REPLACE WITH ]---------------------------------------------
#

				// We remove all stored login keys since the password has been updated
				// and change the current one (if applicable)
				if ( !empty($passwd_sql) )
				{
					session_reset_keys($user_id, $user_ip);
				}
				
				$message .= $lang['Admin_user_updated'];
			}
			else
			{
				message_die(GENERAL_ERROR, 'Admin_user_fail', '', __LINE__, __FILE__, $sql);

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_words.php

#
#-----[ FIND ]---------------------------------------------
# Line 18
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/


#
#-----[ FIND ]---------------------------------------------
# Line 23
define('IN_PHPBB', 1);


#
#-----[ REPLACE WITH ]---------------------------------------------
# Just remove/delete the lines (replacing with an empty line)


#
#-----[ FIND ]---------------------------------------------
# Line 24
{
	$file = basename(__FILE__);
	$module['General']['Word_Censor'] = $file;
	return;
}

#
#-----[ AFTER, ADD ]---------------------------------------------
#

define('IN_PHPBB', 1);

#
#-----[ FIND ]---------------------------------------------
# Line 36
	$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	$mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];

#
#-----[ FIND ]---------------------------------------------
# Line 58
	{
		$mode = "";
	}
}


#
#-----[ AFTER, ADD ]---------------------------------------------
#
// Restrict mode input to valid options
$mode = ( in_array($mode, array('add', 'edit', 'save', 'delete')) ) ? $mode : '';


#
#-----[ FIND ]---------------------------------------------
# Line 71

		$template->set_filenames(array(
			"body" => "admin/words_edit_body.tpl")
		);


#
#-----[ AFTER, ADD ]---------------------------------------------
#
		$word_info = array('word' => '', 'replacement' => '');

#
#-----[ FIND ]---------------------------------------------
# Line 160
		else
		{
			$word_id = 0;
		}


#
#-----[ FIND ]---------------------------------------------
# Line 165
		if( $word_id )

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		$confirm = isset($HTTP_POST_VARS['confirm']);

		if( $word_id && $confirm )

#
#-----[ FIND ]---------------------------------------------
# Line 175
			}

			$message = $lang['Word_removed'] . "<br /><br />" . sprintf($lang['Click_return_wordadmin'], "<a href=\"" . append_sid("admin_words.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			message_die(GENERAL_MESSAGE, $message);

#
#-----[ AFTER, ADD ]---------------------------------------------
#
		}
		elseif( $word_id && !$confirm)
		{
			// Present the confirmation screen to the user
			$template->set_filenames(array(
				'body' => 'admin/confirm_body.tpl')
			);

			$hidden_fields = '<input type="hidden" name="mode" value="delete" /><input type="hidden" name="id" value="' . $word_id . '" />';

			$template->assign_vars(array(
				'MESSAGE_TITLE' => $lang['Confirm'],
				'MESSAGE_TEXT' => $lang['Confirm_delete_word'],

				'L_YES' => $lang['Yes'],
				'L_NO' => $lang['No'],

				'S_CONFIRM_ACTION' => append_sid("admin_words.$phpEx"),
				'S_HIDDEN_FIELDS' => $hidden_fields)
			);

#
#-----[ FIND ]---------------------------------------------
# Line 217
	{
		message_die(GENERAL_ERROR, "Could not query words table", $lang['Error'], __LINE__, __FILE__, $sql);
	}

	$word_rows = $db->sql_fetchrowset($result);

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	$db->sql_freeresult($result);

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/page_header_admin.php

#
#-----[ FIND ]---------------------------------------------
# Line 130
	'T_SPAN_CLASS1' => $theme['span_class1'],
	'T_SPAN_CLASS2' => $theme['span_class2'],
	'T_SPAN_CLASS3' => $theme['span_class3'])
);


#
#-----[ AFTER, ADD ]---------------------------------------------
#
// Work around for "current" Apache 2 + PHP module which seems to not
// cope with private cache control setting
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2'))
{
	header ('Cache-Control: no-cache, pre-check=0, post-check=0');
}
else
{
	header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header ('Expires: 0');
header ('Pragma: no-cache');

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/pagestart.php

#
#-----[ FIND ]---------------------------------------------
# Line 47
	message_die(GENERAL_MESSAGE, $lang['Not_admin']);
}

if ($HTTP_GET_VARS['sid'] != $userdata['session_id'])
{

#
#-----[ FIND ]---------------------------------------------
# Line 52
	$url = str_replace(preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])), '', $HTTP_SERVER_VARS['REQUEST_URI']);
	$url = str_replace(preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path'])), '', $url);
	$url = str_replace('//', '/', $url);
	$url = preg_replace('/sid=([^&]*)(&?)/i', '', $url);
	$url = preg_replace('/\?$/', '', $url);
	$url .= ((strpos($url, '?')) ? '&' : '?') . 'sid=' . $userdata['session_id'];


#
#-----[ REPLACE WITH ]---------------------------------------------
# Just remove/delete the lines (replacing with an empty line)


# 
#-----[ OPEN ]--------------------------------------------- 
# 
common.php

#
#-----[ FIND ]---------------------------------------------
# Line 168
$userdata = array();
$theme = array();
$images = array();
$lang = array();
$nav_links = array();

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$dss_seeded = false;

# 
#-----[ OPEN ]--------------------------------------------- 
# 
db/mssql.php

#
#-----[ FIND ]---------------------------------------------
# Line 287

			$row = @mssql_fetch_array($query_id);

			while( list($key, $value) = @each($row) )
			{

#
#-----[ FIND ]---------------------------------------------
# Line 292
				$row[$key] = stripslashes($value);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				$row[$key] = ($value === ' ') ? '' : stripslashes($value);

#
#-----[ FIND ]---------------------------------------------
# Line 315

			while( $row = @mssql_fetch_array($query_id))
			{
				while( list($key, $value) = @each($row) )
				{

#
#-----[ FIND ]---------------------------------------------
# Line 320
					$rowset[$i][$key] = stripslashes($value);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
					$rowset[$i][$key] = ($value === ' ') ? '' : stripslashes($value);

#
#-----[ FIND ]---------------------------------------------
# Line 354
					$result = stripslashes($this->row[$query_id][$field]);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
					$result = ($this->row[$query_id][$field] === ' ') ? '' : stripslashes($this->row[$query_id][$field]);

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/auth.php

#
#-----[ FIND ]---------------------------------------------
# Line 232
		{
			for($k = 0; $k < count($f_access); $k++)
			{
				$value = $f_access[$k][$key];
				$f_forum_id = $f_access[$k]['forum_id'];

#
#-----[ AFTER, ADD ]---------------------------------------------
#
				$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();

#
#-----[ FIND ]---------------------------------------------
# Line 281
	else
	{
		for($k = 0; $k < count($f_access); $k++)
		{
			$f_forum_id = $f_access[$k]['forum_id'];

#
#-----[ AFTER, ADD ]---------------------------------------------
#
			$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/bbcode.php

#
#-----[ FIND ]---------------------------------------------
# Line 194
	$patterns[] = "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i";
	$replacements[] = $bbcode_tpl['img'];

	// matches a [url]xxxx://www.phpbb.com[/url] code..
	$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url1'];

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	$patterns[] = "#\[img:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#i";
	$replacements[] = $bbcode_tpl['img'];

	// matches a [url]xxxx://www.phpbb.com[/url] code..
	$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url1'];

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";

#
#-----[ FIND ]---------------------------------------------
# Line 233

function make_bbcode_uid()
{
	// Unique ID for this message..


#
#-----[ FIND ]---------------------------------------------
# Line 238
	$uid = md5(mt_rand());

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	$uid = dss_rand();

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/functions.php

#
#-----[ FIND ]---------------------------------------------
# Line 137
	}

	return $str;
}


#
#-----[ AFTER, ADD ]---------------------------------------------
#
/**
* Our own generator of random values
* This uses a constantly changing value as the base for generating the values
* The board wide setting is updated once per page if this code is called
* With thanks to Anthrax101 for the inspiration on this one
* Added in phpBB 2.0.20
*/
function dss_rand()
{
	global $db, $board_config, $dss_seeded;

	$val = $board_config['rand_seed'] . microtime();
	$val = md5($val);
	$board_config['rand_seed'] = md5($board_config['rand_seed'] . $val . 'a');
   
	if($dss_seeded !== true)
	{
		$sql = "UPDATE " . CONFIG_TABLE . " SET
			config_value = '" . $board_config['rand_seed'] . "'
			WHERE config_name = 'rand_seed'";
		
		if( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, "Unable to reseed PRNG", "", __LINE__, __FILE__, $sql);
		}

		$dss_seeded = true;
	}

	return substr($val, 16);
}

#
#-----[ FIND ]---------------------------------------------
# Line 401
		message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]");

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		// We are trying to setup a style which does not exist in the database
		// Try to fallback to the board default (if the user had a custom style)
		// and then any users using this style to the default if it succeeds
		if ( $style != $board_config['default_style'])
		{
			$sql = 'SELECT *
				FROM ' . THEMES_TABLE . '
				WHERE themes_id = ' . $board_config['default_style'];
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(CRITICAL_ERROR, 'Could not query database for theme info');
			}

			if ( $row = $db->sql_fetchrow($result) )
			{
				$db->sql_freeresult($result);

				$sql = 'UPDATE ' . USERS_TABLE . '
					SET user_style = ' . $board_config['default_style'] . "
					WHERE user_style = $style";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(CRITICAL_ERROR, 'Could not update user theme info');
				}
			}
			else
			{
				message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]");
			}
		}
		else
		{
			message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]");
		}

#
#-----[ FIND ]---------------------------------------------
# Line 696
			$debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . basename($err_file);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			$debug_text .= '<br /><br />Line : ' . $err_line . '<br />File : ' . basename($err_file);

#
#-----[ FIND ]---------------------------------------------
# Line 723
		if ( empty($template) )
		{
			$template = new Template($phpbb_root_path . 'templates/' . $board_config['board_template']);
		}
		if ( empty($theme) )

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		if ( empty($template) || empty($theme) )

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/functions_post.php

#
#-----[ FIND ]---------------------------------------------
# Line 44
		$allowed_html_tags = split(',', $board_config['allow_html_tags']);

		$end_html = 0;
		$start_html = 1;
		$tmp_message = '';
		$message = ' ' . $message . ' ';

		while ($start_html = strpos($message, '<', $start_html))
		{
			$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, ($start_html - $end_html - 1)));

			if ($end_html = strpos($message, '>', $start_html))
			{
				$length = $end_html - $start_html + 1;
				$hold_string = substr($message, $start_html, $length);

				if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1)
				{
					$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));
					$hold_string = substr($hold_string, $unclosed_open - 1);
				}

				$tagallowed = false;
				for ($i = 0; $i < sizeof($allowed_html_tags); $i++)
				{
					$match_tag = trim($allowed_html_tags[$i]);
					if (preg_match('#^<\/?' . $match_tag . '[> ]#i', $hold_string))
					{
						$tagallowed = (preg_match('#^<\/?' . $match_tag . ' .*?(style[\t ]*?=|on[\w]+[\t ]*?=)#i', $hold_string)) ? false : true;
					}
				}

				$tmp_message .= ($length && !$tagallowed) ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;

				$start_html += $length;
			}
			else
			{
				$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message)));

				$start_html = strlen($message);
				$end_html = $start_html;
			}
		}

		if (!$end_html || ($end_html != strlen($message) && $tmp_message != ''))
		{
			$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1));
		}

		$message = ($tmp_message != '') ? trim($tmp_message) : trim($message);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		// If HTML is on, we try to make it safe
		// This approach is quite agressive and anything that does not look like a valid tag
		// is going to get converted to HTML entities
		$message = stripslashes($message);
		$html_match = '#<[^\w<]*(\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#';
		$matches = array();

		$message_split = preg_split($html_match, $message);
		preg_match_all($html_match, $message, $matches);

		$message = '';

		foreach ($message_split as $part)
		{
			$tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2]));
			$message .= htmlspecialchars($part) . clean_html($tag);
		}

		$message = addslashes($message);

#
#-----[ FIND ]---------------------------------------------
# Line 153
					$temp_option_text[$option_id] = htmlspecialchars($option_text);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
					$temp_option_text[intval($option_id)] = htmlspecialchars($option_text);

#
#-----[ FIND ]---------------------------------------------
# Line 816

		include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
	}
}


#
#-----[ AFTER, ADD ]---------------------------------------------
#
/**
* Called from within prepare_message to clean included HTML tags if HTML is
* turned on for that post
* @param array $tag Matching text from the message to parse
*/
function clean_html($tag)
{
	global $board_config;

	if (empty($tag[0]))
	{
		return '';
	}

	$allowed_html_tags = preg_split('/, */', strtolower($board_config['allow_html_tags']));
	$disallowed_attributes = '/^(?:style|on)/i';

	// Check if this is an end tag
	preg_match('/<[^\w\/]*\/[\W]*(\w+)/', $tag[0], $matches);
	if (sizeof($matches))
	{
		if (in_array(strtolower($matches[1]), $allowed_html_tags))
		{
			return  '</' . $matches[1] . '>';
		}
		else
		{
			return  htmlspecialchars('</' . $matches[1] . '>');
		}
	}

	// Check if this is an allowed tag
	if (in_array(strtolower($tag[1]), $allowed_html_tags))
	{
		$attributes = '';
		if (!empty($tag[2]))
		{
			preg_match_all('/[\W]*?(\w+)[\W]*?=[\W]*?(["\'])((?:(?!\2).)*)\2/', $tag[2], $test);
			for ($i = 0; $i < sizeof($test[0]); $i++)
			{
				if (preg_match($disallowed_attributes, $test[1][$i]))
				{
					continue;
				}
				$attributes .= ' ' . $test[1][$i] . '=' . $test[2][$i] . str_replace(array('[', ']'), array('&#91;', '&#93;'), htmlspecialchars($test[3][$i])) . $test[2][$i];
			}
		}
		if (in_array(strtolower($tag[1]), $allowed_html_tags))
		{
			return '<' . $tag[1] . $attributes . '>';
		}
		else
		{
			return htmlspecialchars('<' . $tag[1] . $attributes . '>');
		}
	}
	// Finally, this is not an allowed tag so strip all the attibutes and escape it
	else
	{
		return htmlspecialchars('<' .   $tag[1] . '>');
	}
}

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/prune.php

#
#-----[ FIND ]---------------------------------------------
# Line 29

function prune($forum_id, $prune_date, $prune_all = false)
{
	global $db, $lang;


#
#-----[ AFTER, ADD ]---------------------------------------------
#
	// Before pruning, lets try to clean up the invalid topic entries
	$sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . '
		WHERE topic_last_post_id = 0';
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not obtain lists of topics to sync', '', __LINE__, __FILE__, $sql);
	}

	while( $row = $db->sql_fetchrow($result) )
	{
		sync('topic', $row['topic_id']);
	}

	$db->sql_freeresult($result);


#
#-----[ FIND ]---------------------------------------------
# Line 52
			AND ( p.post_id = t.topic_last_post_id 
				OR t.topic_last_post_id = 0 )";

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			AND p.post_id = t.topic_last_post_id";

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/sessions.php

#
#-----[ FIND ]---------------------------------------------
# Line 175
		list($sec, $usec) = explode(' ', microtime());
		mt_srand((float) $sec + ((float) $usec * 100000));
		$session_id = md5(uniqid(mt_rand(), true));

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		$session_id = md5(dss_rand());

#
#-----[ FIND ]---------------------------------------------
# Line 208
			list($sec, $usec) = explode(' ', microtime());
			mt_srand(hexdec(substr($session_id, 0, 8)) + (float) $sec + ((float) $usec * 1000000));
			$auto_login_key = uniqid(mt_rand(), true);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			$auto_login_key = dss_rand() . dss_rand();

#
#-----[ FIND ]---------------------------------------------
# Line 488
			WHERE last_login < ' . (time() - (86400 * (int) $board_config['max_autologin_time']));
		$db->sql_query($sql);
	}

	return true;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
}

/**
* Reset all login keys for the specified user
* Called on password changes
*/
function session_reset_keys($user_id, $user_ip)
{
	global $db, $userdata;

	$key_sql = ($user_id == $userdata['user_id'] && !empty($userdata['session_key'])) ? "AND key_id != '" . md5($userdata['session_key']) . "'" : '';

	$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
		WHERE user_id = ' . (int) $user_id . "
			$key_sql";

	if ( !$db->sql_query($sql) )
	{
		message_die(CRITICAL_ERROR, 'Error removing auto-login keys', '', __LINE__, __FILE__, $sql);
	}

	$where_sql = 'session_user_id = ' . (int) $user_id;
	$where_sql .= ($user_id == $userdata['user_id']) ? " AND session_id <> '" . $userdata['session_id'] . "'" : '';
	$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
		WHERE $where_sql";
	if ( !$db->sql_query($sql) )
	{
		message_die(CRITICAL_ERROR, 'Error removing user session(s)', '', __LINE__, __FILE__, $sql);
	}

	if ( !empty($key_sql) )
	{
		$auto_login_key = dss_rand() . dss_rand();

		$current_time = time();
		
		$sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . "
			SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time
			WHERE key_id = '" . md5($userdata['session_key']) . "'";
		
		if ( !$db->sql_query($sql) )
		{
			message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql);
		}

		// And now rebuild the cookie
		$sessiondata['userid'] = $user_id;
		$sessiondata['autologinid'] = $autologin_id;
		$cookiename = $board_config['cookie_name'];
		$cookiepath = $board_config['cookie_path'];
		$cookiedomain = $board_config['cookie_domain'];
		$cookiesecure = $board_config['cookie_secure'];

		setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
		
		$userdata['session_key'] = $auto_login_key;
		unset($sessiondata);
		unset($auto_login_key);
	}

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/usercp_avatar.php

#
#-----[ FIND ]---------------------------------------------
# Line 97

	if ( !preg_match('#^(http)|(ftp):\/\/#i', $avatar_filename) )
	{
		$avatar_filename = 'http://' . $avatar_filename;
	}

#
#-----[ AFTER, ADD ]---------------------------------------------
#

	$avatar_filename = substr($avatar_filename, 0, 100);

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/usercp_confirm.php

#
#-----[ FIND ]---------------------------------------------
# Line 153
}
else
{
	$_png = define_raw_pngs();


#
#-----[ FIND ]---------------------------------------------
# Line 158
	$char = substr($code, -1);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	$c = intval($HTTP_GET_VARS['c']);
	$char = substr($code, $c - 1, 1);
	

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/usercp_register.php

#
#-----[ FIND ]---------------------------------------------
# Line 130
	$signature = str_replace('<br />', "\n", $signature);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	$signature = (isset($signature)) ? str_replace('<br />', "\n", $signature) : '';
	$signature_bbcode_uid = '';

#
#-----[ FIND ]---------------------------------------------
# Line 295
				message_die(GENERAL_ERROR, 'Could not obtain confirmation code', __LINE__, __FILE__, $sql);
			}

			if ($row = $db->sql_fetchrow($result))
			{

#
#-----[ FIND ]---------------------------------------------
# Line 300
				// Only compare one char if the zlib-extension is not loaded
				if (!@extension_loaded('zlib'))
				{
					$row['code'] = substr($row['code'], -1);
				}


#
#-----[ REPLACE WITH ]---------------------------------------------
# Just remove/delete the lines (replacing with an empty line)


#
#-----[ FIND ]---------------------------------------------
# Line 520
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
			}


#
#-----[ AFTER, ADD ]---------------------------------------------
#
			// We remove all stored login keys since the password has been updated
			// and change the current one (if applicable)
			if ( !empty($passwd_sql) )
			{
				session_reset_keys($user_id, $user_ip);
			}


#
#-----[ FIND ]---------------------------------------------
# Line 769
	//
	// If an error occured we need to stripslashes on returned data
	//
	$username = stripslashes($username);
	$email = stripslashes($email);

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	$cur_password = '';

#
#-----[ FIND ]---------------------------------------------
# Line 794
else if ( $mode == 'editprofile' && !isset($HTTP_POST_VARS['avatargallery']) && !isset($HTTP_POST_VARS['submitavatar']) && !isset($HTTP_POST_VARS['cancelavatar']) )
{
	$user_id = $userdata['user_id'];
	$username = $userdata['username'];
	$email = $userdata['user_email'];

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	$cur_password = '';

#
#-----[ FIND ]---------------------------------------------
# Line 986
		$confirm_chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',  'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',  'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9');

		list($usec, $sec) = explode(' ', microtime()); 
		mt_srand($sec * $usec); 

		$max_chars = count($confirm_chars) - 1;
		$code = '';
		for ($i = 0; $i < 6; $i++)
		{
			$code .= $confirm_chars[mt_rand(0, $max_chars)];
		}

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		// Generate the required confirmation code
		// NB 0 (zero) could get confused with O (the letter) so we make change it
		$code = dss_rand();
		$code = strtoupper(str_replace('0', 'o', substr($code, 6)));

#
#-----[ FIND ]---------------------------------------------
# Line 1017
		'USERNAME' => $username,
		'CUR_PASSWORD' => $cur_password,
		'NEW_PASSWORD' => $new_password,
		'PASSWORD_CONFIRM' => $password_confirm,
		'EMAIL' => $email,

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		'USERNAME' => isset($username) ? $username : '',
		'CUR_PASSWORD' => isset($cur_password) ? $cur_password : '',
		'NEW_PASSWORD' => isset($new_password) ? $new_password : '',
		'PASSWORD_CONFIRM' => isset($password_confirm) ? $password_confirm : '',
		'EMAIL' => isset($email) ? $email : '',

# 
#-----[ OPEN ]--------------------------------------------- 
# 
index.php

#
#-----[ FIND ]---------------------------------------------
# Line 117
while( $category_rows[] = $db->sql_fetchrow($result) );

#
#-----[ REPLACE WITH ]---------------------------------------------
#
while ($row = $db->sql_fetchrow($result))
{
	$category_rows[] = $row;
}

#
#-----[ FIND ]---------------------------------------------
# Line 301
	// Okay, let's build the index
	//
	for($i = 0; $i < $total_categories; $i++)
	{
		$cat_id = $category_rows[$i]['cat_id'];

		//
		// Should we display this category/forum set?
		//
		$display_forums = false;
		for($j = 0; $j < $total_forums; $j++)
		{
			if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $forum_data[$j]['cat_id'] == $cat_id )
			{
				$display_forums = true;
			}
		}

		//
		// Yes, we should, so first dump out the category
		// title, then, if appropriate the forum list
		//
		if ( $display_forums )

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	// Let's decide which categories we should display
	//
	$display_categories = array();

	for ($i = 0; $i < $total_forums; $i++ )
	{
		if ($is_auth_ary[$forum_data[$i]['forum_id']]['auth_view'])
		{
			$display_categories[$forum_data[$i]['cat_id']] = true;
		}
	}

	//
	// Okay, let's build the index
	//
	for($i = 0; $i < $total_categories; $i++)
	{
		$cat_id = $category_rows[$i]['cat_id'];

		//
		// Yes, we should, so first dump out the category
		// title, then, if appropriate the forum list
		//
		if (isset($display_categories[$cat_id]) && $display_categories[$cat_id])

# 
#-----[ OPEN ]--------------------------------------------- 
# 
language/lang_english/email/group_request.tpl

#
#-----[ FIND ]---------------------------------------------
# Line 1
A user has requested to join a group you moderator on {SITENAME}.

#
#-----[ REPLACE WITH ]---------------------------------------------
#
A user has requested to join a group you moderate on {SITENAME}.

# 
#-----[ OPEN ]--------------------------------------------- 
# 
language/lang_english/email/user_activate_passwd.tpl

#
#-----[ FIND ]---------------------------------------------
# Line 7
If sucessful you will be able to login using the following password:

#
#-----[ REPLACE WITH ]---------------------------------------------
#
If successful you will be able to login using the following password:

# 
#-----[ OPEN ]--------------------------------------------- 
# 
language/lang_english/lang_admin.php

#
#-----[ FIND ]---------------------------------------------
# Line 339
$lang['Allow_autologin'] = 'Allow automatic logins';
$lang['Allow_autologin_explain'] = 'Determines whether users are allowed to select to be automatically logged in when visiting the forum';
$lang['Autologin_time'] = 'Automatic login key expiry';
$lang['Autologin_time_explain'] = 'How long a autologin key is valid for in days if the user does not visit the board. Set to zero to disable expiry.';


#
#-----[ AFTER, ADD ]---------------------------------------------
#
// Search Flood Control - added 2.0.20
$lang['Search_Flood_Interval'] = 'Search Flood Interval';
$lang['Search_Flood_Interval_explain'] = 'Number of seconds a user must wait between search requests'; 


#
#-----[ FIND ]---------------------------------------------
# Line 427
$lang['smiley_edit_success'] = 'The Smiley was successfully updated';
$lang['smiley_import_success'] = 'The Smiley Pack was imported successfully!';
$lang['smiley_del_success'] = 'The Smiley was successfully removed';
$lang['Click_return_smileadmin'] = 'Click %sHere%s to return to Smiley Administration';


#
#-----[ AFTER, ADD ]---------------------------------------------
#
$lang['Confirm_delete_smiley'] = 'Are you sure you want to delete this Smiley?';

#
#-----[ FIND ]---------------------------------------------
# Line 520
$lang['Word_updated'] = 'The selected word censor has been successfully updated';
$lang['Word_added'] = 'The word censor has been successfully added';
$lang['Word_removed'] = 'The selected word censor has been successfully removed';

$lang['Click_return_wordadmin'] = 'Click %sHere%s to return to Word Censor Administration';

#
#-----[ AFTER, ADD ]---------------------------------------------
#

$lang['Confirm_delete_word'] = 'Are you sure you want to delete this word censor?';

#
#-----[ FIND ]---------------------------------------------
# Line 562
$lang['Rank_removed'] = 'The rank was successfully deleted';
$lang['No_update_ranks'] = 'The rank was successfully deleted. However, user accounts using this rank were not updated.  You will need to manually reset the rank on these accounts';

$lang['Click_return_rankadmin'] = 'Click %sHere%s to return to Rank Administration';


#
#-----[ AFTER, ADD ]---------------------------------------------
#
$lang['Confirm_delete_rank'] = 'Are you sure you want to delete this rank?';

# 
#-----[ OPEN ]--------------------------------------------- 
# 
language/lang_english/lang_main.php

#
#-----[ FIND ]---------------------------------------------
# Line 782
$lang['No_searchable_forums'] = 'You do not have permissions to search any forum on this site.';

$lang['No_search_match'] = 'No topics or posts met your search criteria';
$lang['Found_search_match'] = 'Search found %d match'; // eg. Search found 1 match
$lang['Found_search_matches'] = 'Search found %d matches'; // eg. Search found 24 matches

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$lang['Search_Flood_Error'] = 'You cannot make another search so soon after your last; please try again in a short while.';

# 
#-----[ OPEN ]--------------------------------------------- 
# 
login.php

#
#-----[ FIND ]---------------------------------------------
# Line 80
					$row['user_last_login_try'] >= (time() - ($board_config['login_reset_time'] * 60)) && $row['user_login_tries'] >= $board_config['max_login_attempts'])

#
#-----[ REPLACE WITH ]---------------------------------------------
#
					$row['user_last_login_try'] >= (time() - ($board_config['login_reset_time'] * 60)) && $row['user_login_tries'] >= $board_config['max_login_attempts'] && $userdata['user_level'] != ADMIN)

#
#-----[ FIND ]---------------------------------------------
# Line 105
					else
					{
						message_die(CRITICAL_ERROR, "Couldn't start session : login", "", __LINE__, __FILE__);
					}
				}

#
#-----[ FIND ]---------------------------------------------
# Line 110
				else

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				// Only store a failed login attempt for an active user - inactive users can't login even with a correct password
				elseif( $row['user_active'] )

# 
#-----[ OPEN ]--------------------------------------------- 
# 
memberlist.php

#
#-----[ FIND ]---------------------------------------------
# Line 226
		$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" border="0" /></a>';
		$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $username) . '" title="' . sprintf($lang['Search_user_posts'], $username) . '" border="0" /></a>';
		$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $username) . '</a>';

# 
#-----[ OPEN ]--------------------------------------------- 
# 
modcp.php

#
#-----[ FIND ]---------------------------------------------
# Line 228
		$page_title = $lang['Mod_CP'];
		include($phpbb_root_path . 'includes/page_header.'.$phpEx);

		if ( $confirm )
		{

#
#-----[ AFTER, ADD ]---------------------------------------------
#
  			if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
			{
				message_die(GENERAL_MESSAGE, $lang['None_selected']);
			}


#
#-----[ FIND ]---------------------------------------------
# Line 258
			while ($row = $db->sql_fetchrow($result))
			{
				$topic_id_sql .= (($topic_id_sql != '') ? ', ' : '') . intval($row['topic_id']);
			}
			$db->sql_freeresult($result);

#
#-----[ AFTER, ADD ]---------------------------------------------
#

			if ( $topic_id_sql == '')
			{
				message_die(GENERAL_MESSAGE, $lang['None_selected']);
			}

#
#-----[ FIND ]---------------------------------------------
# Line 744
			while ($row = $db->sql_fetchrow($result))
			{
				$post_id_sql .= (($post_id_sql != '') ? ', ' : '') . intval($row['post_id']);
			}
			$db->sql_freeresult($result);

#
#-----[ AFTER, ADD ]---------------------------------------------
#

			if ($post_id_sql == '')
			{
				message_die(GENERAL_MESSAGE, $lang['None_selected']);
			}

#
#-----[ FIND ]---------------------------------------------
# Line 1000
		$ip_this_post = ( $rdns_ip_num == $ip_this_post ) ? gethostbyaddr($ip_this_post) : $ip_this_post;

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		$ip_this_post = ( $rdns_ip_num == $ip_this_post ) ? htmlspecialchars(gethostbyaddr($ip_this_post)) : $ip_this_post;

#
#-----[ FIND ]---------------------------------------------
# Line 1046
				$ip = ( $rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? gethostbyaddr($ip) : $ip;

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				$ip = ( $rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? htmlspecialchars(gethostbyaddr($ip)) : $ip;

# 
#-----[ OPEN ]--------------------------------------------- 
# 
posting.php

#
#-----[ FIND ]---------------------------------------------
# Line 625
				$poll_options[$option_id] = htmlspecialchars(trim(stripslashes($option_text)));

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				$poll_options[intval($option_id)] = htmlspecialchars(trim(stripslashes($option_text)));

# 
#-----[ OPEN ]--------------------------------------------- 
# 
privmsg.php

#
#-----[ FIND ]---------------------------------------------
# Line 1185
		$privmsg_subject = trim(strip_tags($HTTP_POST_VARS['subject']));

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		$privmsg_subject = trim(htmlspecialchars($HTTP_POST_VARS['subject']));

#
#-----[ FIND ]---------------------------------------------
# Line 1307
			message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql);

#
#-----[ FIND ]---------------------------------------------
# Line 1372
		$privmsg_subject = ( isset($HTTP_POST_VARS['subject']) ) ? trim(strip_tags(stripslashes($HTTP_POST_VARS['subject']))) : '';

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		$privmsg_subject = ( isset($HTTP_POST_VARS['subject']) ) ? trim(htmlspecialchars(stripslashes($HTTP_POST_VARS['subject']))) : '';

#
#-----[ FIND ]---------------------------------------------
# Line 1507
				redirect(append_sid("privmsg.$phpEx?folder=$folder", true));
			}

			$privmsg_subject = ( ( !preg_match('/^Re:/', $privmsg['privmsgs_subject']) ) ? 'Re: ' : '' ) . $privmsg['privmsgs_subject'];

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				redirect(append_sid("privmsg.$phpEx?folder=$folder", true));
			}

			$orig_word = $replacement_word = array();
			obtain_word_list($orig_word, $replace_word);

			$privmsg_subject = ( ( !preg_match('/^Re:/', $privmsg['privmsgs_subject']) ) ? 'Re: ' : '' ) . $privmsg['privmsgs_subject'];
			$privmsg_subject = preg_replace($orig_word, $replacement_word, $privmsg_subject);

#
#-----[ FIND ]---------------------------------------------
# Line 1522
				$privmsg_bbcode_uid = $privmsg['privmsgs_bbcode_uid'];

				$privmsg_message = preg_replace("/\:(([a-z0-9]:)?)$privmsg_bbcode_uid/si", '', $privmsg_message);
				$privmsg_message = str_replace('<br />', "\n", $privmsg_message);
				$privmsg_message = preg_replace('#</textarea>#si', '&lt;/textarea&gt;', $privmsg_message);

#
#-----[ AFTER, ADD ]---------------------------------------------
#
				$privmsg_message = preg_replace($orig_word, $replacement_word, $privmsg_message);

#
#-----[ FIND ]---------------------------------------------
# Line 1743

	//
	// Send smilies to template
	//
	generate_smilies('inline', PAGE_PRIVMSGS);

#
#-----[ FIND ]---------------------------------------------
# Line 1748

	$privmsg_subject = preg_replace($html_entities_match, $html_entities_replace, $privmsg_subject);
	$privmsg_subject = str_replace('"', '&quot;', $privmsg_subject);

#
#-----[ REPLACE WITH ]---------------------------------------------
# Just remove/delete the lines (replacing with an empty line)


# 
#-----[ OPEN ]--------------------------------------------- 
# 
profile.php

#
#-----[ FIND ]---------------------------------------------
# Line 58
	$chars = array( 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'j', 'J',  'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T',  'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0');
	
	$max_chars = count($chars) - 1;
	srand( (double) microtime()*1000000);
	
	$rand_str = '';
	for($i = 0; $i < 8; $i++)
	{
		$rand_str = ( $i == 0 ) ? $chars[rand(0, $max_chars)] : $rand_str . $chars[rand(0, $max_chars)];
	}

	return ( $hash ) ? md5($rand_str) : $rand_str;

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	$rand_str = dss_rand();

	return ( $hash ) ? md5($rand_str) : substr($rand_str, 8);

# 
#-----[ OPEN ]--------------------------------------------- 
# 
search.php

#
#-----[ FIND ]---------------------------------------------
# Line 151
	$search_results = '';

	//
	// Search ID Limiter, decrease this value if you experience further timeout problems with searching forums
	$limiter = 5000;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	$current_time = time();

#
#-----[ FIND ]---------------------------------------------
# Line 158
	//
	// Cycle through options ...
	//
	if ( $search_id == 'newposts' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' )
	{

#
#-----[ AFTER, ADD ]---------------------------------------------
#
		//
		// Flood control
		//
		$where_sql = ($userdata['user_id'] == ANONYMOUS) ? "se.session_ip = '$user_ip'" : 'se.session_user_id = ' . $userdata['user_id'];
		$sql = 'SELECT MAX(sr.search_time) AS last_search_time
			FROM ' . SEARCH_TABLE . ' sr, ' . SESSIONS_TABLE . " se
			WHERE sr.session_id = se.session_id
				AND $where_sql";
		if ($result = $db->sql_query($sql))
		{
			if ($row = $db->sql_fetchrow($result))
			{
				if (intval($row['last_search_time']) > 0 && ($current_time - intval($row['last_search_time'])) < intval($board_config['search_flood_interval']))
				{
					message_die(GENERAL_MESSAGE, $lang['Search_Flood_Error']);
				}
			}
		}

#
#-----[ FIND ]---------------------------------------------
# Line 214
				if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
				{
					$search_author = '';
				}

				$search_author = str_replace('*', '%', trim($search_author));
				

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				$search_author = str_replace('*', '%', trim($search_author));

				if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) )
				{
					$search_author = '';
				}


#
#-----[ FIND ]---------------------------------------------
# Line 437
			if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
			{
				$search_author = '';
			}

			$search_author = str_replace('*', '%', trim(str_replace("\'", "''", $search_author)));

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			$search_author = str_replace('*', '%', trim($search_author));

			if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) )
			{
				$search_author = '';
			}

#
#-----[ FIND ]---------------------------------------------
# Line 646
		// Finish building query (for all combinations)
		// and run it ...
		//
		$sql = "SELECT session_id 
			FROM " . SESSIONS_TABLE;
		if ( $result = $db->sql_query($sql) )
		{
			$delete_search_ids = array();
			while( $row = $db->sql_fetchrow($result) )
			{
				$delete_search_ids[] = "'" . $row['session_id'] . "'";
			}

			if ( count($delete_search_ids) )
			{
				$sql = "DELETE FROM " . SEARCH_TABLE . " 
					WHERE session_id NOT IN (" . implode(", ", $delete_search_ids) . ")";
				if ( !$result = $db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, 'Could not delete old search id sessions', '', __LINE__, __FILE__, $sql);
				}
			}

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		// Delete old data from the search result table
		//
		$sql = 'DELETE FROM ' . SEARCH_TABLE . '
			WHERE search_time < ' . ($current_time - (int) $board_config['session_length']);
		if ( !$result = $db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not delete old search id sessions', '', __LINE__, __FILE__, $sql);

#
#-----[ FIND ]---------------------------------------------
# Line 693
			SET search_id = $search_id, search_array = '" . str_replace("\'", "''", $result_array) . "'
			WHERE session_id = '" . $userdata['session_id'] . "'";
		if ( !($result = $db->sql_query($sql)) || !$db->sql_affectedrows() )
		{
			$sql = "INSERT INTO " . SEARCH_TABLE . " (search_id, session_id, search_array) 
				VALUES($search_id, '" . $userdata['session_id'] . "', '" . str_replace("\'", "''", $result_array) . "')";

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			SET search_id = $search_id, search_time = $current_time, search_array = '" . str_replace("\'", "''", $result_array) . "'
			WHERE session_id = '" . $userdata['session_id'] . "'";
		if ( !($result = $db->sql_query($sql)) || !$db->sql_affectedrows() )
		{
			$sql = "INSERT INTO " . SEARCH_TABLE . " (search_id, session_id, search_time, search_array) 
				VALUES($search_id, '" . $userdata['session_id'] . "', $current_time, '" . str_replace("\'", "''", $result_array) . "')";

# 
#-----[ OPEN ]--------------------------------------------- 
# 
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]---------------------------------------------
# Line 52
		<td class="row2"><input type="radio" name="board_email_form" value="1" {BOARD_EMAIL_FORM_ENABLE} /> {L_ENABLED}&nbsp;&nbsp;<input type="radio" name="board_email_form" value="0" {BOARD_EMAIL_FORM_DISABLE} /> {L_DISABLED}</td>
	</tr>
	<tr>
		<td class="row1">{L_FLOOD_INTERVAL} <br /><span class="gensmall">{L_FLOOD_INTERVAL_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="flood_interval" value="{FLOOD_INTERVAL}" /></td>

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	</tr>
	<tr>
		<td class="row1">{L_SEARCH_FLOOD_INTERVAL} <br /><span class="gensmall">{L_SEARCH_FLOOD_INTERVAL_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="search_flood_interval" value="{SEARCH_FLOOD_INTERVAL}" /></td>

# 
#-----[ OPEN ]--------------------------------------------- 
# 
templates/subSilver/confirm_body.tpl

#
#-----[ FIND ]---------------------------------------------
# Line 5
		<th class="thHead" height="25" valign="middle"><span class="tableTitle">{MESSAGE_TITLE}</span></th>

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		<th class="thHead" height="25" valign="middle">{MESSAGE_TITLE}</th>

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