參考連結:http://phpbb-tw.net/phpbb/viewtopic.php?t=5708
該篇文章的 iframe 需要指定寬、高
小弟偷偷改了個不用指定寬高的
這樣給那些一般用戶使用會比較方便
其實就是把跟寬高有關的地方拿掉罷了
打開includes/bbcode.php
#-----[ 找到]------------------------------------------
#
代碼: 選擇全部
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\\1', $bbcode_tpl['email']);
#-----[ 加在它後面 ]------------------------------------------
#
代碼: 選擇全部
//iframe join by 法蘭庫克 frank
$bbcode_tpl['iframe'] = str_replace('{URL}', '\\\1', $bbcode_tpl['iframe']);
#-----[ 找到 ]------------------------------------------
\n#
代碼: 選擇全部
// user@domain.tld code..
$patterns[] = "#\[email\]([a-z0-9\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
$replacements[] = $bbcode_tpl['email'];
#-----[ 加在它後面 ]------------------------------------------
#
代碼: 選擇全部
// [iframe] and [/iframe] code..
$patterns[] = "#\[iframe\](.*?)\[/iframe:$uid\]#si";
$replacements[] = $bbcode_tpl[iframe];
#-----[ 找到 ]------------------------------------------
#
代碼: 選擇全部
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\](([a-z]+?)://([^
]+?))\[/img\]#si", "[img:$uid]\\\1[/img:$uid]", $text);
#-----[ 加在它後面 ]------------------------------------------
#
代碼: 選擇全部
//[iframe] and [/iframe]
$text = preg_replace("#\[iframe\](([a-z]+?)://([^,
]+))\[\/iframe\]#si","[iframe\]\\\1[/iframe:$uid]", $text);
#-----[ 打開 templates/your template/bbcode.tpl ]------------------------------------------
#
#
#-----[ 找到 ]------------------------------------------
#
代碼: 選擇全部
<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->
#-----[ 加在它後面 ]------------------------------------------
#
代碼: 選擇全部
<!-- BEGIN iframe --><iframe marginwidth=0 marginheight=0 src="{URL}" frameborder="0" WIDTH=600 HEIGHT=400></iframe><!-- END iframe -->
這樣如果用戶螢幕解析度是 1024x768
搭配上 phpbb 原本的版面\r
大小差不多剛剛好\r
另外最後那一段也可以改成這樣\r
代碼: 選擇全部
<!-- BEGIN iframe --><iframe marginwidth=0 marginheight=0 src="{URL}" frameborder="0" WIDTH=600 HEIGHT=400></iframe><br /><br /><a href="{URL}" target="_blank" class="postlink">{URL}</a><!-- END iframe -->
這樣使用上會方便許多