先用phpMyAdmin進入你的phpBB2資料庫中
執行下面這一段SQL語法
ALTER TABLE `phpbb_forums` ADD `forum_autolock` TINYINT( 2 ) DEFAULT '0' NOT NULL ;
或是\r
找到你的phpbb_forums資料表\r
在最後面新增一個叫做forum_autolock的欄位
資料型態為TINYINT
長度是2
Null是not null
預設值是0
以下有5個檔案要修改\r
依我寫的順序為\r
posting.php
includes/functions_post.php
admin/admin_forums.php
templates/*/admin/forum_edit_body.tpl
language/lang_chinese_traditional_taiwan/lang_admin.php
代碼: 選擇全部
#
#-----[ OPEN ]-------------------------------------------------
#
posting.php
#
#-----[ FIND ]--------------------------------------------------
#
$bbcode_uid = '';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$forum_autolock = $post_info['forum_autolock'];
#
#-----[ FIND ]--------------------------------------------------
#
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id,
#
#-----[ IN-LINE FIND ]-----------------------------------------
#
, $fp_data
#
#-----[ IN-LINE AFTER, ADD ]--------------------------------
#
, $forum_autolock
#
#-----[ OPEN ]--------------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]--------------------------------------------------
#
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id,
#
#-----[ IN-LINE FIND ]-----------------------------------------
#
&$poll_length,
#
#----[ IN_LINE AFTER, ADD ]---------------------------------
#
&$forum_autolock
#
#-----[ FIND ]--------------------------------------------------
#
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster,
#
#-----[ IN-LINE FIND ]-----------------------------------------
#
" . TOPIC_UNLOCKED . "
#
#-----[ REPLACE ]----------------------------------------------
#
$forum_autolock
#
#-----[ OPEN ]--------------------------------------------------
#
admin/admin_forums.php
#
#-----[ FIND ]---------------------------------------------------
#
$forumstatus = $row['forum_status'];
#
#-----[ AFTER, ADD ]-------------------------------------------
#
if ( $row['forum_autolock'] )
{
$forumautolock_enabled = "checked=\"checked\"";
}
else
{
$forumautolock_enabled = '';
}
#
#-----[ FIND ]---------------------------------------------------
#
'L_FORUM_STATUS' => $lang['Forum_status'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_FORUM_AUTOLOCK' => $lang['Forum_autolock'],
'S_FORUMAUTOLOCK_ENABLED' => $forumautolock_enabled,
#
#-----[ FIND ]---------------------------------------------------
#
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc,
#
#-----[ IN-LINE FIND ]-----------------------------------------
#
forum_status,
#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
forum_autolock,
#The next line
#-----[ IN-LINE FIND ]-----------------------------------------
#
" . intval($HTTP_POST_VARS['forumstatus']) . ",
#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
" . intval($HTTP_POST_VARS['forumautolock']) . ",
#
#-----[ FIND ]---------------------------------------------------
#
SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "',
#
#-----[ IN-LINE FIND ]-----------------------------------------
#
, prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
#
#-----[ IN-LINE AFTER. ADD ]---------------------------------
#
, forum_autolock = " . intval($HTTP_POST_VARS['forumautolock']) . "
#
#-----[ OPEN ]---------------------------------------------------
#
templates/*/admin/forum_edit_body.tpl
#
#-----[ FIND ]---------------------------------------------------
#
<td class="row2"><select name="forumstatus">{S_STATUS_LIST}</select></td>
</tr>
#
#-----[ AFTER, ADD ]-------------------------------------------
#
<tr>
<td class="row1">{L_FORUM_AUTOLOCK}</td>
<td class="row2">{L_ENABLED}<input type="checkbox" name="forumautolock" value="1" {S_FORUMAUTOLOCK_ENABLED}></td>
</tr>
#
#-----[ OPEN ]--------------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_admin.php
#
#-----[ FIND ]--------------------------------------------------
#
$lang['Forum_status'] = '版面狀態';
#
#-----[ AFTER, ADD ]-----------------------------------------
#
$lang['Forum_autolock'] = '自動鎖定文章';
#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------------
#
#EoM
完成....XD
好長啊.....= ="""
效果如下:
1.如果本版面的"自動鎖定文章"是開啟的,那麼新PO的文章都會是鎖定狀態。
2.可在後台設定"自動鎖定文章"是否開啟。進入後台,選擇「版面管理」->「管理選項」,找一下你想更改狀態的版面,點下編輯,就可以看到了。
希望有解決你的問題...XD