[外掛]主題類型分區劃

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
御津闇慈
竹貓忠實會員
竹貓忠實會員
文章: 645
註冊時間: 2001-11-17 10:59

[外掛]主題類型分區劃

文章 御津闇慈 »

代碼: 選擇全部

######################################################## 
## 外掛名稱:      主題類型分區劃 (資料庫版 by Martinet) 
## 外掛版本:      2.0.0 
## 外掛原作者:    炎之虛空(御津闇慈) 
## 外掛強化者:    炎之虛空(御津闇慈) <http://imoml.phpbb-tw.com/> 
## 外掛資料庫化 : Martinet Oaf <oafwork@hotmail.com> 
## 
## 外掛描述:    這個外掛可以讓管理員在控制台中指定各個討論版發表主題的主題類型 , 
##      讓會員不會在版面上使用到錯誤的主題類型 
##      並且新增?#91;"主題分類功能" 
## 
## 安裝難度:      簡單 
## 安裝時間:      5 分鐘 
## 
## 需要編輯的檔案:   9 
## viewforum.php 
## posting.php 
## template/你的風格/posting_body.tpl 
## includes/constants.php 
## admin/admin_forums.php 
## template/你的風格/viewforum_body.tpl 
## template/你的風格/admin/forum_edit_body.tpl 
## language/你的語言/lang_admin.php 
## language/你的語言/lang_main.php 
## 
## 附?#91;的檔案:       n/a 
## 
## 附?#91;的圖示:      n/a 
## 
############################################################## 
## 在增?#91;此外掛前, 請務必備份所有需要修改的檔案 
############################################################## 

由於有些是中途改出來的 , 若有錯誤請通知我修改一下^^ 

# 
#-----[ ADD SQL ]------------------------------------------ 
# 

ALTER TABLE `phpbb_forums` ADD `forum_topictypes` VARCHAR( 255 ) DEFAULT '' NOT NULL 

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

posting.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

// 
// Include page header 
// 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

//Topic type mod 
$topictypes =  explode(",",$post_info['forum_topictypes']); 

$ttopions = ''; 
foreach ($topictypes as $topictype) 
   { 
      $ttoptions .= '<option value="' . $topictype . '">' . $topictype . "</option>
"; 
   } 
   $template->assign_vars(array( 
      'L_TOPIC_TYPES_EXPLAIN' => $lang['topic_types_explain'], 
      'TOPIC_TYPES' 
          
            => $ttoptions) 
   ); 
//沒主題類型的時候關閉 
if($post_info['forum_topictypes']!='') 
{ 
$template->assign_block_vars('switch_topictypes', array()); 
} 
//Topic type mod end 

# 
#-----[ OPEN ]------------------------------------------ 
# 
viewforum.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$select_topic_days .= '</select>'; 

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

//types 
if($forum_row['forum_topictypes'] != '') 
{ 
if ( empty($HTTP_POST_VARS['types']) || empty($HTTP_GET_VARS['types']) ) 
{ 
   $types_id = ( !empty($HTTP_POST_VARS['types']) ) ? $HTTP_POST_VARS['types'] : $HTTP_GET_VARS['types']; 

   $topictypes =  explode(",",$forum_row['forum_topictypes']); 

   $types = $topictypes[$types_id].'%'; 

   $sql = "SELECT COUNT(t.topic_id) AS forum_topics 
      FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p 
      WHERE t.forum_id = $forum_id 
      AND p.post_id = t.topic_last_post_id 
      AND t.topic_title LIKE '$types' 
      $limit_topics_time"; 

   if ( !($result = $db->sql_query($sql)) ) 
   { 
      message_die(GENERAL_ERROR, 'Could not obtain limited topics count information', '', __LINE__, __FILE__, $sql); 
   } 
   $row = $db->sql_fetchrow($result); 

   $topics_count = ( $row['forum_topics'] ) ? $row['forum_topics'] : 1; 
   $limit_topic_types = "AND t.topic_title LIKE '$types'"; 

   if ( !empty($HTTP_POST_VARS['types']) ) 
   { 
      $start = 0; 
   } 
} 
   $topictypes =  explode(",",$forum_row['forum_topictypes']); 

   $select_topic_types = '<table border="0" cellpadding="1" cellspacing="1" width="75%" class="forumline"><tr><td class="row1" colspan="2" height="20"><b><a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id) . '">'.$lang['All_Topics'].'</a>'; 

   for($i=0;$i<count($topictypes);$i++) 
   { 
      $select_topic_types .= '|<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&start=0&" . POST_TYEPS_URL . "=".$i) . '">' . $topictypes[$i] . "</a>"; 
   } 
   $select_topic_types .='</b></td></tr></table>'; 
} 
//types 

# 
#-----[ FIND ]------------------------------------------ 
# 

$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username 
   FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2 
   WHERE t.forum_id = $forum_id 
      AND t.topic_poster = u.user_id 
      AND p.post_id = t.topic_last_post_id 
      AND p.poster_id = u2.user_id 

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

      $limit_topic_types 

# 
#-----[ FIND ]------------------------------------------ 
# 

$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time 
   FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2 
   WHERE t.forum_id = $forum_id 
      AND t.topic_poster = u.user_id 
      AND p.post_id = t.topic_first_post_id 
      AND p2.post_id = t.topic_last_post_id 
      AND u2.user_id = p2.poster_id 
      AND t.topic_type <> " . POST_ANNOUNCE . " 
      $limit_topics_time 

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

      $limit_topic_types 
# 
#-----[ FIND ]------------------------------------------ 
# 

'FOLDER_ANNOUNCE_NEW_IMG' => $images['folder_announce_new'], 

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

'TYPES' => $select_topic_types, 

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

# 
#-----[ FIND ]------------------------------------------ 
# 

define('POST_FORUM_URL', 'f'); 

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

define('POST_TYEPS_URL', 'types'); 

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_forums.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$forumstatus = $row['forum_status']; 

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

$forum_topictypes = $row['forum_topictypes']; 
找到 
$forumstatus = FORUM_UNLOCKED; 
            $forum_id = ''; 
            $prune_enabled = ''; 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

$forum_topictypes = ''; 

# 
#-----[ FIND ]------------------------------------------ 
# 

'S_PRUNE_ENABLED' => $prune_enabled, 

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

'S_FORUM_TOPICTYPES' => $forum_topictypes, 

# 
#-----[ FIND ]------------------------------------------ 
# 

'L_DAYS' => $lang['Days'], 

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

'L_FORUM_TOPICTYPES' => $lang['Forum_topictypes'], 

# 
#-----[ FIND ]------------------------------------------ 
# 

$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ") 
   VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")"; 

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 

prune_enable 

# 
#-----[ IN-LINE, AFTER, ADD ]------------------------------------------ 
# 

, forum_topictypes 

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 

$value_sql 

# 
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------ 
# 

",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'". 



# 
#-----[ FIND ]------------------------------------------ 
# 

$sql = "UPDATE " . FORUMS_TABLE . " 
   SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . " 
   WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]); 

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 

prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . " 

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 

,forum_topictypes = '".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."' 

# 
#-----[ OPEN ]------------------------------------------ 
# 
template/你的風格/posting_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 

<!-- END switch_privmsg --> 
\n<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 ]------------------------------------------ 
# 

<!-- TopicTypes Mod --> 
<!-- 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 --> 
<!-- End Mod --> 

# 
#-----[ OPEN ]------------------------------------------ 
# 
template/你的風格/viewforum_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 

  <table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline"> 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

  {TYPES} 

# 
#-----[ OPEN ]------------------------------------------ 
# 
template/你的風格/admin/forum_edit_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 

<tr> 
   <td class="row1">{L_FORUM_NAME}</td> 
   <td class="row2"><input type="text" size="25" name="forumname" value="{FORUM_NAME}" class="post" /></td> 
   </tr> 

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

<tr> 
   <td class="row1">{L_FORUM_TOPICTYPES}</td> 
   <td class="row2"><input type="text" size="45" name="topictypes" value="{S_FORUM_TOPICTYPES}" class="post" /></td> 
   </tr> 

# 
#-----[ OPEN ]------------------------------------------ 
# 
language/你的語言/lang_admin.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

// 
// That's all Folks! 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

$lang['Forum_topictypes'] = '這個版面的主題類型'; 

# 
#-----[ OPEN ]------------------------------------------ 
# 
language/你的語言/lang_main.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

// 
// That's all Folks! 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

$lang['topic_types_explain'] = '主題類型'; 
$lang['All_Topics'] = '所有主題'; 

###############EOM 存檔結束##############
御津闇慈
竹貓忠實會員
竹貓忠實會員
文章: 645
註冊時間: 2001-11-17 10:59

文章 御津闇慈 »

代碼: 選擇全部

######################################################## 
## 外掛名稱:      主題類型分區劃 (資料庫版 by Martinet) 2.0.1 升級檔
## 外掛版本:      2.0.1 
## 外掛原作者:    炎之虛空(御津闇慈) 
## 外掛強化者:    炎之虛空(御津闇慈) <http://imoml.phpbb-tw.com/> 
## 外掛資料庫化 : Martinet Oaf <oafwork@hotmail.com> 
## 
## 外掛描述:    這個外掛可以讓管理員在控制台中指定各個討論版發表主題的主題類型 , 
##      讓會員不會在版面上使用到錯誤的主題類型 
##      並且新增?#91;"主題分類功能" 
##      2005/12/29新增?#91;預?#93;主題功能(感謝吉川拓?#93;建議)
## 
## 升級難度:      簡單 
## 升級時間:      5 分鐘 
## 
## 需要編輯的檔案:   6 
## viewforum.php 
## posting.php  
## admin/admin_board.php 
## admin/admin_forums.php 
## template/你的風格/board_config_body.tpl   
## language/你的語言/lang_admin.php 
## 
## 附?#91;的檔案:       n/a 
## 
## 附?#91;的圖示:      n/a 
## 
############################################################## 
## 在增?#91;此外掛前, 請務必備份所有需要修改的檔案 
############################################################## 
# 
#-----[ ADD SQL ]------------------------------------------ 
#

INSERT INTO phpbb_config (config_name , config_value) VALUES ('budget_types', ''); 

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

posting.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$topictypes = explode(",",$post_info['forum_topictypes']); 

# 
#-----[ REPLACE ]------------------------------------------ 
# 

if($post_info['forum_topictypes'] == '' && $board_config['budget_types'] != '')
{
$topictypes = explode(",",$board_config['budget_types']); 
}else{
$topictypes = explode(",",$post_info['forum_topictypes']); 
}

# 
#-----[ FIND ]------------------------------------------ 
# 

if($post_info['forum_topictypes']!='')

# 
#-----[ REPLACE ]------------------------------------------ 
# 

if(($mode == 'newtopic' && $board_config['budget_types'] != '')||($mode == 'newtopic' && $board_config['budget_types'] != ''))

# 
#-----[ OPEN ]------------------------------------------ 
# 
viewforum.php 

# 
#-----[ FIND ]------------------------------------------ 
#

if($forum_row['forum_topictypes']!='')

# 
#-----[ REPLACE ]------------------------------------------ 
# 

if($forum_row['forum_topictypes']!='' || $board_config['budget_types']!='')

# 
#-----[ FIND ]------------------------------------------ 
# 

	$topictypes = explode(",",$forum_row['forum_topictypes']); 

# 
#-----[ REPLACE ]------------------------------------------ 
# 

	if($forum_row['forum_topictypes'] =='' && $board_config['budget_types'] !='')
	{
	$topictypes = explode(",",$board_config['budget_types']); 
	}else{
	$topictypes = explode(",",$forum_row['forum_topictypes']); 
	}

# 
#-----[ FIND ]------------------------------------------ 
# 

	$topictypes = explode(",",$forum_row['forum_topictypes']); 

# 
#-----[ REPLACE ]------------------------------------------ 
# 

	if($forum_row['forum_topictypes'] =='' && $board_config['budget_types'] !='')
	{
	$topictypes = explode(",",$board_config['budget_types']); 
	}else{
	$topictypes = explode(",",$forum_row['forum_topictypes']); 
	}

# 
#-----[ 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/你的風格/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_admin.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$lang['Forum_topictypes'] = '這個版面的主題類型';

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

$lang['Budget_Type'] = '預?#93;主題'; // Budget_Type 
$lang['Budget_Types'] = '預?#93;主題類型(請以逗號分類)'; // Budget_Types
$lang['Forum_Budget_Types'] = '假如沒?#93;定的話將會以預?#93;主題為主(請到基本組態?#93;定)'; // Budget_Types

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_forums.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

'L_FORUM_TOPICTYPES' => $lang['Forum_topictypes'] ,

# 
#-----[ REPLACE ]------------------------------------------ 
# 

'L_FORUM_TOPICTYPES' => ( $board_config['budget_types'] =='' ) ? $lang['Forum_topictypes'] : $lang['Forum_topictypes'].'<br>'.$lang['Forum_Budget_Types'],
御津闇慈
竹貓忠實會員
竹貓忠實會員
文章: 645
註冊時間: 2001-11-17 10:59

文章 御津闇慈 »

代碼: 選擇全部

######################################################## 
## 外掛名稱:      主題類型分區劃 (資料庫版 by Martinet) 2.0.1 升級檔
## 外掛版本:      2.0.1 
## 外掛原作者:    炎之虛空(御津闇慈) 
## 外掛強化者:    炎之虛空(御津闇慈) <http://imoml.phpbb-tw.com/> 
## 外掛資料庫化 : Martinet Oaf <oafwork@hotmail.com> 
## 
## 外掛描述:    這個外掛可以讓管理員在控制台中指定各個討論版發表主題的主題類型 , 
##      讓會員不會在版面上使用到錯誤的主題類型 
##      並且新增?#91;"主題分類功能" 
##      2005/12/29新增?#91;預?#93;主題功能(感謝吉川拓?#93;建議)
## 
## 升級難度:      簡單 
## 升級時間:      5 分鐘 
## 
## 需要編輯的檔案:   6 
## viewforum.php 
## posting.php  
## admin/admin_board.php 
## admin/admin_forums.php 
## template/你的風格/board_config_body.tpl   
## language/你的語言/lang_admin.php 
## 
## 附?#91;的檔案:       n/a 
## 
## 附?#91;的圖示:      n/a 
## 
############################################################## 
## 在增?#91;此外掛前, 請務必備份所有需要修改的檔案 
############################################################## 
# 
#-----[ ADD SQL ]------------------------------------------ 
#

INSERT INTO phpbb_config (config_name , config_value) VALUES ('budget_types', ''); 

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

posting.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$topictypes = explode(",",$post_info['forum_topictypes']); 

# 
#-----[ REPLACE ]------------------------------------------ 
# 

if($post_info['forum_topictypes'] == '' && $board_config['budget_types'] != '')
{
$topictypes = explode(",",$board_config['budget_types']); 
}else{
$topictypes = explode(",",$post_info['forum_topictypes']); 
}

# 
#-----[ FIND ]------------------------------------------ 
# 

if($post_info['forum_topictypes']!='')

# 
#-----[ REPLACE ]------------------------------------------ 
# 

if(($mode == 'newtopic' && $post_info['forum_topictypes'] != '')||($mode == 'newtopic' && $board_config['budget_types'] != ''))

# 
#-----[ OPEN ]------------------------------------------ 
# 
viewforum.php 

# 
#-----[ FIND ]------------------------------------------ 
#

if($forum_row['forum_topictypes']!='')

# 
#-----[ REPLACE ]------------------------------------------ 
# 

if($forum_row['forum_topictypes']!='' || $board_config['budget_types']!='')

# 
#-----[ FIND ]------------------------------------------ 
# 

	$topictypes = explode(",",$forum_row['forum_topictypes']); 

# 
#-----[ REPLACE ]------------------------------------------ 
# 

	if($forum_row['forum_topictypes'] =='' && $board_config['budget_types'] !='')
	{
	$topictypes = explode(",",$board_config['budget_types']); 
	}else{
	$topictypes = explode(",",$forum_row['forum_topictypes']); 
	}

# 
#-----[ FIND ]------------------------------------------ 
# 

	$topictypes = explode(",",$forum_row['forum_topictypes']); 

# 
#-----[ REPLACE ]------------------------------------------ 
# 

	if($forum_row['forum_topictypes'] =='' && $board_config['budget_types'] !='')
	{
	$topictypes = explode(",",$board_config['budget_types']); 
	}else{
	$topictypes = explode(",",$forum_row['forum_topictypes']); 
	}

# 
#-----[ 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/你的風格/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_admin.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$lang['Forum_topictypes'] = '這個版面的主題類型';

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

$lang['Budget_Type'] = '預?#93;主題'; // Budget_Type 
$lang['Budget_Types'] = '預?#93;主題類型(請以逗號分類)'; // Budget_Types
$lang['Forum_Budget_Types'] = '假如沒?#93;定的話將會以預?#93;主題為主(請到基本組態?#93;定)'; // Budget_Types

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_forums.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

'L_FORUM_TOPICTYPES' => $lang['Forum_topictypes'] ,

# 
#-----[ REPLACE ]------------------------------------------ 
# 

'L_FORUM_TOPICTYPES' => ( $board_config['budget_types'] =='' ) ? $lang['Forum_topictypes'] : $lang['Forum_topictypes'].'<br>'.$lang['Forum_Budget_Types'],
御津闇慈
竹貓忠實會員
竹貓忠實會員
文章: 645
註冊時間: 2001-11-17 10:59

文章 御津闇慈 »

因為升級檔一些筆誤而導致有些功能失效
請見諒
這也告訴我們
熬夜行為是不對的
修正檔已經修正
御津闇慈
竹貓忠實會員
竹貓忠實會員
文章: 645
註冊時間: 2001-11-17 10:59

文章 御津闇慈 »

代碼: 選擇全部

######################################################## 
## 外掛名稱:      主題類型分區劃 (資料庫版 by Martinet) 2.0.2 升級檔
## 外掛版本:      2.0.2 
## 外掛原作者:    炎之虛空(御津闇慈) 
## 外掛強化者:    炎之虛空(御津闇慈) <http://imoml.phpbb-tw.com/> 
## 外掛資料庫化 : Martinet Oaf <oafwork@hotmail.com> 
## 
## 外掛描述:    這個外掛可以讓管理員在控制台中指定各個討論版發表主題的主題類型 , 
##      讓會員不會在版面上使用到錯誤的主題類型 
##      並且新增?#91;"主題分類功能" 
##      2005/12/29新增?#91;預?#93;主題功能(感謝吉川拓?#93;建議)
##	2006/01/03新增?#91;禁止自訂主題以及強制主題功能(感謝依夢兒跟倉木麻衣提供修改)\r
## 
## 升級難度:      簡單 
## 升級時間:      5 分鐘 
## 
## 需要編輯的檔案:   3  
## posting.php  
## includes/functions_post.php  
## language/你的語言/lang_main.php
## 
## 附?#91;的檔案:       n/a 
## 
## 附?#91;的圖示:      n/a 
## 
############################################################## 
## 在增?#91;此外掛前, 請務必備份所有需要修改的檔案 
############################################################## 
# 
#-----[ OPEN ]------------------------------------------ 
# 
posting.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

      $ttoptions .= '<option value="' . $topictype . '">' . $topictype . "</option>
"; 
# 
#-----[ REPLACE ]------------------------------------------ 
# 

      $ttoptions .= '<option value="' . $topictype . ' ">' . $topictype . "</option>
"; 

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

# 
#-----[ FIND ]------------------------------------------ 
#

//
// Prepare a message for posting
// 
function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length)
{
	global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path;

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

	global $post_info;

# 
#-----[ FIND ]------------------------------------------ 
# 

else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))
	{
		$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Empty_subject'] : $lang['Empty_subject'];
	}

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

if(($post_info['forum_topictypes'] != '') || ($board_config['budget_types'] != ''))
{
	//強制主題類型	
	if ($mode == 'newtopic' && !preg_match("/^(\s| )*\[/",$subject) )
	{
		$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Empty_subject_type'] : $lang['Empty_subject_type'];
	}
			
	// 禁止會員自訂主題
	$ject = explode(" ", $subject);
	if($post_info['forum_topictypes'] =='' && $board_config['budget_types'] !='') 
	   { 
		$types = explode(",",$board_config['budget_types']); 
	   }else{ 
		$types = explode(",",$post_info['forum_topictypes']); 
	   } 
	if(@!in_array($ject[0],$types) && $mode == 'newtopic')
	   {
		$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Empty_type'] : $lang['Empty_type'];
	   }
}

# 
#-----[ OPEN ]------------------------------------------ 
# 
language/你的語言/lang_main.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$lang['All_Topics'] = '所有主題'; 

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

$lang['Empty_subject_type'] = '發表主題必須選擇主題類型';
$lang['Empty_type'] = '請正確選擇主題類型!';
最後由 御津闇慈 於 2006-01-07 23:43 編輯,總共編輯了 1 次。
御津闇慈
竹貓忠實會員
竹貓忠實會員
文章: 645
註冊時間: 2001-11-17 10:59

文章 御津闇慈 »

代碼: 選擇全部

######################################################## 
## 外掛名稱:      主題類型分區劃 (資料庫版 by Martinet) 2.0.4 升級檔
## 外掛版本:      2.0.4
## 外掛原作者:    炎之虛空(御津闇慈) 
## 外掛強化者:    炎之虛空(御津闇慈) <http://imoml.phpbb-tw.com/> 
## 外掛資料庫化 : Martinet Oaf <oafwork@hotmail.com> 
## 
## 外掛描述:    這個外掛可以讓管理員在控制台中指定各個討論版發表主題的主題類型 , 
##      讓會員不會在版面上使用到錯誤的主題類型 
##      並且新增?#91;"主題分類功能" 
##      2005/12/29新增?#91;預?#93;主題功能(感謝吉川拓?#93;建議)
##	2006/01/03新增?#91;禁止自訂主題以及強制主題功能(感謝依夢兒跟倉木麻衣提供修改)
##	額外?#93;定:JS視窗彈出功能\r
##	2006/01/06新增?#91;編輯時會出?#123;主題類型(只限發表主題者才有的功能,回覆者沒有)
## 
## 升級難度:      簡單 
## 升級時間:      5 分鐘 
## 
## 需要編輯的檔案:   2  
## posting.php  
## includes/functions_post.php
## 
## 附?#91;的檔案:       n/a 
## 
## 附?#91;的圖示:      n/a 
## 
############################################################## 
## 在增?#91;此外掛前, 請務必備份所有需要修改的檔案 
############################################################## 
# 
#-----[ OPEN ]------------------------------------------ 
# 
posting.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

	if(($mode == 'newtopic' && $post_info['forum_topictypes'] != '')||($mode == 'newtopic' && $board_config['budget_types'] != ''))

# 
#-----[ REPLACE ]------------------------------------------ 
# 

	if((($mode == 'newtopic' && $post_info['forum_topictypes'] != '')||($mode == 'newtopic' && $board_config['budget_types'] != ''))||($mode == 'editpost' && $post_data['first_post'] && $post_info['forum_topictypes'] != '')||($mode == 'editpost' && $post_data['first_post'] && $board_config['budget_types'] != ''))

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

# 
#-----[ FIND ]------------------------------------------ 
# 

	if(($post_info['forum_topictypes'] != '') || ($board_config['budget_types'] != '')) 

# 
#-----[ REPLACE ]------------------------------------------ 
# 

	if((($mode == 'newtopic' && $post_info['forum_topictypes'] != '')||($mode == 'newtopic' && $board_config['budget_types'] != ''))||($mode == 'editpost' && $post_data['first_post'] && $post_info['forum_topictypes'] != '')||($mode == 'editpost' && $post_data['first_post'] && $board_config['budget_types'] != ''))

# 
#-----[ FIND ]------------------------------------------ 
# 

   if(@!in_array($ject[0],$types) && $mode == 'newtopic')

# 
#-----[ REPLACE ]------------------------------------------ 
# 

   if((@!in_array($ject[0],$types) && $mode == 'newtopic')||(@!in_array($ject[0],$types) && $mode == 'editpost')) 
 
# 
#-----[ FIND ]------------------------------------------ 
# 

   if ($mode == 'newtopic' && !preg_match("/^(\s| )*\[/",$subject) )

# 
#-----[ REPLACE ]------------------------------------------ 
# 

if (($mode == 'newtopic' && !preg_match("/^(\s| )*\[/",$subject))||($mode == 'editpost' && $post_data['first_post'] &&  !preg_match("/^(\s| )*\[/",$subject)))
主題已鎖定

回到「非官方認證外掛」