- 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
就是俗稱的"上傳"