[問題]增添一個新欄位在發表文章的頁面

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
msk88
星球普通子民
星球普通子民
文章: 3
註冊時間: 2003-04-21 06:10
來自: H.K.
聯繫:

[問題]增添一個新欄位在發表文章的頁面

文章 msk88 »

問題外掛:Add a new field to posting part 增添一個新欄位在發表文章的頁面\r
使用版本:phpBB 2.0.4
來源網址: http://phpbb-tw.net/phpbb/viewtopic.php?t=15805
Mac 寫:下載: http://www.phpbbhacks.com/viewhack.php?id=1366

代碼: 選擇全部

################################################################################### 
## 
## Hack Title:    Add a new field to posting part 增添一個新欄位在發表文章的頁面\r
## Hack Version:  1.0.1 (phpBB 2.0.4 or lower)
## Author:     Acid
## 中文化:     Mac < ycl_6@sinamail.com >
## 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).
## 在發表文章時增加主題描述(或任何你想要的用途)
## 增添的訊息將顯示在 viewtopic.php & viewforum.php
##
## Files to edit:        9
##                        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 new new fields to your database. 
##
## If you want to add another fields to the posting part, just duplicate the
## following actions and rename the label (but be aware of the spelling like 'extra',
## 'post_extra' or 'EXTRA' etc.)
##
################################################################################### 
## Versions:
##
## 1.0.1 - fixed some language/template bugs
## 1.0   - Release
################################################################################### 

## SQL QUERY:  (You may have to change your database prefix)

ALTER TABLE test_topics ADD topic_extra CHAR(60) NOT NULL AFTER topic_title;
ALTER TABLE test_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_main.php
[php]<?php

$lang['Extra'] = '額外資訊';
$lang['Empty_extra'] = '沒有填入額外訊息?';
$lang['Post_extra'] = '額外資訊:';

?>[/php]

修正(http://www.phpbbhacks.com/forums/viewtopic.php?t=10193
posting.php

代碼: 選擇全部

尋找: 
      $extra = $post_info['topic_extra']; 

換成: 
      $extra = $post_info['post_extra'];
~Mac

我的問題所在

我把 templates/xxx/posting_body.tpl 內的以下:

代碼: 選擇全部

<input type="text" name="extra" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{EXTRA}" />
改為以下:

代碼: 選擇全部

<textarea type="text" name="extra" wrap="virtual" rows="4" cols="35" style="width:420px" tabindex="3" class="post" />{EXTRA}</textarea>
目的是想另輸入訊息時自由度更大,這個少許修改沒有問題可以用,但發現一個問題,是設定了這個表單輸入欄位之後,在 viewtopic 觀看時,不懂自動換行 及 不支援BBCode代碼,我研究了數天亦未能解決此問題,希望各位大大能夠替我想想辦法.... :(
msk88
星球普通子民
星球普通子民
文章: 3
註冊時間: 2003-04-21 06:10
來自: H.K.
聯繫:

文章 msk88 »

有人幫到我嗎? :-?
[LA3]Revenger
星球普通子民
星球普通子民
文章: 10
註冊時間: 2002-10-04 12:08

文章 [LA3]Revenger »

有論壇網址嗎?
主題已鎖定

回到「外掛問題討論」