因為 phpbb 3.0 已將 "附加檔案" 的功能給內建了,所以未來使用這功能的討論區將會更多,但針對附加在文章裡面的圖片如果尺寸過大時,依然還是會把整個版面給撐大.
原本 Resize Posted Images Based on Max Widt 2.4.5 這個縮圖外掛是裝在 2.0.* 版本的,剛剛我把他給改了一下安裝的方法,也成功的裝進 phpbb 3.0 內.在此分享給大家.
原始檔頭
代碼: 選擇全部
##############################################################
## MOD Title: Resize Posted Images Based on Max Width
## MOD Author: spooky2280 < webmaster@christianfecteau.com > (Christian Fecteau) http://portfolio.christianfecteau.com/
## MOD Description: This MOD resizes images within posts to make it so they don't break your layout. Images resized are made
## clickable and openable in a popup in full-size. You can specify a different max width for each of your themes.
## Images that do not exceed the max width are left as is. See the MOD in action: http://christianfecteau.com/rmw
##
## MOD Version: 2.4.5
##
## Installation Level: Easy
## Installation Time: 5 Minutes (1 minute with EasyMod)
代碼: 選擇全部
修改文件:6
styles/prosilver/template/attachment.html
styles/prosilver/template/overall_footer.html
styles/prosilver/template/overall_header.html
styles/prosilver/template/simple_footer.html
styles/prosilver/template/simple_header.html
language/語系/common.php
新增文件:1
rmw_jslib.js
開始
代碼: 選擇全部
---- [ 複製 ] -----
templates/rmw_jslib.js 到 styles/prosilver/template/rmw_jslib.js
----- [ 開啟 ] -----
styles/prosilver/template/attachment.html
----- [ 尋找 ] -----
<dt class="attach-image"><img src="{_file.U_INLINE_LINK}" alt="{_file.DOWNLOAD_NAME}" onclick="viewableArea(this);" /></dt>
----- [ 置換 ] -----
<dt class="attach-image"><img resizemod="on" onload="rmw_img_loaded(this)" src="{_file.U_INLINE_LINK}" alt="{_file.DOWNLOAD_NAME}" onclick="viewableArea(this);" /></dt>
----- [ 開啟 ] -----
styles/prosilver/template/bbcode.html
----- [ 尋找 ] -----
<!-- BEGIN img --><img src="{URL}" alt="{L_IMAGE}" /><!-- END img -->
----- [ 置換 ] -----
<!-- BEGIN img --><img resizemod="on" onload="rmw_img_loaded(this)" src="{URL}" alt="{L_IMAGE}" /><!-- END img -->
----- [ 開啟 ] -----
styles/prosilver/template/overall_footer.html
----- [ 尋找 ] -----
</body>
----- [ 之前新增 ] -----
<div style="display:none" id="resizemod"></div>
----- [ 開啟 ] -----
styles/prosilver/template/overall_header.html
----- [ 尋找 ] -----
<title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- ENDIF -->{PAGE_TITLE}</title>
----- [ 之後新增 ] -----
<!-- start mod : Resize Posted Images Based on Max Width -->
<script type="text/javascript">
//<![CDATA[
<!--
var rmw_max_width = 700; // you can change this number, this is the max width in pixels for posted images
var rmw_border_1 = '1px solid';
var rmw_border_2 = '1px dotted';
var rmw_image_title = '{L_RMW_IMAGE_TITLE}';
//-->
//]]>
</script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/rmw_jslib.js"></script>
<!-- fin mod : Resize Posted Images Based on Max Width -->
----- [ 開啟 ] -----
styles/prosilver/template/simple_footer.html
----- [ 尋找 ] -----
</body>
----- [ 之前新增 ] -----
<div style="display:none" id="resizemod"></div>
----- [ 開啟 ] -----
styles/prosilver/template/simple_header.html
----- [ 尋找 ] -----
<title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- ENDIF -->{PAGE_TITLE}</title>
----- [ 之後新增 ] -----
<!-- start mod : Resize Posted Images Based on Max Width -->
<script type="text/javascript">
//<![CDATA[
<!--
var rmw_max_width = 700; // this max width is used in the Topic Review iframe when posting
var rmw_border_1 = '1px solid';
var rmw_border_2 = '1px dotted';
var rmw_image_title = '{L_RMW_IMAGE_TITLE}';
//-->
//]]>
</script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/rmw_jslib.js"></script>
<!-- fin mod : Resize Posted Images Based on Max Width -->
----- [ 開啟 ] -----
language/語系/common.php
----- [ 尋找 ] -----
));
----- [ 之前新增 ] -----
'RMW_IMAGE_TITLE' => '點擊檢視原尺寸圖片', //mod : Resize Posted Images Based on Max Width
----- [ 清除暫存檔 ] -----
cache 目錄下所有檔案請清除!
----- [ 儲存並關閉所有檔案 ] -----
styles/prosilver/template/attachment.html
代碼: 選擇全部
---- [ 尋找 ] -----
<dt class="attach-image">
----- [ 置換 ] -----
<dt>