1 頁 (共 1 頁)

[教學]貼圖效果

發表於 : 2003-07-11 01:54
scott511747
不能夠算是Mod,因為我是將兩個地方稍作修改而已。圖片超出版面時會自動裁減;是否要點下秀出全圖就請自行決定!因為看到蠻多人還是有縮圖上的困擾,所以我就稍微整理一下弄上來給各位使用。

開啟 templates/subSilver/viewtopic_body.tpl

尋找\r

代碼: 選擇全部

<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
替換成

代碼: 選擇全部

<td colspan="2"><table style="table-layout:fixed"><tr><td style="word-wrap:break-word"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td></tr></table></td>
開啟 templates/subSilver/bbcode.tpl

尋找\r

代碼: 選擇全部

<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->
替換成

代碼: 選擇全部

<!-- BEGIN img --><a href="{URL}" target="_blank" title="開新視窗賞圖"><img src="{URL}" border="0"/></a><!-- END img -->
Demo http://scottstudio.adsldns.org/viewtopic.php?t=1030
    第一張是使用BBCode
    第二張是使用語法

使用語法 <img src="圖片網址"> 就不會有了連結
使用BBCode [img]圖片網址[/img] 才會有連結模式
看是要依照圖檔大小來做選擇還是都選用其中一種,自己喜歡就好。

我的第一個外掛發表,希望各位會喜歡!

發表於 : 2003-07-14 11:11
動機不明
整理的不錯,我補充後移至教學文件庫

附加檔案縮圖

開啟 templates/subSilver/viewtopic_attach_body.tpl
尋找\r

代碼: 選擇全部

<img src="{postrow.attach.cat_images.IMG_SRC}" alt="{postrow.attach.cat_images.DOWNLOAD_NAME}" border="0" />
替換為\r

代碼: 選擇全部

<a href="{postrow.attach.cat_images.IMG_SRC}" alt="{postrow.attach.cat_images.DOWNLOAD_NAME}" target="_blank" title="開新視窗觀看原圖"><img src="{postrow.attach.cat_images.IMG_SRC}" border="0" onload="javascript:if(this.width>screen.width-450) this.width=screen.width-450" /></a>