[phpBB]外掛安裝教學

網站架設,免費空間申請,架站技術交流區
Martinet
 

[phpBB]外掛安裝教學

文章Martinet » 2005-02-22 11:09 am

幾百年前我寫的教學... :lol:
在竹貓還是被置頂的=0=...

--------------------------------------------------------------------------------
幾百年前的M 寫:我也是這幾天才參悟的.....當個參考吧~(我悟了兩個月都悟不出來...前天終於看懂啦...)

這裡以BBCode button Mod 作為範例 :

########################################################
## Mod Title: Multiple BBCode MOD
## Mod Version: 1.0.1
## Rev Date: February 3, 2003
##
## Mod Author: Nuttzy < pktoolkit@blizzhackers.com > (n/a) http://www.blizzhackers.com
##
## Mod Description: Allows you to install BBCode MODs that
## add quick BBCode buttons in post edits. Without this
## MOD, there is no standard way of installing BBCode MODs.
##
## Installation Level: EASY
## Installation Time: 2 minutes
## Files To Edit: Two (2)
## posting.php
## templates/subSilver/posting_body.tpl
########################################################
##
## Installation Notes:
##
## + Works with phpBB 2.0.2 thru 2.0.4
## + Do NOT install if you have EasyMod installed
##
## Version History:
## 02/03/03 - updated for 2.0.4
## + no code changes required, just updated the header info
##
## 08/31/02 - initial release
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ 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/downloads/
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


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

#
#-----[ FIND ]---------------------------------
#
# NOTE: the full line to look for is:
# make_jumpbox('viewforum.'.$phpEx);
#
make_jumpbox(
在裡面尋找make_jumpbox(
ps. 正確找到的字串是
代碼: 選擇全部
make_jumpbox('viewforum.'.$phpEx);



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

// EASYMOD-begin
//NOTE: the first element of each array must be '' Add new elements AFTER the ''
$EMBB_keys = array('') ;
$EMBB_widths = array('') ;
$EMBB_values = array('') ;

for ($i=1; $i<count($EMBB_values); $i++)
{
// EasyMod BBcode mods
$val = ($i*2)+16 ;
$template->assign_block_vars('EasyModBB', array(
'KEY' => $EMBB_keys[$i],
'NAME' => "addbbcode$val",
'WIDTH' => $EMBB_widths[$i],
'VALUE' => $EMBB_values[$i],
'STYLE' => "bbstyle($val)")
);
}
// EASYMOD-end

在 make_jumpbox('viewforum.'.$phpEx); 後面加上 :

代碼: 選擇全部
// EASYMOD-begin
//NOTE: the first element of each array must be ''   Add new elements AFTER the ''
$EMBB_keys = array('') ;
$EMBB_widths = array('') ;
$EMBB_values = array('') ;

for ($i=1; $i<count($EMBB_values); $i++)
{
   // EasyMod BBcode mods
   $val = ($i*2)+16 ;
   $template->assign_block_vars('EasyModBB', array(
      'KEY' => $EMBB_keys[$i],
      'NAME' => "addbbcode$val",
      'WIDTH' => $EMBB_widths[$i],
      'VALUE' => $EMBB_values[$i],
      'STYLE' => "bbstyle($val)")
   );
}
// EASYMOD-end



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

打開templates/subSilver/posting_body.tpl

#
#-----[ FIND ]---------------------------------
#
# NOTE: the full line to look for is:
# <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
# </span></td>
#
name="addbbcode16"
尋找 name="addbbcode16"
ps. 找到的完整句子應該看起來像這樣
代碼: 選擇全部
<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />


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

<!-- BEGIN EasyModBB -->
<td><span class="genmed">
<input type="button" class="button" accesskey="{EasyModBB.KEY}" name="{EasyModBB.NAME}" value="{EasyModBB.VALUE}" style="width: {EasyModBB.WIDTH}px" onClick="{EasyModBB.STYLE}" onMouseOver="helpline('{EasyModBB.KEY}')" />
</span></td>
<!-- END EasyModBB -->
在後面加上
代碼: 選擇全部
<!-- BEGIN EasyModBB -->
         <td><span class="genmed">
           <input type="button" class="button" accesskey="{EasyModBB.KEY}" name="{EasyModBB.NAME}" value="{EasyModBB.VALUE}" style="width: {EasyModBB.WIDTH}px" onClick="{EasyModBB.STYLE}" onMouseOver="helpline('{EasyModBB.KEY}')" />
           </span></td>
         <!-- END EasyModBB -->

#
#-----[ FIND ]---------------------------------
#
# NOTE: the full line to look for is:
# <select name="addbbcodefontcolor" onChange="bbfontstyle('[color=' + this.form.addbbcodefontcolor.options[this.form.addbbcodefontcolor.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">
#
name="addbbcode18"

尋找name="addbbcode18"
ps.整行看起來應該是這個樣子 :
代碼: 選擇全部
<select name="addbbcodefontcolor" onChange="bbfontstyle('[color=' + this.form.addbbcodefontcolor.options[this.form.addbbcodefontcolor.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">



#
#-----[ IN-LINE FIND ]---------------------------------
#
name="addbbcode18"

[color=red]在同一行的地方找到
name="addbbcode18"

#
#-----[ IN-LINE REPLACE ]---------------------------------
#
name="addbbcodefontcolor"

將他取代為name="addbbcodefontcolor"
#
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode18.options
在同一行裡找到this.form.addbbcode18.options

#
#-----[ IN-LINE REPLACE ]---------------------------------
#
this.form.addbbcodefontcolor.options

將他取代為this.form.addbbcodefontcolor.options
#
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode18.selectedIndex
在同一行裡找到this.form.addbbcode18.selectedIndex

#
#-----[ IN-LINE REPLACE ]---------------------------------
#
this.form.addbbcodefontcolor.selectedIndex

將他取代為this.form.addbbcodefontcolor.selectedIndex
#
#-----[ FIND ]---------------------------------
#
# NOTE: the full line to look for is:
# </select> &{L_FONT_SIZE}:<select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">
#
name="addbbcode20"

找到name="addbbcode20"
整段看起來應該是這樣子
代碼: 選擇全部
</select> &{L_FONT_SIZE}:<select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">

#
#-----[ IN-LINE FIND ]---------------------------------
#
name="addbbcode20"

在同一行裡找到name="addbbcode20"
#
#-----[ IN-LINE REPLACE ]---------------------------------
#
name="addbbcodefontsize"
將他取代為name="addbbcodefontsize"

#
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode20.options

在同一行裡找到this.form.addbbcode20.options
#
#-----[ IN-LINE REPLACE ]---------------------------------
#
this.form.addbbcodefontsize.options

將他取代為this.form.addbbcodefontsize.options
#
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode20.selectedIndex

在同一行裡找到this.form.addbbcode20.selectedIndex

#
#-----[ IN-LINE REPLACE ]---------------------------------
#
this.form.addbbcodefontsize.selectedIndex
將他取代成this.form.addbbcodefontsize.selectedIndex

#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------------
#
# EoM

將全部檔檔案存檔並關起來




回到 架站討論

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 8 位訪客