| 
 
   
- 積分
 - 188 
 - 威望
 - 188  
 - 金錢
 - 195  
 - 最後登錄
 - 2013-2-11 
 
  | 
 修改图片附件下载方式
 本帖最後由 leots 於 2012-7-14 08:21 編輯  
 
乍一说可能有人没有听懂,原来图片附件点击下载的话,会显示attachment.php神马的,现在修改以后点击下载直接显示图片的绝对路径。 
 
http://it.gain.tw/thread-142-1-1.html 麻烦大家点击进去看附件,不知道怎么回事,自己的站禁止外链,而且现在又不能传附件。。 
大家看到区别了吗?至于为什么修改它,源自于我不喜欢右键复制图片地址,我喜欢点击下载之后在新标签页显示图片,那样直接复制地址栏就OK了,在5D6D留下的诟病。。(大家看,要是我没有这个诟病,哪里来的代码呀。。) 
好了正文开始了! 
打开模板discuzcode.htm,找到- <a href="attachment.php?aid=$aidencode&nothumb=yes" title="$attach[filename]" target="_blank"><strong>{lang download}</strong></a> ($attach[attachsize])<br />
 
  複製代碼 然后在这一行的上面有- <img src="images/common/none.gif" file="{if $attach[refcheck]}attachment.php?aid=$aidencode&noupdate=yes{else}$attach[url]/$attach[attachment]{/if}" $widthcode id="aimg_$attach[aid]" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" alt="$attach[filename]" />
 
  複製代碼 关键来了,找到$attach[url]/$attach[attachment]了吗?就是那个,把- <a href="attachment.php?aid=$aidencode&nothumb=yes" title="$attach[filename]" target="_blank">修改成[code]<a href="$attach[url]/$attach[attachment]" title="$attach[filename]" target="_blank">
 
  複製代碼 就OK了。你可以在我的站的任何一个图片上试试哦! 
我的站的地址是:it.gain.tw |   
 
 
 
 |