[外掛] 主題額外資訊 1.4.1

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

版主: 版主管理群

主題已鎖定
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

[外掛] 主題額外資訊 1.4.1

文章 天霜 »

代碼: 選擇全部

################################################################################### 
## 
## Hack Title:    Add a new field to posting part
## Hack Version:  1.4.1 (phpBB 2.0.5 - 2.0.6)
## Author:        Acid
## Support:	  http://www.phpbbhacks.com/forums/
##
## Description:   An example how you can add a new field to the posting part..
##		  ..it will be displayed above the post (post view) and below
##		  topic title (topic view).
##
## Files to edit:         11
##                        language/lang_english/lang_main.php
##                        includes/functions_post.php
##                        includes/topicreview.php
##                        posting.php
##                        viewtopic.php
##                        viewforum.php
##                        templates/xxx/posting_body.tpl
##                        templates/xxx/posting_preview.tpl
##                        templates/xxx/posting_topicreview.tpl
##                        templates/xxx/viewtopic_body.tpl
##                        templates/xxx/viewforum_body.tpl
## 
################################################################################### 
## 
## Installation/Author Notes: 
## First always make a backup from the files/database that you're going to edit. 
## 
## This hack adds 2 new fields to your database. 
##
################################################################################### 
## Versions:
##
## 1.4.1 - search for info.txt updated to 1.0.2 (forgot to add some code); search
##	   should work now
##	 - an_option.zip added (simple explanation how to add an option)
##	   (example: users can change urls to non-clickable if they want to)
## 1.4.0 - guides rewritten
##	 - optional part added (notification info, restricted to specific forums,
##	   extra information is mandatory)
## 1.2.1 - missed a sql query for optional part (search)
## 1.2.0 - optional part added (dropdown menu, modpanel, search),
##	   template alteration changed, preview code altered
## 1.0.2 - fixed a typo in posting.php (edit display)
## 1.0.1 - fixed some language/template bugs
## 1.0   - Release
################################################################################### 
##
## SQL QUERY:  (You may have to change your database prefix.)

ALTER TABLE phpbb_topics ADD topic_extra CHAR(60) NOT NULL AFTER topic_title;
ALTER TABLE phpbb_posts_text ADD post_extra VARCHAR(60) DEFAULT NULL AFTER post_subject; 

## alternate you can use table_update.php to alter the database
## automatically (just upload and run the file)
##
###################################################################################

代碼: 選擇全部

$lang['Extra']                  = '額外資訊';
  • 字元數調整:
#
#-----[ ADD SQL 加入SQL語法 ]--------------------------------------
#
# 請記得修改成你的資料庫名稱\r

代碼: 選擇全部

ALTER TABLE `phpbb_topics` CHANGE `topic_extra` `topic_extra` CHAR(120) NOT NULL;
#
#-----[ ADD SQL 加入SQL語法 ]--------------------------------------
#
# 請記得修改成你的資料庫名稱\r

代碼: 選擇全部

ALTER TABLE `phpbb_posts_text` CHANGE `post_extra` `post_extra` VARCHAR(120) DEFAULT NULL;

#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

文章 天霜 »

  • Add a New Field to Posting 1.4.1 相容 Split topic type 2.0.1 的改法:
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

includes/functions_topics_list.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

		$topic_title		= ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
#
#-----[ AFTER, ADD 之後, 加上 ]------------------------------------
#

代碼: 選擇全部

		$topic_extra		= ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_extra']) : $topic_rowset[$i]['topic_extra'];
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

			'TOPIC_TITLE'			=> $topic_title,
#
#-----[ AFTER, ADD 之後, 加上 ]------------------------------------
#

代碼: 選擇全部

			'TOPIC_EXTRA'			=> ( !empty($topic_rowset[$i]['topic_extra']) ) ? '<br />' . $topic_extra : '',
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

templates/subSilver/topics_list_box.tpl
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

{topics_list_box.row.TOPIC_TITLE}</a></span><span class="gensmall">
#
#-----[ AFTER, ADD 之後, 加上 ]------------------------------------
#

代碼: 選擇全部

{topics_list_box.row.TOPIC_EXTRA}
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束
主題已鎖定

回到「非官方認證外掛」