[教學] 有Mod的 2.0.10 直接update 到 2.0.14 的比對整理手稿

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
maxdc
星球普通子民
星球普通子民
文章: 13
註冊時間: 2005-03-28 17:53

[教學] 有Mod的 2.0.10 直接update 到 2.0.14 的比對整理手稿

文章 maxdc »

比對 source code 的差異!整理一了一份!
希望有須要的人能用得著!! ;-)

代碼: 選擇全部

##############################################################################
##									    ##
##		Uptede PHPBB 2.0.10 TO 2.0.14                               ##
##		Maxdc by 2005.05.04                                         ##
##		Email:SqlJava@Gmail.com                                     ##
##                                                                          ##
##                                                                          ##
##############################################################################
#Edition 34 files
#/common.php
#/groupcp.php
#/login.php
#/modcp.php
#/privmsg.php
#/profile.php
#/search.php
#/viewtopic.php
# 
#/admin
#  admin_board.php
#  admin_db_utilities.php
#  admin_styles.php
#  index.php
#  page_footer_admin.php
#  page_header_admin.php
# 
#
#/db
#  postgres7.php
# 
#
#/includes
#  constants.php
#  functions.php
#  functions_post.php
#  functions_search.php
#  page_header.php
#  page_tail.php
#  sessions.php
#  template.php
#  topic_review.php
#  usercp_avatar.php
#  usercp_register.php
#  usercp_sendpasswd.php
#  usercp_viewprofile.php
# 
#
#/language
#    ../lang_english
#    	 lang_admin.php
# 
#
#
#/templates
#    ../subSilver
#    	 login_body.tpl
#    	 overall_footer.tpl
#    	 simple_footer.tpl
# 
#    ../admin
#      	  board_config_body.tpl
#         index_body.tpl
#-----------------------------------------------------------
#copy 1 file
#
#copy include/usercp_confirm.php include/usercp_confirm.php
#copy install/update_to_latest.php install/update_to_latest.php
#-----------------------------------------------------------
#
#Execution http://IP/install/update_to_latest.php
#
#


#OPEN common.php
#
#Find

 *   $Id: common.php,v 1.74.2.13 2004/07/15 18:00:34 acydburn Exp $

#Replace

 *   $Id: common.php,v 1.74.2.17 2005/02/21 19:29:30 acydburn Exp $


#Find

//
function unset_vars(&$var)

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------

#Find

//
// addslashes to vars if magic_quotes_gpc is off

#Before add

------------------------phpbb 2.0.10 source code---------------------------- */
error_reporting  (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime

// The following code (unsetting globals) was contributed by Matt Kavanagh

// PHP5 with register_long_arrays off?
if (!isset($HTTP_POST_VARS) && isset($_POST))
{
	$HTTP_POST_VARS = $_POST;
	$HTTP_GET_VARS = $_GET;
	$HTTP_SERVER_VARS = $_SERVER;
	$HTTP_COOKIE_VARS = $_COOKIE;
	$HTTP_ENV_VARS = $_ENV;
	$HTTP_POST_FILES = $_FILES;

	// _SESSION is the only superglobal which is conditionally set
	if (isset($_SESSION))
	{
		$HTTP_SESSION_VARS = $_SESSION;
	}
}

if (@phpversion() < '4.0.0')
{
	// PHP3 path; in PHP3, globals are _always_ registered
	
	// We 'flip' the array of variables to test like this so that
	// we can validate later with isset($test[$var]) (no in_array())
	$test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL);

	// Loop through each input array
	@reset($test);
	while (list($input,) = @each($test))
	{
		while (list($var,) = @each($$input))
		{
			// Validate the variable to be unset
			if (!isset($test[$var]) && $var != 'test' && $var != 'input')
			{
				unset($$var);
			}
		}
	}
}
else if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
{
	// PHP4+ path
	$not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path');

	// Not only will array_merge give a warning if a parameter
	// is not an array, it will actually fail. So we check if
	// HTTP_SESSION_VARS has been initialised.
	if (!isset($HTTP_SESSION_VARS))
	{
		$HTTP_SESSION_VARS = array();
	}

	// Merge all into one extremely huge array; unset
	// this later
	$input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);

	unset($input['input']);
	unset($input['not_unset']);

	while (list($var,) = @each($input))
	{
		if (!in_array($var, $not_unset))
		{
			unset($$var);
		}
	}
   
	unset($input);
}

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );
$user_ip = encode_ip($client_ip);

#In-Line Find

 $REMOTE_ADDR

#Replace

 getenv('REMOTE_ADDR')

##################################################################################################---------

#OPEN login.php

#Find

 *   $Id: login.php,v 1.47.2.16 2004/07/17 13:48:32 acydburn Exp $

#Replace

 *   $Id: login.php,v 1.47.2.17 2004/11/18 17:49:35 acydburn Exp $


#Find

		$username = isset($HTTP_POST_VARS['username']) ? trim(htmlspecialchars($HTTP_POST_VARS['username'])) : '';
		$username = substr(str_replace("\\\'", "'", $username), 0, 25);
		$username = str_replace("'", "\\\'", $username);
		

Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		$username = isset($HTTP_POST_VARS['username']) ? trim(htmlspecialchars($HTTP_POST_VARS['username'])) : '';
		$username = substr(str_replace("\\\'", "'", $username), 0, 25);
		$username = str_replace("'", "\\\'", $username);
------------------------phpbb 2.0.10 source code---------------------------- */
		$username = isset($HTTP_POST_VARS['username']) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------



##################################################################################################---------

#OPEN groupcp.php

#Find

 *   $Id: groupcp.php,v 1.58.2.21 2004/07/11 22:18:27 acydburn Exp $

#Replace


 *   $Id: groupcp.php,v 1.58.2.22 2004/11/18 17:49:34 acydburn Exp $


#Find

				$username = ( isset($HTTP_POST_VARS['username']) ) ? htmlspecialchars($HTTP_POST_VARS['username']) : '';

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
				$username = ( isset($HTTP_POST_VARS['username']) ) ? htmlspecialchars($HTTP_POST_VARS['username']) : '';
------------------------phpbb 2.0.10 source code---------------------------- */
				$username = ( isset($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

##################################################################################################---------

#OPEN modcp.php

#Find

 *   $Id: modcp.php,v 1.71.2.24 2004/07/11 16:46:15 acydburn Exp $

#Replace

 *   $Id: modcp.php,v 1.71.2.25 2005/03/15 18:09:22 acydburn Exp $


#Find

		message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
	}
	$topic_row = $db->sql_fetchrow($result);

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

	if (!$topic_row)
	{
		message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
	}
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

		message_die(GENERAL_MESSAGE, 'Forum_not_exist');
	}
	$topic_row = $db->sql_fetchrow($result);

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

	if (!$topic_row)
	{
		message_die(GENERAL_MESSAGE, 'Forum_not_exist');
	}
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


##################################################################################################---------

#OPEN privmsgs.php

#Find

 *   $Id: privmsg.php,v 1.96.2.36 2004/07/11 16:46:16 acydburn Exp $

#Replace

 *   $Id: privmsg.php,v 1.96.2.38 2005/03/15 18:09:23 acydburn Exp $


#Find

	// If the board has HTML off but the post has HTML
	// on then we process it, else leave it alone
	//
	if ( !$board_config['allow_html'] )
	{
		if ( $user_sig != '')

#In-Line Find

	if ( !$board_config['allow_html'] )
	{
		if ( $user_sig != '')

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	if ( !$board_config['allow_html'] )
	{
		if ( $user_sig != '')
------------------------phpbb 2.0.10 source code---------------------------- */
	if ( !$board_config['allow_html'] || !$userdata['user_allowhtml'])
	{
		if ( $user_sig != '' && $privmsg['privmsgs_enable_sig'] && $userdata['user_allowhtml'] )
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

			$to_username = $HTTP_POST_VARS['username'];

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
			$to_username = $HTTP_POST_VARS['username'];
------------------------phpbb 2.0.10 source code---------------------------- */
			$to_username = phpbb_clean_username($HTTP_POST_VARS['username']);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

		$to_username = ( isset($HTTP_POST_VARS['username']) ) ? trim(strip_tags(stripslashes($HTTP_POST_VARS['username']))) : '';

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		$to_username = ( isset($HTTP_POST_VARS['username']) ) ? trim(strip_tags(stripslashes($HTTP_POST_VARS['username']))) : '';
------------------------phpbb 2.0.10 source code---------------------------- */
		$to_username = (isset($HTTP_POST_VARS['username']) ) ? trim(htmlspecialchars(stripslashes($HTTP_POST_VARS['username']))) : '';
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

		if ( !$html_on )
		{
			if ( $user_sig != '' || !$userdata['user_allowhtml'] )

#Relpace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		if ( !$html_on )
		{
			if ( $user_sig != '' || !$userdata['user_allowhtml'] )
------------------------phpbb 2.0.10 source code---------------------------- */
		if ( !$html_on || !$board_config['allow_html'] || !$userdata['user_allowhtml'] )
		{
			if ( $user_sig != '' )
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

		'USERNAME' => preg_replace($html_entities_match, $html_entities_replace, $to_username),

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		'USERNAME' => preg_replace($html_entities_match, $html_entities_replace, $to_username),
------------------------phpbb 2.0.10 source code---------------------------- */
		'USERNAME' => $to_username,
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


##################################################################################################---------

#OPEN profile.php

#Find

 *   $Id: profile.php,v 1.193.2.4 2004/07/11 16:46:17 acydburn Exp $

Replace

 *   $Id: profile.php,v 1.193.2.5 2004/11/18 17:49:37 acydburn Exp $


#Find

		include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
		exit;
	}
	else if ( $mode == 'confirm' )
	{
		// Visual Confirmation
		if ( $userdata['session_logged_in'] )
		{
			exit;
		}

		include($phpbb_root_path . 'includes/usercp_confirm.'.$phpEx);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


##################################################################################################---------

#OPEN search.php

#Find

 *   $Id: search.php,v 1.72.2.14 2004/07/17 13:48:32 acydburn Exp $

#Replace

 *   $Id: search.php,v 1.72.2.16 2005/03/15 18:34:34 acydburn Exp $


#Find

	$search_author = htmlspecialchars($search_author);

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	$search_author = htmlspecialchars($search_author);
------------------------phpbb 2.0.10 source code---------------------------- */
	$search_author = phpbb_clean_username($search_author);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

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

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
				if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
				{
					$search_author = '';
				}

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find
				switch ( $split_search[$i] )

#Before add


//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
				if (preg_match('#^[\*%]+$#', trim($split_search[$i])) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i]))))
				{
					$split_search[$i] = '';
					continue;
				}

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

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

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
			if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
			{
				$search_author = '';
			}

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


##################################################################################################---------

#OPEN viewtopic.php

#Find

 *   $Id: viewtopic.php,v 1.186.2.36 2004/07/11 16:46:18 acydburn Exp $

#Replace

 *   $Id: viewtopic.php,v 1.186.2.40 2005/03/15 18:09:23 acydburn Exp $

#Find

	$words = explode(' ', trim(htmlspecialchars(urldecode($HTTP_GET_VARS['highlight']))));

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	$words = explode(' ', trim(htmlspecialchars(urldecode($HTTP_GET_VARS['highlight']))));
------------------------phpbb 2.0.10 source code---------------------------- */
	$words = explode(' ', trim(htmlspecialchars($HTTP_GET_VARS['highlight'])));
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

	$highlight = urlencode($HTTP_GET_VARS['highlight']);

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
	$highlight_match = phpbb_rtrim($highlight_match, "\\\");
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

	if ( !$board_config['allow_html'] )
	{
		if ( $user_sig != '' && $userdata['user_allowhtml'] )

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	if ( !$board_config['allow_html'] )
	{
		if ( $user_sig != '' && $userdata['user_allowhtml'] )
------------------------phpbb 2.0.10 source code---------------------------- */
	if ( !$board_config['allow_html'] || !$userdata['user_allowhtml'])
	{
		if ( $user_sig != '' )
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

		$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace('#\b(" . $highlight_match . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\\\\1</b></span>', '\\\0')", '>' . $message . '<'), 1, -1));

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace('#\b(" . $highlight_match . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\\\\1</b></span>', '\\\0')", '>' . $message . '<'), 1, -1));
------------------------phpbb 2.0.10 source code---------------------------- */
		$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace('#\b(" . $highlight_match . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] ."\"><b>\\\\\\\1</b></span>', '\\\0')", '>' . $message . '<'), 1, -1));
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

			$user_sig = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\\0')", '>' . $user_sig . '<'), 1, -1));
		}

		$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\\0')", '>' . $message . '<'), 1, -1));


#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
			$user_sig = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\\0')", '>' . $user_sig . '<'), 1, -1));
		}

		$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\\0')", '>' . $message . '<'), 1, -1));
------------------------phpbb 2.0.10 source code---------------------------- */
			$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\\0')", '>' . $user_sig . '<'), 1, -1));
		}

		$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\\0')", '>' . $message . '<'), 1, -1));
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


##################################################################################################---------

#OPEN admin/admin_board.php

#Find

 *   $Id: admin_board.php,v 1.51.2.8 2004/07/15 18:02:44 acydburn Exp $

Replace

 *   $Id: admin_board.php,v 1.51.2.9 2004/11/18 17:49:33 acydburn Exp $


#Find

$board_email_form_yes = ( $new['board_email_form'] ) ? "checked=\"checked\"" : "";

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
$confirm_yes = ($new['enable_confirm']) ? 'checked="checked"' : '';
$confirm_no = (!$new['enable_confirm']) ? 'checked="checked"' : '';
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

	"L_ADMIN" => $lang['Acc_Admin'], 

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
	"L_VISUAL_CONFIRM" => $lang['Visual_confirm'], 
	"L_VISUAL_CONFIRM_EXPLAIN" => $lang['Visual_confirm_explain'], 
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

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

#Find

*     $Id: admin_db_utilities.php,v 1.42.2.10 2003/03/04 21:02:19 acydburn Exp $

#Replace

*     $Id: admin_db_utilities.php,v 1.42.2.11 2005/02/21 18:36:49 acydburn Exp $


#Find

			$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words');\r

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
			$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words');
------------------------phpbb 2.0.10 source code---------------------------- */
			$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words', 'confirm');
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


##################################################################################################---------

#OPEN admin/admin_styles.php

#Find

 *   $Id: admin_styles.php,v 1.27.2.13 2004/07/15 17:57:50 acydburn Exp $

#Replace

 *   $Id: admin_styles.php,v 1.27.2.14 2005/03/17 17:33:30 acydburn Exp $

#Find

			include($phpbb_root_path. "templates/" . $install_to . "/theme_info.cfg");

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
			include($phpbb_root_path. "templates/" . $install_to . "/theme_info.cfg");
------------------------phpbb 2.0.10 source code---------------------------- */
			include($phpbb_root_path. "templates/" . basename($install_to) . "/theme_info.cfg");
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

			$fp = @fopen($phpbb_root_path . 'templates/' . $template_name . '/theme_info.cfg', 'w');

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
			$fp = @fopen($phpbb_root_path . 'templates/' . $template_name . '/theme_info.cfg', 'w');
------------------------phpbb 2.0.10 source code---------------------------- */
			$fp = @fopen($phpbb_root_path . 'templates/' . basename($template_name) . '/theme_info.cfg', 'w');
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

##################################################################################################---------

#OPEN admin/index.php

#Find

 *   $Id: index.php,v 1.40.2.6 2004/07/11 16:46:15 acydburn Exp $

#Replace

 *   $Id: index.php,v 1.40.2.7 2005/02/21 18:37:02 acydburn Exp $


#Find

	$template->pparse("body");

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

}
else


#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

	// Check for new version
	$current_version = explode('.', '2' . $board_config['version']);
	$minor_revision = (int) $current_version[2];

	$errno = 0;
	$errstr = $version_info = '';

	if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr))
	{
		@fputs($fsock, "GET /updatecheck/20x.txt HTTP/1.1
");
		@fputs($fsock, "HOST: http://www.phpbb.com
");
		@fputs($fsock, "Connection: close

");

		$get_info = false;
		while (!@feof($fsock))
		{
			if ($get_info)
			{
				$version_info .= @fread($fsock, 1024);
			}
			else
			{
				if (@fgets($fsock, 1024) == "
")
				{
					$get_info = true;
				}
			}
		}
		@fclose($fsock);

		$version_info = explode("
", $version_info);
		$latest_head_revision = (int) $version_info[0];
		$latest_minor_revision = (int) $version_info[2];
		$latest_version = (int) $version_info[0] . '.' . (int) $version_info[1] . '.' . (int) $version_info[2];

		if ($latest_head_revision == 2 && $minor_revision == $latest_minor_revision)
		{
			$version_info = '<p style="color:green">' . $lang['Version_up_to_date'] . '</p>';
		}
		else
		{
			$version_info = '<p style="color:red">' . $lang['Version_not_up_to_date'];
			$version_info .= '<br />' . sprintf($lang['Latest_version_info'], $latest_version) . sprintf($lang['Current_version_info'], '2' . $board_config['version']) . '</p>';
		}
	}
	else
	{
		if ($errstr)
		{
			$version_info = '<p style="color:red">' . sprintf($lang['Connect_socket_error'], $errstr) . '</p>';
		}
		else
		{
			$version_info = '<p>' . $lang['Socket_functions_disabled'] . '</p>';
		}
	}
	
	$version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>';
	

	$template->assign_vars(array(
		'VERSION_INFO'	=> $version_info,
		'L_VERSION_INFORMATION'	=> $lang['Version_information'])
	);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


##################################################################################################---------

#OPEN admin/page_footer_admin.php

#Find

 *   $Id: page_footer_admin.php,v 1.9.2.2 2002/05/12 15:57:45 psotfx Exp $

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
//*----------------------phpbb 2.0.10 source code------------------------------
 *   $Id: page_footer_admin.php,v 1.9.2.2 2002/05/12 15:57:45 psotfx Exp $
//------------------------phpbb 2.0.10 source code----------------------------
 *   $Id: page_footer_admin.php,v 1.9.2.3 2005/04/15 20:15:47 acydburn Exp $
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

	'PHPBB_VERSION' => '2' . $board_config['version'], 

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	'PHPBB_VERSION' => '2' . $board_config['version'], 
------------------------phpbb 2.0.10 source code---------------------------- */
	'PHPBB_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? '2' . $board_config['version'] : '', 
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


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

#Find

 *   $Id: page_header_admin.php,v 1.12.2.5 2003/06/10 20:48:18 acydburn Exp $

#Replace

 *   $Id: page_header_admin.php,v 1.12.2.6 2005/03/26 14:15:59 acydburn Exp $

#Find

	$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
------------------------phpbb 2.0.10 source code---------------------------- */
	$useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


##################################################################################################---------

#OPEN db/postgres7.php

#Find

   *   $Id: postgres7.php,v 1.19 2002/03/05 02:19:38 psotfx Exp $

#Replace

   *   $Id: postgres7.php,v 1.19.2.2 2005/04/15 20:53:10 acydburn Exp $


#Find

			if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction )

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
			$query = preg_replace('#(.*WHERE.*)(username|user_email|ban_email) = \'(.*)\'#ise', "\"\\\1LOWER(\\\2) = '\" . strtolower('\\\3') . \"'\"", $query);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


###################################################################################################---------
#OPEN includes/constants.php

#Find

 *   $Id: constants.php,v 1.47.2.4 2003/06/10 00:39:51 psotfx Exp $

#Replace

 *   $Id: constants.php,v 1.47.2.5 2004/11/18 17:49:42 acydburn Exp $

#Find

// Table names

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
define('CONFIRM_TABLE', $table_prefix.'confirm');
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

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

#Find

 *   $Id: functions.php,v 1.133.2.32 2004/07/17 13:48:31 acydburn Exp $

#Replace

 *   $Id: functions.php,v 1.133.2.34 2005/02/21 18:37:33 acydburn Exp $

#Find

//
// Get Userdata, $user can be username or user_id. If force_str is true, the username will be forced.

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
// added at phpBB 2.0.11 to properly format the username
function phpbb_clean_username($username)
{
	$username = substr(htmlspecialchars(str_replace("\'", "'", trim($username))), 0, 25);
	$username = phpbb_rtrim($username, "\\\");	
	$username = str_replace("'", "\'", $username);

	return $username;
}

// added at phpBB 2.0.12 to fix a bug in PHP 4.3.10 (only supporting charlist in php >= 4.1.0)
function phpbb_rtrim($str, $charlist = false)
{
	if ($charlist === false)
	{
		return rtrim($str);
	}
	
	$php_version = explode('.', PHP_VERSION);

	// php version < 4.1.0
	if ((int) $php_version[0] < 4 || ((int) $php_version[0] == 4 && (int) $php_version[1] < 1))
	{
		while ($str{strlen($str)-1} == $charlist)
		{
			$str = substr($str, 0, strlen($str)-1);
		}
	}
	else
	{
		$str = rtrim($str, $charlist);
	}

	return $str;
}
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

		$user = trim(htmlspecialchars($user));
		$user = substr(str_replace("\\\'", "'", $user), 0, 25);
		$user = str_replace("'", "\\\'", $user);

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		$user = trim(htmlspecialchars($user));
		$user = substr(str_replace("\\\'", "'", $user), 0, 25);
		$user = str_replace("'", "\\\'", $user);
------------------------phpbb 2.0.10 source code---------------------------- */
		$user = phpbb_clean_username($user);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------



#Find

			$debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file;

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
			$debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file;
------------------------phpbb 2.0.10 source code---------------------------- */
			$debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . basename($err_file);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


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

#Find

 *   $Id: functions_post.php,v 1.9.2.36 2004/07/11 16:46:19 acydburn Exp $

#Replace

 *   $Id: functions_post.php,v 1.9.2.37 2004/11/18 17:49:44 acydburn Exp $


#Find

		$username = trim(strip_tags($username));

#Replace\r

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		$username = trim(strip_tags($username));
------------------------phpbb 2.0.10 source code---------------------------- */
		$username = phpbb_clean_username($username);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


###################################################################################################---------
#OPEN includes/functions_search.php

#Find

*     $Id: functions_search.php,v 1.8.2.18 2004/03/25 15:57:20 acydburn Exp $

#Replace

*     $Id: functions_search.php,v 1.8.2.19 2004/11/18 17:49:45 acydburn Exp $



#Find

		$username_search = preg_replace('/\*/', '%', trim(strip_tags($search_match)));

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		$username_search = preg_replace('/\*/', '%', trim(strip_tags($search_match)));
------------------------phpbb 2.0.10 source code---------------------------- */
		$username_search = preg_replace('/\*/', '%', phpbb_clean_username($search_match));
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

		'USERNAME' => ( !empty($search_match) ) ? strip_tags($search_match) : '', 

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		'USERNAME' => ( !empty($search_match) ) ? strip_tags($search_match) : '', 
------------------------phpbb 2.0.10 source code---------------------------- */
		'USERNAME' => (!empty($search_match)) ? phpbb_clean_username($search_match) : '', 
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


###################################################################################################---------
#OPEN includes/page_header.php

#Find

 *   $Id: page_header.php,v 1.106.2.23 2004/07/11 16:46:19 acydburn Exp $

#Replace

 *   $Id: page_header.php,v 1.106.2.24 2005/03/26 14:15:59 acydburn Exp $


#Find

	$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
------------------------phpbb 2.0.10 source code---------------------------- */
	$useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))
------------------------phpbb 2.0.10 source code---------------------------- */
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2'))
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------



###################################################################################################---------
#OPEN includes/page_tail.php

#Find

 *   $Id: page_tail.php,v 1.27.2.2 2002/11/26 11:42:12 psotfx Exp $

#Replace

 *   $Id: page_tail.php,v 1.27.2.3 2004/12/22 02:04:00 psotfx Exp $


#Find

	'PHPBB_VERSION' => '2' . $board_config['version'],
	'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	'PHPBB_VERSION' => '2' . $board_config['version'],
	'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 
------------------------phpbb 2.0.10 source code---------------------------- */
	'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------



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

#Find

 *   $Id: sessions.php,v 1.58.2.11 2004/07/11 16:46:19 acydburn Exp $

Replace

 *   $Id: sessions.php,v 1.58.2.13 2005/03/15 18:24:37 acydburn Exp $


#Find

	$last_visit = 0;

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
	$page_id = (int) $page_id;

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

				if( $sessiondata['autologinid'] == $auto_login_key )

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
				if( $sessiondata['autologinid'] == $auto_login_key )
------------------------phpbb 2.0.10 source code---------------------------- */
				if( $sessiondata['autologinid'] === $auto_login_key )
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

					// No match; don't login, set as anonymous user
					$login = 0; 
					$enable_autologin = 0; 
					$user_id = $userdata['user_id'] = ANONYMOUS;

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
				
					$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS;
					$result = $db->sql_query($sql);
					$userdata = $db->sql_fetchrow($result);
					$db->sql_freeresult($result);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

				// Autologin is not set. Don't login, set as anonymous user
				$login = 0;
				$enable_autologin = 0;
				$user_id = $userdata['user_id'] = ANONYMOUS;

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

				$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS;
				$result = $db->sql_query($sql);
				$userdata = $db->sql_fetchrow($result);
				$db->sql_freeresult($result);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

	//
	// Does a session exist?

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

	$thispage_id = (int) $thispage_id;
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------



###################################################################################################---------
#OPEN includes/template.php

#Find

 *   $Id: template.php,v 1.10.2.3 2002/12/21 19:09:57 psotfx Exp $

#Replace

 *   $Id: template.php,v 1.10.2.4 2005/02/21 18:37:50 acydburn Exp $

#Find

	$filename = phpbb_realpath($this->root . '/' . $filename);

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	$filename = phpbb_realpath($this->root . '/' . $filename);
------------------------phpbb 2.0.10 source code---------------------------- */
	$filename = ($rp_filename = phpbb_realpath($this->root . '/' . $filename)) ? $rp_filename : $filename;
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


###################################################################################################---------
#OPEN includes/topic_review.php

#Find

 *   $Id: topic_review.php,v 1.5.2.2 2004/03/01 15:56:51 psotfx Exp $

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
//*----------------------phpbb 2.0.10 source code------------------------------
 *   $Id: topic_review.php,v 1.5.2.2 2004/03/01 15:56:51 psotfx Exp $
//------------------------phpbb 2.0.10 source code----------------------------
 *   $Id: topic_review.php,v 1.5.2.3 2004/11/18 17:49:45 acydburn Exp $
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

		if ( !isset($topic_id) )
		{
			message_die(GENERAL_MESSAGE, 'Topic_not_exist');

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
		if ( !isset($topic_id) )
		{
			message_die(GENERAL_MESSAGE, 'Topic_not_exist');
------------------------phpbb 2.0.10 source code---------------------------- */
		if ( !isset($topic_id) || !$topic_id)
		{
			message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


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

#Find

 *   $Id: usercp_avatar.php,v 1.8.2.18 2004/07/11 16:46:20 acydburn Exp $

#Replace

 *   $Id: usercp_avatar.php,v 1.8.2.19 2005/02/21 18:37:51 acydburn Exp $


#Find

	global $board_config, $userdata;

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

	$avatar_file = basename($avatar_file);
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

	global $board_config;

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

	$avatar_filename = str_replace(array('../', '..\\\', './', '.\\\'), '', $avatar_filename);
	if ($avatar_filename{0} == '/' || $avatar_filename{0} == "\\\")
	{
		return '';
	}

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

			$move_file($avatar_filename, './' . $board_config['avatar_path'] . "/$new_filename");

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
			if (!is_uploaded_file($avatar_filename))
			{
				message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__);
			}
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

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


#Find

 *   $Id: usercp_register.php,v 1.20.2.57 2004/03/25 15:57:20 acydburn Exp $

#Replace

 *   $Id: usercp_register.php,v 1.20.2.59 2005/02/21 18:37:51 acydburn Exp $

#Find

if ( !defined('IN_PHPBB') )

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/***************************************************************************
 *
 *   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.
 *
 *
 ***************************************************************************/
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

$strip_var_list = array('username' => 'username', 'email' => 'email', 'icq' => 'icq', 'aim' => 'aim', 'msn' => 'msn', 'yim' => 'yim', 'website' => 'website', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests');

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
	$strip_var_list['confirm_code'] = 'confirm_code';
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

	$passwd_sql = '';
	if ( !empty($new_password) && !empty($password_confirm) )

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
	if ($board_config['enable_confirm'] && $mode == 'register')
	{
		if (empty($HTTP_POST_VARS['confirm_id']))
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
		}
		else
		{
			$confirm_id = htmlspecialchars($HTTP_POST_VARS['confirm_id']);
			if (!preg_match('/^[A-Za-z0-9]+$/', $confirm_id))
			{
				$confirm_id = '';
			}
			
			$sql = 'SELECT code 
				FROM ' . CONFIRM_TABLE . " 
				WHERE confirm_id = '$confirm_id' 
					AND session_id = '" . $userdata['session_id'] . "'";
			if (!($result = $db->sql_query($sql)))
			{
				message_die(GENERAL_ERROR, 'Could not obtain confirmation code', __LINE__, __FILE__, $sql);
			}

			if ($row = $db->sql_fetchrow($result))
			{
				if ($row['code'] != $confirm_code)
				{
					$error = TRUE;
					$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
				}
				else
				{
					$sql = 'DELETE FROM ' . CONFIRM_TABLE . " 
						WHERE confirm_id = '$confirm_id' 
							AND session_id = '" . $userdata['session_id'] . "'";
					if (!$db->sql_query($sql))
					{
						message_die(GENERAL_ERROR, 'Could not delete confirmation code', __LINE__, __FILE__, $sql);
					}
				}
			}
			else
			{		
				$error = TRUE;
				$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
			}
			$db->sql_freeresult($result);
		}
	}

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

			$avatar_mode = ( !empty($user_avatar_name) ) ? 'local' : 'remote';

#Replace

\n//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
			$avatar_mode = ( !empty($user_avatar_name) ) ? 'local' : 'remote';
------------------------phpbb 2.0.10 source code---------------------------- */
			$avatar_mode = (empty($user_avatar_name)) ? 'remote' : 'local';
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

	//
	// Let's do an overall check for settings/versions which would prevent

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

	// Visual Confirmation
	$confirm_image = '';
	if (!empty($board_config['enable_confirm']) && $mode == 'register')
	{
		$sql = 'SELECT session_id 
			FROM ' . SESSIONS_TABLE; 
		if (!($result = $db->sql_query($sql)))
		{
			message_die(GENERAL_ERROR, 'Could not select session data', '', __LINE__, __FILE__, $sql);
		}

		if ($row = $db->sql_fetchrow($result))
		{
			$confirm_sql = '';
			do
			{
				$confirm_sql .= (($confirm_sql != '') ? ', ' : '') . "'" . $row['session_id'] . "'";
			}
			while ($row = $db->sql_fetchrow($result));
		
			$sql = 'DELETE FROM ' .  CONFIRM_TABLE . " 
				WHERE session_id NOT IN ($confirm_sql)";
			if (!$db->sql_query($sql))
			{
				message_die(GENERAL_ERROR, 'Could not delete stale confirm data', '', __LINE__, __FILE__, $sql);
			}
		}
		$db->sql_freeresult($result);

		$sql = 'SELECT COUNT(session_id) AS attempts 
			FROM ' . CONFIRM_TABLE . " 
			WHERE session_id = '" . $userdata['session_id'] . "'";
		if (!($result = $db->sql_query($sql)))
		{
			message_die(GENERAL_ERROR, 'Could not obtain confirm code count', '', __LINE__, __FILE__, $sql);
		}

		if ($row = $db->sql_fetchrow($result))
		{
			if ($row['attempts'] > 3)
			{
				message_die(GENERAL_MESSAGE, $lang['Too_many_registers']);
			}
		}
		$db->sql_freeresult($result);
		
		$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)];
		}

		$confirm_id = md5(uniqid($user_ip));

		$sql = 'INSERT INTO ' . CONFIRM_TABLE . " (confirm_id, session_id, code) 
			VALUES ('$confirm_id', '". $userdata['session_id'] . "', '$code')";
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Could not insert new confirm code information', '', __LINE__, __FILE__, $sql);
		}

		unset($code);
		
		$confirm_image = (@extension_loaded('zlib')) ? '<img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id") . '" alt="" title="" />' : '<img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id&c=1") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id&c=2") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id&c=3") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id&c=4") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id&c=5") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id&c=6") . '" alt="" title="" />';
		$s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';

		$template->assign_block_vars('switch_confirm', array());
	}

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


#Find

		'YIM' => $yim,
		'ICQ' => $icq,

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
		'CONFIRM_IMG' => $confirm_image, 
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find
		'L_EMAIL_ADDRESS' => $lang['Email_address'],

#After add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
		'L_CONFIRM_CODE_IMPAIRED'	=> sprintf($lang['Confirm_code_impaired'], '<a href="mailto:' . $board_config['board_email'] . '">', '</a>'), 
		'L_CONFIRM_CODE'			=> $lang['Confirm_code'], 
		'L_CONFIRM_CODE_EXPLAIN'	=> $lang['Confirm_code_explain'], 
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

###################################################################################################
#OPEN includes/usercp_sendpasswd.php

#Find

 *   $Id: usercp_sendpasswd.php,v 1.6.2.11 2003/05/03 23:24:03 acydburn Exp $

#Replace

 *   $Id: usercp_sendpasswd.php,v 1.6.2.12 2004/11/18 17:49:45 acydburn Exp $


#Find

	$username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags($HTTP_POST_VARS['username'])) : '';

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	$username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags($HTTP_POST_VARS['username'])) : '';
------------------------phpbb 2.0.10 source code---------------------------- */
	$username = ( !empty($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


###################################################################################################
#OPEN includes/usercp_viewprofile.php

#Find

 *   $Id: usercp_viewprofile.php,v 1.5.2.2 2004/07/11 16:46:20 acydburn Exp $

#Replace

 *   $Id: usercp_viewprofile.php,v 1.5.2.3 2004/11/18 17:49:45 acydburn Exp $


#Find

$template->assign_vars(array(

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
if (function_exists('get_html_translation_table'))
{
	$u_search_author = urlencode(strtr($profiledata['username'], array_flip(get_html_translation_table(HTML_ENTITIES))));
}
else
{
	$u_search_author = urlencode(str_replace(array('&', ''', '"', '<', '>'), array('&', "'", '"', '<', '>'), $profiledata['username']));
}

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

#Find

	'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username'])),

#Replace

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------
/*----------------------phpbb 2.0.10 source code------------------------------
	'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username'])),
------------------------phpbb 2.0.10 source code---------------------------- */
	'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . $u_search_author),
//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


###################################################################################################
#OPEN language/lang_english/lang_admin.php

#Find

 *     $Id: lang_admin.php,v 1.35.2.9 2003/06/10 00:31:19 psotfx Exp $

#Replace

 *     $Id: lang_admin.php,v 1.35.2.10 2005/02/21 18:38:17 acydburn Exp $


#Find

//
// That's all Folks!

#Before add

//---------Start Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------

//
// Version Check
//
$lang['Version_up_to_date'] = 'Your installation is up to date, no updates are available for your version of phpBB.';
$lang['Version_not_up_to_date'] = 'Your installation does <b>not</b> seem to be up to date. Updates are available for your version of phpBB, please visit <a href="http://www.phpbb.com/downloads.php" target="_new">http://www.phpbb.com/downloads.php</a> to obtain the latest version.';
$lang['Latest_version_info'] = 'The latest available version is <b>phpBB %s</b>.';
$lang['Current_version_info'] = 'You are running <b>phpBB %s</b>.';
$lang['Connect_socket_error'] = 'Unable to open connection to phpBB Server, reported error is:<br />%s';
$lang['Socket_functions_disabled'] = 'Unable to use socket functions.';
$lang['Mailing_list_subscribe_reminder'] = 'For the latest information on updates to phpBB, why not <a href="http://www.phpbb.com/support/" target="_new">subscribe to our mailing list</a>.';
$lang['Version_information'] = 'Version Information';

//---------End Update Phpbb 2.0.10 to Phpbb 2.0.14 -------------------------


###################################################################################################
#OPEN templates/subSilver/login_body.tpl

#Find
		  <input type="text" name="username" size="25" maxlength="40" value="{USERNAME}" />

#In-Line Find

<input type="text"

#After add

 class="post"


#Find
			  <input type="password" name="password" size="25" maxlength="32" />

#In-Line Find

<input type="password"

#After add

 class="post"


###################################################################################################
#OPEN templates/subSilver/overall_footer.tpl

#Find

	Powered by phpBB {PHPBB_VERSION} line, with phpBB linked to http://www.phpbb.com. If you refuse

#Replace

	Powered by phpBB line, with phpBB linked to http://www.phpbb.com. If you refuse

#Find

Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} &copy; 2001, 2002 phpBB Group<br />{TRANSLATION_INFO}</span></div>


#Replace

Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> &copy; 2001, 2005 phpBB Group<br />{TRANSLATION_INFO}</span></div>

###################################################################################################
#OPEN templates/subSilver/simple_footer.tpl

#Find

	Powered by phpBB {PHPBB_VERSION} line, with phpBB linked to http://www.phpbb.com. If you refuse

#Replace

	Powered by phpBB line, with phpBB linked to http://www.phpbb.com. If you refuse

#Find

Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} &copy; 2001,2002 phpBB Group</span></div>

#Replace

Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> &copy; 2001, 2005 phpBB Group</span></div>

###################################################################################################
#OPEN templates/subSilver/admin/board_config_body.tpl
maxdc
星球普通子民
星球普通子民
文章: 13
註冊時間: 2005-03-28 17:53

文章 maxdc »

###################################################################################################
#OPEN templates/subSilver/admin/board_config_body.tpl

#Find

<td class="row1">{L_BOARD_EMAIL_FORM}<br /><span class="gensmall">{L_BOARD_EMAIL_FORM_EXPLAIN}</span></td>

#Before add

<td class="row1">{L_VISUAL_CONFIRM}<br /><span class="gensmall">{L_VISUAL_CONFIRM_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="enable_confirm" value="1" {CONFIRM_ENABLE} />{L_YES}&nbsp; &nbsp;<input type="radio" name="enable_confirm" value="0" {CONFIRM_DISABLE} />{L_NO}</td>
</tr>
<tr>


##################################################################################################
#OPEN templates/subSilver/admin/index_body.tpl

#Find

<!-- END guest_user_row -->
</table>

<br />

#After add


<h1>{L_VERSION_INFORMATION}</h1>

{VERSION_INFO}

<br />

##################################################################################################
主題已鎖定

回到「外掛問題討論」