靈光乍現: 讓您的附加檔案之檔案註解 (描述) 可以使用 BBCode 和表情符號
修改前提: 您的 phpBB (2.0.22) 已經安裝 attach mod (2.4.5) 且運作正常
#
#-----[ OPEN ]-----
#
attach_mod/displaying.php
#
#-----[ FIND ]-----
#
代碼: 選擇全部
if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
exit;
}
#
#-----[ AFTER, ADD ]-----
#
代碼: 選擇全部
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
#
#-----[ FIND ]-----
# ps. 類似的地方有 10 個
代碼: 選擇全部
'COMMENT' => $comment,
#
#-----[ REPLACE WITH ]-----
# ps. 10 個都同樣取代之
代碼: 選擇全部
'COMMENT' => smilies_pass(bbencode_second_pass($comment, '')),
#
#-----[ OPEN ]-----
#
attach_mod/posting_attachments.php
#
#-----[ FIND ]-----
#
代碼: 選擇全部
if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
exit;
}
#
#-----[ AFTER, ADD ]-----
#
代碼: 選擇全部
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
#
#-----[ FIND ]-----
#
代碼: 選擇全部
'comment' => (string) $comment,
#
#-----[ REPLACE WITH ]-----
#
代碼: 選擇全部
'comment' => (string) bbencode_first_pass($comment, $uid),
#
#-----[ FIND ]-----
#
代碼: 選擇全部
SET comment = '" . attach_mod_sql_escape($this->attachment_comment_list[$i]) . "'
#
#-----[ REPLACE WITH ]-----
#
代碼: 選擇全部
SET comment = '" . attach_mod_sql_escape(bbencode_first_pass($this->attachment_comment_list[$i], $uid)) . "'
#
#-----[ FIND ]-----
#
代碼: 選擇全部
'comment' => (string) $this->attachment_comment_list[$i],
#
#-----[ REPLACE WITH ]-----
#
代碼: 選擇全部
'comment' => (string) bbencode_first_pass($this->attachment_comment_list[$i], $uid),
#
#-----[ FIND ]-----
#
代碼: 選擇全部
'comment' => (string) $this->file_comment,
#
#-----[ REPLACE WITH ]-----
#
代碼: 選擇全部
'comment' => (string) bbencode_first_pass($this->file_comment, $uid),
#
#-----[ FIND ]-----
#
代碼: 選擇全部
'FILE_COMMENT' => $this->file_comment,
#
#-----[ REPLACE WITH ]-----
#
代碼: 選擇全部
'FILE_COMMENT' => bbencode_second_pass($this->file_comment, ''),
#
#-----[ FIND ]-----
#
代碼: 選擇全部
'FILE_COMMENT' => $this->attachment_comment_list[$i],
#
#-----[ REPLACE WITH ]-----
#
代碼: 選擇全部
'FILE_COMMENT' => bbencode_second_pass($this->attachment_comment_list[$i], ''),
#
#-----[ SAVE & CLOSE ]-----
#
# EOM
ps.
1. 若要在檔案註解裡頭, 使用 BBCode 或表情符號,
則建議先在文章內容裡, 使用 BBCode 按鈕,
再複製 / 貼上檔案註解裡頭.
2. 若要使用網址超連結,
則建議用
網址
或
文字敘述
DEMO:
http://wang5555.dnsfor.me/phpbb2/viewtopic.php?t=21437
http://wang5555.dnsfor.me/test/phpbb2/viewtopic.php?t=15