phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)
版主: 版主管理群
-
william91
- 竹貓忠實會員

- 文章: 642
- 註冊時間: 2003-04-16 20:53
- 來自: 牛牛農場
-
聯繫:
文章
由 william91 »
代碼: 選擇全部
<?php
/***************************************************************************
* db_update.php
* -------------------
* copyright : ?003 Freakin' Booty ;-P & Antony Bailey
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if( !$userdata['session_logged_in'] )
{
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid('login.'.$phpEx.'?redirect=db_update.'.$phpEx));
exit;
}
if( $userdata['user_level'] != ADMIN )
{
message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}
$page_title = '更新資料庫';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>更新資料庫</th></tr><tr><td><span class="genmed"><ul type="circle">';
$sql = array();
$sql[] = "ALTER TABLE phpbb_themes ADD fontcolor4 VARCHAR (6)";
$sql[] = "ALTER TABLE phpbb_themes_name ADD fontcolor4_name CHAR (50)";
for( $i = 0; $i < count($sql); $i++ )
{
if( !$result = $db->sql_query ($sql[$i]) )
{
$error = $db->sql_error();
echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>錯誤:</b></font> ' . $error['message'] . '</li><br />';
}
else
{
echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>完成</b></font></li><br />';
}
}
echo '</ul></span></td></tr><tr><td class="catBottom" height="28"> </td></tr>';
echo '<tr><th>End</th></tr><tr><td><span class="genmed">安裝已完成,請立即刪除此檔案。<br />如果你運行有任何錯誤,請瀏覽 <a href="http://www.phpbbhacks.com/forums" target="_phpbbhacks">phpBBHacks.com 技術支援論壇</a>請教某人去幫助你.</span></td></tr>';
echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day</a></span></td></table>';
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
儲存成一個檔案,上載到你的伺服器上,執行他
間中上來走走吧~
-
jackyct1
- 星球公民

- 文章: 86
- 註冊時間: 2003-07-18 21:09
- 來自: 香港
文章
由 jackyct1 »
謝謝~
那是不是以後如果有[ DATABASE CHANGES ],
我就把db_update.php的
代碼: 選擇全部
$sql = array();
$sql[] = "ALTER TABLE phpbb_themes ADD fontcolor4 VARCHAR (6)";
$sql[] = "ALTER TABLE phpbb_themes_name ADD fontcolor4_name CHAR (50)";
這個部分改了,然後再上載到我的server上,再執行就行了嗎~?^^
-
william91
- 竹貓忠實會員

- 文章: 642
- 註冊時間: 2003-04-16 20:53
- 來自: 牛牛農場
-
聯繫:
文章
由 william91 »
jackyct1 寫:謝謝~
那是不是以後如果有[ DATABASE CHANGES ],
我就把db_update.php的
代碼: 選擇全部
$sql = array();
$sql[] = "ALTER TABLE phpbb_themes ADD fontcolor4 VARCHAR (6)";
$sql[] = "ALTER TABLE phpbb_themes_name ADD fontcolor4_name CHAR (50)";
這個部分改了,然後再上載到我的server上,再執行就行了嗎~?^^
基本上是可以的...但可能有一些特別的SQL 指令....要另外再改^^
間中上來走走吧~