小樱 发表于 2015/6/20 02:01

discuz让下载附件跑CDN的方法,设置att二级域名跑加速,非图片修改,是下载压缩包之类



方法有待研究,目前已知就是远程附件功能。。

已经找到方案

搜索\template\default\forum\discuzcode.htm

<a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach</a>

修改成如下,注意替换自己的域名
<a href="http://att.itzmx.com/forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach</a>


手机版在 template/default/mobile/forum/discuzcode.htm 和 template/default/touch/forum/discuzcode.htm
搜索
<a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach</a>

修改
<a href="http://att.itzmx.com/forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach</a>


独家,注意注明出处:http://bbs.itzmx.com/thread-9349-1-1.html


2025年3月4日补充
帖子未插入的下载附件,和手机版未点击开的缩略图这两处还没改,有时间在弄

电脑版
未插入的图片附件搜索
<a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode&nothumb=yes" {if $_GET['from'] != 'preview'}onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" id="aid$attach"{/if} class="xw1" target="_blank">$attach</a>
改为
<a href="https://att.itzmx.com/forum.php?mod=attachment{$is_archive}&aid=$aidencode&nothumb=yes" {if $_GET['from'] != 'preview'}onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" id="aid$attach"{/if} class="xw1" target="_blank">$attach</a>

图片附件还有一个要改的,鼠标移动上去悬浮窗呼出的"下载附件"按钮
<a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode&nothumb=yes" target="_blank">{lang download}</a>

改为
<a href="https://att.itzmx.com/forum.php?mod=attachment{$is_archive}&aid=$aidencode&nothumb=yes" target="_blank">{lang download}</a>

未插入的压缩包附件搜索
<a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" {if $_GET['from'] != 'preview'}onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if} id="aid$attach" target="_blank">$attach</a>

改为
<a href="https://att.itzmx.com/forum.php?mod=attachment{$is_archive}&aid=$aidencode" {if $_GET['from'] != 'preview'}onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if} id="aid$attach" target="_blank">$attach</a>

手机版
未插入的图片附件搜索,提示下触屏版没有"下载附件"按钮,等于说只要改标准版
<a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode&nothumb=yes" id="aid$attach" class="xw1" target="_blank">$attach</a>

改为
<a href="https://att.itzmx.com/forum.php?mod=attachment{$is_archive}&aid=$aidencode&nothumb=yes" id="aid$attach" class="xw1" target="_blank">$attach</a>

未插入的压缩包附件搜索
<a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" id="aid$attach" target="_blank">$attach</a>

改为
<a href="https://att.itzmx.com/forum.php?mod=attachment{$is_archive}&aid=$aidencode" id="aid$attach" target="_blank">$attach</a>

互补:https://bbs.itzmx.com/thread-111924-1-1.html

还有一个点位置懒得找了,,,"抱歉,原附件链接已失效"

铁打的星星 发表于 2015/6/20 02:08

小樱 发表于 2017/5/24 02:01

手机版在/ template / default / touch / forum /
/ template / default / mobile / forum /两个目录
页: [1]
查看完整版本: discuz让下载附件跑CDN的方法,设置att二级域名跑加速,非图片修改,是下载压缩包之类