代碼: 選擇全部
##############################################################
## 外掛名稱: 進階版主題類型
## 外掛作者: 御津闇慈 <zxery3@hotmail.com> http://imoml.winme.idv.tw
## 外掛說明: 主題類型的進階版,系統管理員可以從基本組態中設定主題類型
## 並且將強制主題類型功能附加上去
##
## 安裝難度: 簡單
## 安裝時間: 10 分鐘
##
## 需要編輯的檔案:7
## posting.php
## privmsg.php
## admin/admin_forums.php
## template/subSilver/posting_body.tpl
## template/subSilver/admin/forum_edit_body.tpl
## language/lang_chinese_traditional_taiwan/lang_admin.php
## language/lang_chinese_traditional_taiwan/lang_main.php
##
## 附加的檔案: n/a
##
## 附?加的圖示: n/a
##
##############################################################
## 在增加此外掛前, 請務必備份所有需要修改的檔案
##############################################################
#
#-----[ ADD SQL ]------------------------------------------
#
//在phpbb_config這個資料表增加budget_types這個名稱
INSERT INTO phpbb_config (config_name , config_value) VALUES ('budget_types', '');
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
//
// Include page header
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//Topic type mod
$topictypes = explode(",",$board_config['budget_types']);
$ttopions = '';
foreach ($topictypes as $topictype)
{
$ttoptions .= '<option value="' . $topictype . ' ">' . $topictype . "</option>\n";
}
$template->assign_vars(array(
'L_TOPIC_TYPES_EXPLAIN' => $lang['topic_types_explain'],
'TOPIC_TYPES'
=> $ttoptions)
);
//發表新文章的時候才會出現主題類型
if($mode == 'newtopic' && $board_config['budget_types']!='')
{
$template->assign_block_vars('switch_topictypes', array());
$typeserror = $lang['Types_Error'];
}else{
$typeserror = "false";
}
//Topic type mod end
#
#-----[ FIND ]------------------------------------------
#
'SMILIES_STATUS' => $smilies_status,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'TYPESERROR' => $typeserror,
#
#-----[ OPEN ]------------------------------------------
#
privmsg.php
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('switch_privmsg', array());
#
#-----[ AFTER, ADD ]------------------------------------------
#
$typeserror = "false";
#
#-----[ FIND ]------------------------------------------
#
'FORUM_NAME' => $lang['Private_Message'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'TYPESERROR' => $typeserror,
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
"L_RESET" => $lang['Reset'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"BUDGET_TYPE" => $lang['Budget_Type'], // Budget_Types
"L_BUDGET_TYPES" => $lang['Budget_Types'], // Budget_Types
"BUDGET_TYPES" => $new['budget_types'], // Budget_Types
#
#-----[ OPEN ]------------------------------------------
#
template/subSilver/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
if (document.post.message.value.length < 2) {
formErrors = "{L_EMPTY_MESSAGE}";
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
if(document.post.subject.value != '' && (document.post.subject.value.charAt(0) != '[' || document.post.subject.value.lastIndexOf('] ') == -1) && document.post.subject.value.substring(0, 3) != 'Re:')
{
formErrors = {TYPESERROR};
}
#
#-----[ FIND ]------------------------------------------
#
<!-- END switch_privmsg -->
<tr>
<td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
<td class="row2" width="78%"> <span class="gen">
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN switch_topictypes -->
<select onchange="document.post.subject.focus(); document.post.subject.value = this.options[this.selectedIndex].value + document.post.subject.value;">
<option selected value="">{L_TOPIC_TYPES_EXPLAIN}</option>
{TOPIC_TYPES}
</select>
<!-- END switch_topictypes -->
#
#-----[ OPEN ]------------------------------------------
#
template/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_ENABLE_PRUNE}</td>
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES}&&<input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr><!-- Budget_Types_MOD -->
<th class="thHead" colspan="2">{BUDGET_TYPE}</th>
</tr>
<tr>
<td class="row1" valign="top">{L_BUDGET_TYPES}</td>
<td class="row2""><textarea name="budget_types" rows="5" cols="60" maxlength="255">{BUDGET_TYPES}</textarea></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['topic_types_explain'] = '主題類型';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Forum_topictypes'] = '這個版面的主題類型';
$lang['Types_Error'] = '"必需選擇 [主題類型] + 空格 + 主題名稱。"';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Budget_Type'] = '主題類型'; // Budget_Type
$lang['Budget_Types'] = '主題類型(請以逗號分類)'; // Budget_Types
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# eom