沒看過有人有這邊須求,所以好像也沒看到有人去修改...
所以應該是算原創吧 (d2)
已經用蠻久的了,這次裝 phpBB2 Plus 重修改一次\r
順便寫起來當備忘.
更新日期: 2003/08/27
來源: http://maji.myftp.org/bbs/viewtopic.php?t=372
DEOM: http://maji.myftp.org/bbs/viewtopic.php?t=407
開啟 includes/bbcode.php
#
#-----[ FIND ]--------------------------------
#
代碼: 選擇全部
$bbcode_tpl['img'] = str_replace('{URL}', '\\\1', $bbcode_tpl['img']);
#-----[ REPLACE WITH ]------------------------------------------
#
代碼: 選擇全部
// do img in several different ways...
$bbcode_tpl['img1'] = str_replace('{URL}', '\\\1', $bbcode_tpl['img']);
$bbcode_tpl['img1'] = str_replace('{ALIGN}', '', $bbcode_tpl['img1']);
$bbcode_tpl['img2'] = str_replace('{URL}', '\\\2', $bbcode_tpl['img']);
$bbcode_tpl['img2'] = str_replace('{ALIGN}', '\\\1', $bbcode_tpl['img2']);
#-----[ FIND ]--------------------------------
#
代碼: 選擇全部
// [img]image_url_here[/img] code..
// This one gets first-passed..
$patterns[] = "#\[img:$uid\](.*?)\[/img:$uid\]#si";
$replacements[] = $bbcode_tpl['img'];
#-----[ REPLACE WITH ]------------------------------------------
#
代碼: 選擇全部
// [img]image_url_here[/img] code..
// This one gets first-passed..
$patterns[] = "#\[img\](.*?)\[/img\\]#si";
$replacements[] = $bbcode_tpl['img1'];
$patterns[] = "#\[img=(left|center|right)\](.*?)\[/img\]#si";
$replacements[] = $bbcode_tpl['img2'];
$patterns[] = "#\[img align=(left|center|right):$uid\](.*?)\[/img:$uid\]#si";
$replacements[] = $bbcode_tpl['img2'];
#-----[ FIND ]--------------------------------
#
代碼: 選擇全部
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((ht|f)tp://)([^
\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\\1' . str_replace(' ', '%20', '\\\3') . '[/img:$uid]'", $text);
#-----[ REPLACE WITH ]------------------------------------------
#
代碼: 選擇全部
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\](([a-z]+?)://([^ \"
]+?))\[/img\]#si", "[img:$uid]\\\1[/img:$uid]", $text);
$text = preg_replace("#\[img=(left|center|right)\](([a-z]+?)://([^ \"
]+?))\[/img\]#si", "[img=\\\1:$uid]\\\2[/img:$uid]", $text);
其他語系改法也相同,只是新增對齊方式說明
#
#-----[ FIND ]--------------------------------
#
代碼: 選擇全部
$lang['bbcode_p_help'] = '插入圖片: [img]http://image_url[/img] (alt+p)';
#-----[ REPLACE WITH ]------------------------------------------
#
代碼: 選擇全部
$lang['bbcode_p_help'] = '插入圖片: [img]http://url[/img] or [img=(left|right)]http://url[/img] or [img align=(left|right)]http://url[/img] (alt+p)';
#
#-----[ FIND ]--------------------------------
#
代碼: 選擇全部
<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->
#-----[ REPLACE WITH ]------------------------------------------
#
代碼: 選擇全部
<!-- BEGIN img --><img src="{URL}" align="{ALIGN}" border="0" /><!-- END img -->