[教學] phpBB 2.0.11 更新至 2.0.12 的步驟
發表於 : 2005-02-22 14:32
http://www.phpbb.com/phpBB/viewtopic.php?t=265444
竹貓全檔案分流下載:
http://phpbb-tw.net/phpbb/viewtopic.php?t=32964
phpBB 2.0.11 to phpBB 2.0.12 Code Changes
These are the Changes from phpBB 2.0.11 to phpBB 2.0.12 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.
當你看到 '之後,加上'-語法, 代碼必須加在 '尋找'-語法找的的最後一行的下面.
當你看到 '之前,加上'-語法, 代碼必須加在 '尋找'-語法找的的最後一行的上面.
當你看到 '取代為'-語法, 在 '尋找'-語法找到的代碼必須完全的取代成 '取代為'-語法中的代碼.
當你看到 '刪除'-語法, 代碼必須刪除.
After you have finished this tutorial, you have to upload the update_to_latest.php file, execute it and then delete it from your webspace.
Ok, 讓我們開始吧:
竹貓全檔案分流下載:
http://phpbb-tw.net/phpbb/viewtopic.php?t=32964
phpBB 2.0.11 to phpBB 2.0.12 Code Changes
These are the Changes from phpBB 2.0.11 to phpBB 2.0.12 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.
當你看到 '之後,加上'-語法, 代碼必須加在 '尋找'-語法找的的最後一行的下面.
當你看到 '之前,加上'-語法, 代碼必須加在 '尋找'-語法找的的最後一行的上面.
當你看到 '取代為'-語法, 在 '尋找'-語法找到的代碼必須完全的取代成 '取代為'-語法中的代碼.
當你看到 '刪除'-語法, 代碼必須刪除.
After you have finished this tutorial, you have to upload the update_to_latest.php file, execute it and then delete it from your webspace.
Ok, 讓我們開始吧:
- admin/admin_db_utilities.php
-
尋找 - 行 696
取代為
代碼: 選擇全部
$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');
代碼: 選擇全部
$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');
- admin/index.php
-
尋找 - 行 562
之後,加上
代碼: 選擇全部
"L_NO_GUESTS_BROWSING" => $lang['No_users_browsing']) ); }
代碼: 選擇全部
// 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: 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']) );
- common.php
-
尋找 - 行 56
取代為
代碼: 選擇全部
$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);
代碼: 選擇全部
$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);
-
尋找 - 行 75
之後,加上
代碼: 選擇全部
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');
-
尋找 - 行 92
取代為
代碼: 選擇全部
unset($input['input']); while (list($var,) = @each($input)) { unset($$var); }
代碼: 選擇全部
unset($input['input']); unset($input['not_unset']); while (list($var,) = @each($input)) { if (!in_array($var, $not_unset)) { unset($$var); } }
-
尋找 - 行 207
取代為
代碼: 選擇全部
$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 );
代碼: 選擇全部
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
- includes/functions.php
-
尋找 - 行 80
取代為
代碼: 選擇全部
$username = htmlspecialchars(rtrim(trim($username), "\\\")); $username = substr(str_replace("\\\'", "'", $username), 0, 25); $username = str_replace("'", "\\\'", $username);
代碼: 選擇全部
$username = substr(htmlspecialchars(str_replace("\'", "'", trim($username))), 0, 25); $username = phpbb_rtrim($username, "\\\"); $username = str_replace("'", "\'", $username);
-
尋找 - 行 83
之後,加上
代碼: 選擇全部
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; }
-
尋找 - 行 608
取代為
代碼: 選擇全部
$debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file;
代碼: 選擇全部
$debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . basename($err_file);
- includes/page_tail.php
-
尋找 - 行 38
取代為
代碼: 選擇全部
'PHPBB_VERSION' => '2' . $board_config['version'],
代碼: 選擇全部
// 'PHPBB_VERSION' => '2' . $board_config['version'],
- includes/template.php
-
尋找 - 行 233
取代為
代碼: 選擇全部
$filename = phpbb_realpath($this->root . '/' . $filename);
代碼: 選擇全部
$filename = ($rp_filename = phpbb_realpath($this->root . '/' . $filename)) ? $rp_filename : $filename;
- includes/usercp_avatar.php
-
尋找 - 行 54
之後,加上
代碼: 選擇全部
{ global $board_config, $userdata;
代碼: 選擇全部
$avatar_file = basename($avatar_file);
-
尋找 - 行 69
之後,加上
代碼: 選擇全部
function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename) { global $board_config;
代碼: 選擇全部
$avatar_filename = str_replace(array('../', '..\\\', './', '.\\\'), '', $avatar_filename); if ($avatar_filename{0} == '/' || $avatar_filename{0} == "\\\") { return ''; } \n
-
尋找 - 行 235
之後,加上
代碼: 選擇全部
$move_file = 'copy'; }
代碼: 選擇全部
if (!is_uploaded_file($avatar_filename)) { message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__); }
- includes/usercp_register.php
-
尋找 - 行 462
取代為
代碼: 選擇全部
$avatar_mode = ( !empty($user_avatar_name) ) ? 'local' : 'remote';
代碼: 選擇全部
$avatar_mode = (empty($user_avatar_name)) ? 'remote' : 'local';
- language/lang_chinese_traditional_taiwan/lang_admin.php
-
尋找
之前,加上
代碼: 選擇全部
// // That's all Folks! // -------------------------------------------------
代碼: 選擇全部
// // Version Check // $lang['Version_up_to_date'] = '你目前安裝的版本是最新的, 你不需要做更新的動作.'; $lang['Version_not_up_to_date'] = '你目前安裝的版本 <b>不是</b> 最新的. phpBB 的最新(更新)檔案可以在 <a href="http://www.phpbb.com/downloads.php" target="_new">http://www.phpbb.com/downloads.php</a> 下載到.'; $lang['Latest_version_info'] = '目前最新的版本是 <b>phpBB %s</b>.'; $lang['Current_version_info'] = '你目前使用的是 <b>phpBB %s</b>.'; $lang['Connect_socket_error'] = '無法成功連上 phpBB 的主機, 錯誤回報:<br />%s'; $lang['Socket_functions_disabled'] = '無法使用 socket 功能.'; $lang['Mailing_list_subscribe_reminder'] = '欲得知 phpBB 的最新更新消息, 何不 <a href="http://www.phpbb.com/support/" target="_new">訂閱我們的電子報</a>.'; $lang['Version_information'] = '版本資訊';
- templates/subSilver/admin/index_body.tpl
-
尋找 - 行 80
之後,加上
代碼: 選擇全部
</table> <br />
代碼: 選擇全部
<h1>{L_VERSION_INFORMATION}</h1> {VERSION_INFO} <br />
- templates/subSilver/overall_footer.tpl
-
尋找 - 行 8
取代為
代碼: 選擇全部
Powered by phpBB {PHPBB_VERSION} line, with phpBB linked to www.phpbb.com. If you refuse to include even this then support on our forums may be affected. The phpBB Group : 2002 // --> Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} © 2001, 2002 phpBB Group<br />{TRANSLATION_INFO}</span></div>
代碼: 選擇全部
Powered by phpBB line, with phpBB linked to www.phpbb.com. If you refuse to include even this then support on our forums may be affected. The phpBB Group : 2002 // --> Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> © 2001, 2005 phpBB Group<br />{TRANSLATION_INFO}</span></div>
- templates/subSilver/simple_footer.tpl
-
尋找 - 行 8
取代為
代碼: 選擇全部
Powered by phpBB {PHPBB_VERSION} line, with phpBB linked to www.phpbb.com. If you refuse to include even this then support on our forums may be affected. The phpBB Group : 2002 // --> Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} © 2001,2002 phpBB Group</span></div>
代碼: 選擇全部
Powered by phpBB line, with phpBB linked to www.phpbb.com. If you refuse to include even this then support on our forums may be affected. The phpBB Group : 2002 // --> Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> © 2001, 2005 phpBB Group</span></div>
- viewtopic.php