[分享]phpBB2 Plus 1.53a Core Code Changes to phpBB 2.0.22 Code

phpBB Plus Support
本區是討論關於 phpBB 2 plus 使用上的問題討論!
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
頭像
yclin
星球普通子民
星球普通子民
文章: 9
註冊時間: 2003-02-26 12:38

[分享]phpBB2 Plus 1.53a Core Code Changes to phpBB 2.0.22 Code

文章 yclin »

原1.53a是 phpBB 2.0.21 Code 現在請新到 phpBB 2.0.22 Code

原始網站
http://www.phpbb2.de/

檔安下載
http://www.phpbb2.de/files/phpbb2plus/p ... _1.53a.zip

中文版請增加修改

代碼: 選擇全部

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

#
#-----[ FIND ]---------------------------------------------
# Line 1019
$lang['Please_remove_install_contrib'] = '請確定 install/ 和 contrib/ 這兩個目錄都已經刪除';

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

$lang['Session_invalid'] = '無效Session。請重新傳送表格。';

代碼: 選擇全部

############################################################## 
## MOD Title: phpBB2 Plus 1.53a Code Changes to Update to phpBB 2.0.22 Core Code
## MOD Author: stefan2k1 < N/A > (Stephan Paulus) N/A 
## MOD Description: 
##		
##		
##		phpBB2 Code Update Changes to Update your phpBB2 Plus 1.53a based on phpBB2.0.21
##		to phpBB 2.0.22 Core Code. 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.0 
## 
## Installation Level: Easy
## Installation Time: 20 Minutes 
## Files To Edit: 
##		admin/admin_board.php
##		groupcp.php
##		includes/functions.php
##		includes/usercp_email.php
##		includes/usercp_register.php
##		language/lang_english/lang_main.php
##		login.php
##		memberlist.php
##		modcp.php
##		posting.php
##		privmsg.php
##		search.php
##		viewforum.php
##		viewtopic.php
##
## Included Files: install/update_to_latest.php
## 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-12-26 - Version 1.0.0 
##      - first release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

#
#-----[ DIY INSTRUCTIONS ]---------------------------------------------
#
BEFORE installing this MOD, you have to upload the file
install/update_to_latest.php, execute it and then delete it
from your webspace.

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

#
#-----[ FIND ]---------------------------------------------
# Line 55
		// 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']);
		}

#
#-----[ AFTER, ADD ]---------------------------------------------
#
		// Attempt to prevent a mistake with this value.
		if ($config_name == 'avatar_path')
		{
			$new['avatar_path'] = trim($new['avatar_path']);
			if (strstr($new['avatar_path'], "\0") || !is_dir($phpbb_root_path . $new['avatar_path']) || !is_writable($phpbb_root_path . $new['avatar_path']))
			{
				$new['avatar_path'] = $default_config['avatar_path'];
			}
		}
		
# 
#-----[ OPEN ]--------------------------------------------- 
# 
groupcp.php

#
#-----[ FIND ]---------------------------------------------
# Line 150
$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$start = ($start < 0) ? 0 : $start;

#
#-----[ FIND ]---------------------------------------------
# Line 417
							AND NOT EXISTS (
							SELECT aa.group_id 
							FROM " . AUTH_ACCESS_TABLE . " aa 
							WHERE aa.group_id = g.group_id  
						)

#
#-----[ FIND ]---------------------------------------------
# Line 422
					)";

#
#-----[ REPLACE WITH ]---------------------------------------------
#
					)
				ORDER BY aa.auth_mod DESC";
				
#
#-----[ FIND ]---------------------------------------------
# Line 425

		case 'oracle':
			$sql = "SELECT g.group_moderator, g.group_type, aa.auth_mod 
				FROM " . GROUPS_TABLE . " g, " . AUTH_ACCESS_TABLE . " aa 
				WHERE g.group_id = $group_id

#
#-----[ FIND ]---------------------------------------------
# Line 430
					AND aa.group_id (+) = g.group_id";

#
#-----[ REPLACE WITH ]---------------------------------------------
#
					AND aa.group_id (+) = g.group_id
				ORDER BY aa.auth_mod DESC";
				
#
#-----[ FIND ]---------------------------------------------
# Line 433

		default:
			$sql = "SELECT g.group_moderator, g.group_type, aa.auth_mod 
				FROM ( " . GROUPS_TABLE . " g 
				LEFT JOIN " . AUTH_ACCESS_TABLE . " aa ON aa.group_id = g.group_id )

#
#-----[ FIND ]---------------------------------------------
# Line 438
				WHERE g.group_id = $group_id";

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				WHERE g.group_id = $group_id
				ORDER BY aa.auth_mod DESC";
				
# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/functions.php

#
#-----[ FIND ]---------------------------------------------
# Line 1303
	if (strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r"))

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	if (strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r") || strstr(urldecode($url), ';url'))												

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

#
#-----[ FIND ]---------------------------------------------
# Line 53
if ( $result = $db->sql_query($sql) )
{
	$row = $db->sql_fetchrow($result);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
if ( $result = $db->sql_query($sql) )
{
	if ( $row = $db->sql_fetchrow($result) )
	{

#
#-----[ FIND ]---------------------------------------------
# Line 234
else
{
	message_die(GENERAL_MESSAGE, $lang['User_not_exist']);
}

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	else
	{
		message_die(GENERAL_MESSAGE, $lang['User_not_exist']);
	}
}
else
{
	message_die(GENERAL_ERROR, 'Could not select user data', '', __LINE__, __FILE__, $sql);
}

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

#
#-----[ FIND ]---------------------------------------------
# Line 228
	$notifypm = ( isset($_POST['notifypm']) ) ? ( ($_POST['notifypm']) ? TRUE : 0 ) : TRUE;
	$popup_pm = ( isset($_POST['popup_pm']) ) ? ( ($_POST['popup_pm']) ? TRUE : 0 ) : TRUE;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	$sid = (isset($_POST['sid'])) ? $_POST['sid'] : 0;
	
#
#-----[ FIND ]---------------------------------------------
# Line 253
if ( isset($_POST['submit']) )
{
	include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);


#
#-----[ AFTER, ADD ]---------------------------------------------
#
	// session id check
	if ($sid == '' || $sid != $userdata['session_id'])
	{
		$error = true;
		$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Session_invalid'];
	}	
	
#
#-----[ FIND ]---------------------------------------------
# Line 411
				message_die(GENERAL_ERROR, 'Could not obtain confirmation code', __LINE__, __FILE__, $sql);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				message_die(GENERAL_ERROR, 'Could not obtain confirmation code', '', __LINE__, __FILE__, $sql);

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

#
#-----[ REPLACE WITH ]---------------------------------------------
#
						message_die(GENERAL_ERROR, 'Could not delete confirmation code', '', __LINE__, __FILE__, $sql);	
						
#
#-----[ FIND ]---------------------------------------------
# Line 1288
	$s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="coppa" value="' . $coppa . '" />';

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	$s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';		
	
# 
#-----[ OPEN ]--------------------------------------------- 
# 
language/lang_english/lang_main.php

#
#-----[ FIND ]---------------------------------------------
# Line 1019
$lang['Please_remove_install_contrib'] = 'Please ensure both the install/ and contrib/ directories are deleted';

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

$lang['Session_invalid'] = 'Invalid Session. Please resubmit the form.';


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

#
#-----[ FIND ]---------------------------------------------
# Line 1019
$lang['Please_remove_install_contrib'] = '請確定 install/ 和 contrib/ 這兩個目錄都已經刪除';

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

$lang['Session_invalid'] = '無效Session。請重新傳送表格。';


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

#
#-----[ FIND ]---------------------------------------------
# Line 346
				if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r"))

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r") || strstr(urldecode($redirect), ';url'))
				
#
#-----[ FIND ]---------------------------------------------
# Line 369
			if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r"))

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r") || strstr(urldecode($redirect), ';url'))		
			
# 
#-----[ OPEN ]--------------------------------------------- 
# 
memberlist.php

#
#-----[ FIND ]---------------------------------------------
# Line 38
$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;
#
#-----[ AFTER, ADD ]---------------------------------------------
#
$start = ($start < 0) ? 0 : $start;

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

#
#-----[ FIND ]---------------------------------------------
# Line 91
$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$start = ($start < 0) ? 0 : $start;

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

#
#-----[ FIND ]---------------------------------------------
# Line 56
$confirm = isset($_POST['confirm']) ? true : false;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$sid = (isset($_POST['sid'])) ? $_POST['sid'] : 0;

#
#-----[ FIND ]---------------------------------------------
# Line 340
if ( $result = $db->sql_query($sql) )
{
	$post_info = $db->sql_fetchrow($result);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
if ( ($result = $db->sql_query($sql)) && ($post_info = $db->sql_fetchrow($result)) )
{

#
#-----[ FIND ]---------------------------------------------
# Line 671
	$s_hidden_fields = '<input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '" />';
	$s_hidden_fields .= ( $delete || $mode == "delete" ) ? '<input type="hidden" name="mode" value="delete" />' : '<input type="hidden" name="mode" value="poll_delete" />';

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	$s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
	
#
#-----[ FIND ]---------------------------------------------
# Line 779
	// Submit post/vote (newtopic, edit, reply, etc.)
	//
	$return_message = '';
	$return_meta = '';


#
#-----[ AFTER, ADD ]---------------------------------------------
#
	// session id check
	if ($sid == '' || $sid != $userdata['session_id'])
	{
		$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Session_invalid'] : $lang['Session_invalid'];
	}	
	
#
#-----[ FIND ]---------------------------------------------
# Line 905
			break;

		case 'delete':
		case 'poll_delete':

#
#-----[ AFTER, ADD ]---------------------------------------------
#
			if ($error_msg != '')
			{
				message_die(GENERAL_MESSAGE, $error_msg);
			}	

#
#-----[ FIND ]---------------------------------------------
# Line 1502
		
$hidden_form_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$hidden_form_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';		

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

#
#-----[ FIND ]---------------------------------------------
# Line 53
$delete_all = ( isset($_POST['deleteall']) ) ? TRUE : 0;
$save = ( isset($_POST['save']) ) ? TRUE : 0;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$sid = (isset($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : 0;

#
#-----[ FIND ]---------------------------------------------
# Line 101
$mode = '';
}

$start = ( !empty($_GET['start']) ) ? intval($_GET['start']) : 0;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$start = ($start < 0) ? 0 : $start;

#
#-----[ FIND ]---------------------------------------------
# Line 1163
		unset($row);
	}

	if ( $submit )
	{
	
#
#-----[ AFTER, ADD ]---------------------------------------------
#
		// session id check
		if ($sid == '' || $sid != $userdata['session_id'])
		{
			$error = true;
			$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Session_invalid'];
		}
		
#
#-----[ FIND ]---------------------------------------------
# Line 1388
		$privmsg_message = preg_replace('#<textarea>#si', '<textarea>', $privmsg_message);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		// $privmsg_message = preg_replace('#<textarea>#si', '<textarea>', $privmsg_message);
		
#
#-----[ FIND ]---------------------------------------------
# Line 1511
			$privmsg_message = preg_replace('#</textarea>#si', '</textarea>', $privmsg_message);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
			// $privmsg_message = preg_replace('#</textarea>#si', '</textarea>', $privmsg_message);		
			
#
#-----[ FIND ]---------------------------------------------
# Line 1554
				$privmsg_message = preg_replace('#</textarea>#si', '</textarea>', $privmsg_message);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				// $privmsg_message = preg_replace('#</textarea>#si', '</textarea>', $privmsg_message);
				
#
#-----[ FIND ]---------------------------------------------
# Line 1676
	//
	// Start error handling
	//
	if ($error)
	{

#
#-----[ AFTER, ADD ]---------------------------------------------
#
		$privmsg_message = htmlspecialchars($privmsg_message);		
		
#
#-----[ FIND ]---------------------------------------------
# Line 1811
	$s_hidden_fields = '<input type="hidden" name="folder" value="' . $folder . '" />';
	$s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />';

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	$s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';		
	
# 
#-----[ OPEN ]--------------------------------------------- 
# 
search.php

#
#-----[ FIND ]---------------------------------------------
# Line 277

$start = (isset($_POST['start'])) ? intval($_POST['start']) : intval($_GET['start']);

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$start = ($start < 0) ? 0 : $start;

# 
#-----[ OPEN ]--------------------------------------------- 
# 
viewforum.php

#
#-----[ FIND ]---------------------------------------------
# Line 74

	$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$start = ($start < 0) ? 0 : $start;

# 
#-----[ OPEN ]--------------------------------------------- 
# 
viewtopic.php

#
#-----[ FIND ]---------------------------------------------
# Line 53

	$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$start = ($start < 0) ? 0 : $start;

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
YCLin
tpcat
星球普通子民
星球普通子民
文章: 5
註冊時間: 2003-04-12 18:10

文章 tpcat »

請問我是不是只要將現在2.0.21的程式碼,依照說明改一次,就會變成2.0.22Core。

還是需要下載官方的2.0.22 phpBB2, 蓋掉原版,然後再照著說明更改一次呢?

因為我本來是改2.0.21 Core 的phpBB2-Plus,但是有些CODE實在對不起來,改得有點心虛。

還是,有沒有網友能夠將您已經改好的CODE,上傳供小弟這個小白痴下載呢?
頭像
godbless
竹貓忠實會員
竹貓忠實會員
文章: 647
註冊時間: 2002-05-17 06:02
來自: 台北市南京東路4段
聯繫:

文章 godbless »

外掛問題區發問格式就在這裡,請務必一定照著格式來~!
你不照著規則來,就算是也搞不清楚你的問題在哪裡!
新手問問題不是罪惡
罪惡的是自己沒有先做好本分和功課,說話的口氣也不好,再加上態度有好像我們這群人欠你多少似的~~!!
竹貓星球發問規則:
http://phpbb-tw.net/phpbb/viewtopic.php?t=16149
發問比率最高的句子翻譯:
Please ensure both the install/ and contrib/ directories are deleted
請確認install和contrib資料夾已被刪除(奇怪,翻一下英漢字典有這麼困難嗎)
1111122222
星球普通子民
星球普通子民
文章: 9
註冊時間: 2005-04-20 21:34

文章 1111122222 »

請問更新完

代碼: 選擇全部

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

# 
#-----[ FIND ]--------------------------------------------- 
# Line 1019 
$lang['Please_remove_install_contrib'] = '請確定 install/ 和 contrib/ 這兩個目錄都已經刪除'; 

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

$lang['Session_invalid'] = '無效Session。請重新傳送表格。';
這些代碼必需自己再新增進去嗎?

更新程式沒幫用進去?
還是他只更新英文的?

假使這樣 我還有使用另一國語言--日文
那我是否要自己翻譯了
謝謝
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

1111122222 寫:請問更新完

代碼: 選擇全部

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

# 
#-----[ FIND ]--------------------------------------------- 
# Line 1019 
$lang['Please_remove_install_contrib'] = '請確定 install/ 和 contrib/ 這兩個目錄都已經刪除'; 

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

$lang['Session_invalid'] = '無效Session。請重新傳送表格。';
這些代碼必需自己再新增進去嗎?

更新程式沒幫用進去?
還是他只更新英文的?

假使這樣 我還有使用另一國語言--日文
那我是否要自己翻譯了
謝謝
原則上, 只要您論壇有使用到的語系, 都應該修改;
當然, 沒有人會比你更清楚, 為何您的論壇 '有使用另一國語言'?
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
1111122222
星球普通子民
星球普通子民
文章: 9
註冊時間: 2005-04-20 21:34

文章 1111122222 »

是這樣的
因為論壇提供給主要日文人 英文系 台灣人 使用
因此我只好加入這幾國語言 而進版語言使用英文
而因為有竹貓 因此中英文都沒問題了 日文問題就很大
因為發現外掛很多都沒翻譯 等待phpbb3 正式版出來再全更新了吧
而且官網日文語言也還沒出來
主題已鎖定

回到「phpBB 2 plus 綜合討論」