[教學] phpBB MODs安裝修改教學

與 phpBB 2.0.x 相關主題。

版主: 版主管理群

主題已鎖定
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

[教學] phpBB MODs安裝修改教學

文章 天霜 »

  • MOD是什麼?
    MOD是縮寫、全文為Modification 意義有修改、改造、修正、修飾等字義\r
    一般我們翻譯為"外掛" 不過也有的外文網站是叫"Hack" 
    "MOD"與"Hack"兩者雖名不同 但其代表意義是相同的。
  • MOD是用來做什麼用的?
    MOD是用來加強、修改phpBB2的功能、外觀、架構等用途。
  • MOD如何取得?
    請至phpBB相關支援網站下載
    目前就筆者比較經常逛的phpBB支援站有以下:
  • 正體中文支援站:
    http://phpbb-tw.net/phpbb/index.php
    phpBB.com認可的臺灣地區支援網站.竹貓星球 
  • 英.德文支援網站:
    http://www.phpbb.com/
    phpBB論壇的官方網站,該站提供的正式MODs下載網頁MODs數雖不會很多
    但都很實用。

    http://www.phpbbhacks.com/
    一個龐大的MODs資料庫 大半的MODs都有。

    http://mods.db9.dk/
    著名的Birthday(生日模組)和Global Announcment mod(全域公告)等的原作者網站

    http://rpgnet.clanmckeen.com/demo/
    著名的Categories Hierarchie Mod(子分區)和Profile Control Panel(個人資料控制台)等的原作者網站


    http://www.phpbb2.de/
    phpBBPLUS的官方網站.一個擁有龐大資料庫的 phpBB MOD 網站 (德文|英文)

    http://www.forumimages.com/
    這個站有收藏許多等級圖示及風格等,算是phpBB2有關風格圖案等美工的美工設計網站
  • 外掛模組安裝文件中的英文其意義是?
#
#-----[ ADD SQL 加入SQL語法 ]----------------------------------
#
  • 註:安裝某些外掛時 會有要求加入SQL語法 才能順利安裝完外掛
      這時請進入phpMyAdmin管理頁面 再進入你論壇使用中的資料庫\r
      再來會在上方選單中看到 SQL 超連結字樣 請點選進入\r
      將語法複製貼到文字框內 最後按下"執行"按鈕輸入語法
#
#-----[ COPY 複製 ]------------------------------------------------
#
#
#-----[ OPEN 打開 ]------------------------------------------------
#
#
#-----[ FIND 尋找 ]------------------------------------------------
#
#
#-----[ AFTER, ADD 之後, 加上 ]---------------------------------
#
#
#-----[ BEFORE ADD 之前, 加上 ]--------------------------------
#
#
#-----[ BELOW, ADD 下面, 加上 ]--------------------------------
#
#
#-----[ IN LINE FIND 繼續在這一行尋找 ]------------------------
#
#
#-----[ IN LINE AFTER, ADD 在指定之後, 加上 ]----------------
#
#
#-----[ IN LINE BEFORE, ADD 在指定之前, 加上 ]---------------------
#
#
#-----[ REPLACE WITH 替換 ]-----------------------------------
#
#
#-----[ DELETE 刪除 ]--------------------------------------------
#
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]----------
#
# EoM 外掛修正結束
  • 如何安裝MODs於我架的phpBB2論壇上?

    那裡現在筆者就開始教各位如何把MODs裝到phpBB2裡\r

    現在筆者以View Profile Sig 1.1.1這個MODs做示範

    這外掛的功能在於會員個人資料公開頁面顯示簽名檔內容

    第一步就是去下載MODs檔案

    進入以下的網址
    http://www.phpbb.com/phpBB/catdb.php?cat=58

    再來尋找 [2.0.6] View Profile Sig 字樣\r
    然後再按下Download File文字後的連結

    之後下載後的檔案為 view_profile_sig_1.1.1.mod
    請將副檔名由.mod改為.txt 用筆記本等文字編輯程式打開
    其內容如下:

代碼: 選擇全部

############################################################## 
## MOD Title: View Profile Sig
## MOD Author: netclectic < adrian@netclectic.com > (Adrian Cockbutn) http://www.netclectic.com 
## MOD Description: Adds the user's signature to their view profile page.
## MOD Version: 1.1.1
## 
## Installation Level: easy
## Installation Time: 3 Minutes 
## Files To Edit: (2) usercp_viewprofile.php, profile_view_body.tpl
## Included Files: n/a
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/
############################################################## 
## Author Notes: 
##
############################################################## 
## MOD History:
##     2003-11-07  - Version 1.1.1
##          - updated for 2.0.6 (no changes)
##          - removed the <b> </b> tags from around the signature.
##
##     xxxx-xx-xx  - Version 1.1.0
##          - Updated for 2.0.4 and fixed a problem with formatting of the signature.
##
##     xxxx-xx-xx  - Version 1.0.0
##          - First release.
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

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

# 
#-----[ FIND ]------------------------------------------ 
# 
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';

# 
#-----[ AFTER, ADD ]------------------------------------
# 
$user_sig = '';
if ( $profiledata['user_attachsig'] && $board_config['allow_sig'] )
{
    include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
    $user_sig = $profiledata['user_sig'];
    $user_sig_bbcode_uid = $profiledata['user_sig_bbcode_uid'];
	if ( $user_sig != '' )
    {
        if ( !$board_config['allow_html'] && $profiledata['user_allowhtml'] )
       	{
       		$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\\2>", $user_sig);
       	}
    	if ( $board_config['allow_bbcode'] && $user_sig_bbcode_uid != '' )
   		{
   			$user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
   		}
   		$user_sig = make_clickable($user_sig);

        if (!$userdata['user_allowswearywords'])
        {
            $orig_word = array();
            $replacement_word = array();
            obtain_word_list($orig_word, $replacement_word);
            $user_sig = preg_replace($orig_word, $replacement_word, $user_sig);
        }
        if ( $profiledata['user_allowsmile'] )
        {
            $user_sig = smilies_pass($user_sig);
        }
        $user_sig = str_replace("
", "
<br />
", $user_sig);
    }
    $template->assign_block_vars('switch_user_sig_block', array());
}

# 
#-----[ FIND ]------------------------------------------ 
# 
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',

# 
#-----[ AFTER, ADD ]------------------------------------
# 
	'L_SIGNATURE' => $lang['Signature'],
    'USER_SIG' => $user_sig,

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

# 
#-----[ FIND ]------------------------------------------ 
# 
		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
		  <td> <b><span class="gen">{INTERESTS}</span></b></td>
		</tr>

# 
#-----[ AFTER, ADD ]------------------------------------
# 
        <!-- BEGIN switch_user_sig_block -->
		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_SIGNATURE}: </span></td>
		  <td> <span class="postbody">{USER_SIG}</span></td>
		</tr>
        <!-- END switch_user_sig_block -->
        
# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------- 
# 
# EoM
  • 這部份是有關MODs本身的版身資訊及功能介紹還有作者的名稱、電子郵件、個人網站等資料

代碼: 選擇全部

############################################################## 
## MOD Title: View Profile Sig
## MOD Author: netclectic < adrian@netclectic.com > (Adrian Cockbutn) http://www.netclectic.com 
## MOD Description: Adds the user's signature to their view profile page.
## MOD Version: 1.1.1
## 
## Installation Level: easy
## Installation Time: 3 Minutes 
## Files To Edit: (2) usercp_viewprofile.php, profile_view_body.tpl
## Included Files: n/a
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/
############################################################## 
## Author Notes: 
##
############################################################## 
## MOD History:
##     2003-11-07  - Version 1.1.1
##          - updated for 2.0.6 (no changes)
##          - removed the <b> </b> tags from around the signature.
##
##     xxxx-xx-xx  - Version 1.1.0
##          - Updated for 2.0.4 and fixed a problem with formatting of the signature.
##
##     xxxx-xx-xx  - Version 1.0.0
##          - First release.
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
  • 然後從

代碼: 選擇全部

# 
#-----[ OPEN ]------------------------------------------ 
#

代碼: 選擇全部

# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------- 
# 
# EoM
  • 都是修改步驟的內容流程
    接下來我們開始修改/加入MODs於phpBB2裡

代碼: 選擇全部

# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/usercp_viewprofile.php
  • OPEN 打開
    第一步就是開啟指定的檔案 
    以phpBB2為根目錄 尋找includes資料夾裡的usercp_viewprofile.php檔案
    用文字編輯軟體開啟該檔案後,進行下一步

代碼: 選擇全部

# 
#-----[ FIND ]------------------------------------------ 
# 
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
  • FIND 尋找
    接下來利用文字編輯軟體的搜尋文字功能\r
    尋找

代碼: 選擇全部

$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
  • 找到後 進行下一步加入程式碼的工作

代碼: 選擇全部

# 
#-----[ AFTER, ADD ]------------------------------------
# 
$user_sig = '';
if ( $profiledata['user_attachsig'] && $board_config['allow_sig'] )
{
    include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
    $user_sig = $profiledata['user_sig'];
    $user_sig_bbcode_uid = $profiledata['user_sig_bbcode_uid'];
	if ( $user_sig != '' )
    {
        if ( !$board_config['allow_html'] && $profiledata['user_allowhtml'] )
       	{
       		$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\\2>", $user_sig);
       	}
    	if ( $board_config['allow_bbcode'] && $user_sig_bbcode_uid != '' )
   		{
   			$user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
   		}
   		$user_sig = make_clickable($user_sig);

        if (!$userdata['user_allowswearywords'])
        {
            $orig_word = array();
            $replacement_word = array();
            obtain_word_list($orig_word, $replacement_word);
            $user_sig = preg_replace($orig_word, $replacement_word, $user_sig);
        }
        if ( $profiledata['user_allowsmile'] )
        {
            $user_sig = smilies_pass($user_sig);
        }
        $user_sig = str_replace("
", "
<br />
", $user_sig);
    }
    $template->assign_block_vars('switch_user_sig_block', array());
}
  • AFTER, ADD 之後, 加上
    請將這段程式碼
$user_sig = '';
if ( $profiledata['user_attachsig'] && $board_config['allow_sig'] )
{
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$user_sig = $profiledata['user_sig'];
$user_sig_bbcode_uid = $profiledata['user_sig_bbcode_uid'];
if ( $user_sig != '' )
{
if ( !$board_config['allow_html'] && $profiledata['user_allowhtml'] )
{
$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\\2>", $user_sig);
}
if ( $board_config['allow_bbcode'] && $user_sig_bbcode_uid != '' )
{
$user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
}
$user_sig = make_clickable($user_sig);

if (!$userdata['user_allowswearywords'])
{
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
$user_sig = preg_replace($orig_word, $replacement_word, $user_sig);
}
if ( $profiledata['user_allowsmile'] )
{
$user_sig = smilies_pass($user_sig);
}
$user_sig = str_replace("
", "
<br />
", $user_sig);
}
$template->assign_block_vars('switch_user_sig_block', array());
}
  • 加入於
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
  • 的下一行
    即為如下這樣
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
$user_sig = '';
if ( $profiledata['user_attachsig'] && $board_config['allow_sig'] )
{
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$user_sig = $profiledata['user_sig'];
$user_sig_bbcode_uid = $profiledata['user_sig_bbcode_uid'];
if ( $user_sig != '' )
{
if ( !$board_config['allow_html'] && $profiledata['user_allowhtml'] )
{
$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\\2>", $user_sig);
}
if ( $board_config['allow_bbcode'] && $user_sig_bbcode_uid != '' )
{
$user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
}
$user_sig = make_clickable($user_sig);

if (!$userdata['user_allowswearywords'])
{
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
$user_sig = preg_replace($orig_word, $replacement_word, $user_sig);
}
if ( $profiledata['user_allowsmile'] )
{
$user_sig = smilies_pass($user_sig);
}
$user_sig = str_replace("
", "
<br />
", $user_sig);
}
$template->assign_block_vars('switch_user_sig_block', array());
}
  • 再來開始下一循環

代碼: 選擇全部

# 
#-----[ FIND ]------------------------------------------ 
# 
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
  • FIND 尋找
    搜尋到

代碼: 選擇全部

'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
  • 指定尋找的代碼之後 往下一步前進

代碼: 選擇全部

# 
#-----[ AFTER, ADD ]------------------------------------
# 
	'L_SIGNATURE' => $lang['Signature'],
    'USER_SIG' => $user_sig,
  • AFTER, ADD 之後, 加上
    就是將
'L_SIGNATURE' => $lang['Signature'],
'USER_SIG' => $user_sig,
  • 加入於
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
  • 之後,即為如下
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
'L_SIGNATURE' => $lang['Signature'],
'USER_SIG' => $user_sig,
  • 再來,往下一個檔案前進

代碼: 選擇全部

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/profile_view_body.tpl
  • OPEN 打開
    以phpBB2為根目錄
    開啟在templates資料夾內subSilver資料夾內的profile_view_body.tpl檔案

代碼: 選擇全部

# 
#-----[ FIND ]------------------------------------------ 
# 
		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
		  <td> <b><span class="gen">{INTERESTS}</span></b></td>
		</tr>
  • FIND 尋找
    可以搜尋一些關鍵字來節省安裝所需的時間
    例如{INTERESTS}或者{L_INTERESTS}等被{}包住的代碼

代碼: 選擇全部

# 
#-----[ AFTER, ADD ]------------------------------------
# 
        <!-- BEGIN switch_user_sig_block -->
		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_SIGNATURE}: </span></td>
		  <td> <span class="postbody">{USER_SIG}</span></td>
		</tr>
        <!-- END switch_user_sig_block -->
  • AFTER, ADD 之後, 加上
    請將
<!-- BEGIN switch_user_sig_block -->
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_SIGNATURE}: </span></td>
<td> <span class="postbody">{USER_SIG}</span></td>
</tr>
<!-- END switch_user_sig_block -->
  • 加入於
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
<td> <b><span class="gen">{INTERESTS}</span></b></td>
</tr>
  • 的下一行,即如下
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
<td> <b><span class="gen">{INTERESTS}</span></b></td>
</tr>

<!-- BEGIN switch_user_sig_block -->
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_SIGNATURE}: </span></td>
<td> <span class="postbody">{USER_SIG}</span></td>
</tr>
<!-- END switch_user_sig_block -->
  • 再來往最後一個步驟前進

代碼: 選擇全部

# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------- 
# 
# EoM
  • SAVE/CLOSE ALL FILES 儲存/關閉所有檔案
    EoM 外掛修正結束

    這就是表示到此 該MODs已經裝到你的phpBB2檔案裡\r
    再來請將修改過的檔案上傳到你在網路上存放phpBB2論壇資料夾的空間裡\r
    就是俗稱的"上傳"
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

[教學] 如何輸入外掛所需的 SQL 語法?

文章 天霜 »

  • 如何得知要安裝的外掛是否需要輸入 SQL 語法來完成安裝?


    在安裝說明文件中,檢視是否有以下文字
    #
    #-----[ SQL ]-------------------------------------------------
    #
    有的話就表示除了修改完檔案後還要再輸入 SQL 語法來完成安裝

  • 那要如何輸入 SQL 語法?

    這我以 Forum Logo Selector MOD 這個外掛來做範例

    根據install_tw.txt文件說明
    #
    #-----[ 增加 SQL ]------------------------------------------
    #
    # 請記得修改成你的資料表名稱\r
    INSERT INTO `phpbb_config` VALUES ('logo_image_path', 'images/logo');
    INSERT INTO `phpbb_config` VALUES ('logo_image', 'subSilver.gif');
    INSERT INTO `phpbb_config` VALUES ('logo_image_w', '200');
    INSERT INTO `phpbb_config` VALUES ('logo_image_h', '91');
    這就表示我們要輸入四行語法來完成安裝

  • 什麼是"請記得修改成你的資料表名稱"?

    還記得你當時在安裝phpBB2時的畫面嗎?
    圖檔

    根據圖中紅框的資料來修改語法中的"phpbb_"
    如果你當時有再進行修改不是取phpbb_的話 例如你是取phpbb22_
    那麼語法要改成
    INSERT INTO `phpbb22_config` VALUES ('logo_image_path', 'images/logo');
    INSERT INTO `phpbb22_config` VALUES ('logo_image', 'subSilver.gif');
    INSERT INTO `phpbb22_config` VALUES ('logo_image_w', '200');
    INSERT INTO `phpbb22_config` VALUES ('logo_image_h', '91');
    接下來就是連到phpMyAdmin網頁來進行輸入語法的動作

    自機架設的話,其網址為\r
    http://localhost/phpMyAdmin/index.php

    localhost請自行換成你的網址

    如果你是租用空間的話,phpMyAdmin網址請自行去詢問你所承租的主機商

    不論是自機還是租用的,連到phpMyAdmin後會出現一個小畫面要你輸入phpMyAdmin的帳號及密碼\r

    輸入完後會進入以下畫面\r
    圖檔

  • 為何我進入後是英文介面?

    請在右邊 Language 下拉式選單中選擇Chinese traditional(zh-tw)
    圖檔

    接下來請在左邊的(資料庫...)下拉式選單中選擇你phpBB2所使用的資料庫名稱\r
    圖檔

  • 我忘記我當時安裝的資料庫名稱了,該怎麼辦?

    這時請開啟你phpBB2資料夾下的config.php
    內容裡的紅字就是你資料庫的名稱\r
    $dbname = 'dante_Rebellion';
    之後按下上方的 SQL 連結
    圖檔

    然後在空白處複製貼上說明文件中的語法,再按下"執行"
    圖檔

    然後就會出現以下的結果畫面\r
    圖檔

    這就表示你已成功輸入該外掛的語法,可以離開phpMyAdmin頁面了

  • 有些外掛例如Birthday、Gender、Custom mass PM等都是需要輸入 SQL 語法的
    但為何我沒在說明文件中看到 SQL 語法?


    有些外掛作者會考慮到有些使用者對於phpMyAdmin不大熟悉
    所以他們會在外掛包理附加一個"執行檔"
    通常檔案名稱是db_update.php、install.php等
    像是Advanced Links Mod 1.2.2就是links_install.php
    Birthday則是birthday_db_update.php

    此外也有升級用的"執行檔"
    例如EasySite 1.3.0裡的db_update_111-130.php是給已安裝EasySite 1.1.1.的人升級到1.3.0用的

    將執行檔上傳到phpBB2目錄下
    然後以管理員的身份登入後,在網址輸入(以birthday做範例)
    http://(你的網址)/(你的phpBB2資料夾名稱)/birthday_db_update.php

    例:http://MyHome/phpBB2/birthday_db_update.php

    按下 Enter 按鈕就會看到以下畫面就是成功了!
    圖檔

    之後安全性上的考量,在執行完後請記得刪除"執行檔"
最後由 天霜 於 2004-12-19 17:48 編輯,總共編輯了 2 次。
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

文章 天霜 »

  • 如何確定外掛的語法有正確執行?

    如果你是使用作者提供的執行檔來輸入語法

    這裡以Cash Mod 2.2.1做範例
    那麼在執行畫面後可看到是否有成功輸入語法
    圖中的綠色英文"Successfull"
    就表示已成功輸入 SQL 語法到資料庫\r
    圖檔


    但如果是以下畫面\r
    顯示紅色英文"Error"
    圖檔

    就表示語法輸入錯誤,你可能已輸入過這些語法

  • 如何檢查語法是否已輸入到資料庫?
    這時請進入phpMyAdmin網頁後,再進入你論壇使用的資料庫\r
    然後根據作者提供的sql_221.txt文件來檢查是否有輸入語法
    #
    #-----[ SQL ]------------------------------------------
    #
    # If you don't know how to execute sql queries, then copy
    # sql_install.php into your phpbb directory and run it.
    # (assuming you use mysql or mssql)
    #
    # If you don't use mysql or mssql, you'll have to edit these queries accordingly
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable',0);
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_display_after_posts',1);
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_post_message','You earned %s for that post');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable_spam_num',10);
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable_spam_time',24);
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable_spam_message','You have exceeded the alloted amount of posts and will not earn anything for your post');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_installed','yes');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_version','2.2.1');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_adminbig','0');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_adminnavbar','1');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('points_name','Points');
    這部份是在phpbb_config資料表內輸入新記錄
    所以按下phpbb_config左邊的瀏覽圖示\r
    圖檔

    直接跳到最後一頁後(越新加入的語法越後面)
    這時對照內容是否與文件中相符合
    圖檔
    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash (
    cash_id smallint(6) NOT NULL auto_increment,
    cash_order smallint(6) NOT NULL default '0',
    cash_settings smallint(4) NOT NULL default '3313',
    cash_dbfield varchar(64) NOT NULL default '',
    cash_name varchar(64) NOT NULL default 'GP',
    cash_default int(11) NOT NULL default '0',
    cash_decimals tinyint(2) NOT NULL default '0',
    cash_imageurl varchar(255) NOT NULL default '',
    cash_exchange int(11) NOT NULL default '1',
    cash_perpost int(11) NOT NULL default '25',
    cash_postbonus int(11) NOT NULL default '2',
    cash_perreply int(11) NOT NULL default '25',
    cash_maxearn int(11) NOT NULL default '75',
    cash_perpm int(11) NOT NULL default '0',
    cash_perchar int(11) NOT NULL default '20',
    cash_allowance tinyint(1) NOT NULL default '0',
    cash_allowanceamount int(11) NOT NULL default '0',
    cash_allowancetime tinyint(2) NOT NULL default '2',
    cash_allowancenext int(11) NOT NULL default '0',
    cash_forumlist varchar(255) NOT NULL default '',
    PRIMARY KEY (cash_id)
    );

    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash_events (
    event_name varchar(32) NOT NULL default '',
    event_data varchar(255) NOT NULL default '',
    PRIMARY KEY (event_name)
    );

    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash_exchange (
    ex_cash_id1 int(11) NOT NULL default '0',
    ex_cash_id2 int(11) NOT NULL default '0',
    ex_cash_enabled int(1) NOT NULL default '0',
    PRIMARY KEY (ex_cash_id1,ex_cash_id2)
    );

    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash_groups (
    group_id mediumint(6) NOT NULL default '0',
    group_type tinyint(2) NOT NULL default '0',
    cash_id smallint(6) NOT NULL default '0',
    cash_perpost int(11) NOT NULL default '0',
    cash_postbonus int(11) NOT NULL default '0',
    cash_perreply int(11) NOT NULL default '0',
    cash_perchar int(11) NOT NULL default '0',
    cash_maxearn int(11) NOT NULL default '0',
    cash_perpm int(11) NOT NULL default '0',
    cash_allowance tinyint(1) NOT NULL default '0',
    cash_allowanceamount int(11) NOT NULL default '0',
    cash_allowancetime tinyint(2) NOT NULL default '2',
    cash_allowancenext int(11) NOT NULL default '0',
    PRIMARY KEY (group_id,group_type,cash_id)
    );

    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash_log (
    log_id int(11) NOT NULL auto_increment,
    log_time int(11) NOT NULL default '0',
    log_type smallint(6) NOT NULL default '0',
    log_action varchar(255) NOT NULL default '',
    log_text varchar(255) NOT NULL default '',
    PRIMARY KEY (log_id)
    );
    這部份是直接新增資料表\r
    所以在主畫面就可檢查是否相符合
    圖檔

  • 是先輸入語法還是先安裝外掛?
    這我個人是建議先輸入語法再安裝外掛後上傳檔案,就是輸入完語法後再上傳檔案(這期間強烈建議暫時關閉論壇,避免發生不可預測的問題)

  • 同樣的語法再執行一次會不會出問題?
    有些語法再執行一次不會對資料庫造成影響,但有的語法卻有可能造成影響\r
    如果不小心再度執行,然後論壇有出現異狀,建議先刪除該語法所輸入的記錄或資料表再重新輸入看看

  • 如果語法的資料庫格式不同輸入會不會有影響?
    這一定會出問題而無法輸入語法,就算能成功輸入,也難保不會對外掛的功能產生影響\r
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[補充]風格檔與語言檔的修改注意事項

文章 心靈捕手 »

因為 天霜 大大的這篇主題, 算是一般新手接觸外掛時, 所必熟讀者,
所以在此補充, 關於安裝外掛時, 風格檔與語言檔的修改注意事項.


1. 風格檔 (templates/subSilver/...) 的修改

即使您的論壇, 並非採用預設風格 subSilver 為主,
但是安裝外掛, 建議先以預設風格 subSilver 試裝, 較易獲致成功, 建立信心.

因為一般外掛的安裝說明, 關於風格檔的修改, 都是以風格 subSilver 為例;
一旦安裝成功之後, 再套用在其他風格的修改, 自然也就比較容易靈活運用.

若要將外掛運用至新的風格,
則安裝此外掛, 所需要上傳和修改的風格檔案, 一個也不能少.



2. 語言檔 (language/lang_english/...) 的修改

由於一般外掛的新增語言檔, 或安裝說明中的新增語言代碼, 大都以英文語系 (lang_english) 為主,
所以在安裝時, 必須自行將其轉為中文語系 (lang_chinese_traditional_taiwan).

另外, 若是您的中文論壇語系是採用 utf-8 編碼的話,
則您必須將新增語言檔或新增語言代碼, 也轉換 utf-8 編碼
,
否則, 將會出現空白頁或亂碼等現象.

那是因為目前大部分的外掛, 如果附帶有中文語系的新增語言檔,
或新增語言代碼的話, 大都採用 big5 編碼的緣故.

ps.
A. [推薦] 好用轉 (utf-8) 碼工具:
1. 用 ConvertZ 來轉碼 (UTF-8 預設, 未含 BOM)
下載位址:
http://alf-li.pcdiscuss.com/c_convertz.html

2. 用 EmEditor 來轉碼 (UTF-8 預設, 含 BOM)
只要 '另存新檔' 時, 選擇編碼 'UTF-8' (不要加入 BOM), 即可轉碼成功.
下載位址:
http://www.softking.com.tw/soft/clickco ... ?fid3=2749


B. 判斷 (設定) 論壇語系編碼的方法:
打開
language/lang_chinese_traditional_taiwan/lang_main.php

找到
$lang['ENCODING']

若是

代碼: 選擇全部

$lang['ENCODING'] = 'big5';

則語系編碼為 big5

若是

代碼: 選擇全部

$lang['ENCODING'] = 'utf-8';

則語系編碼為 utf-8


C. 何謂 'BOM'?
1. 確認取消勾選「加BOM到UTF-8檔案」
http://phpbb-tw.net/phpbb/viewtopic.php?p=210471#210471
2. 何謂 'BOM'?
http://phpbb-tw.net/phpbb/viewtopic.php?p=211017#211017
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
主題已鎖定

回到「2.0」