Discuz! 去掉帖子图片下载提示方法-Discuz教程下载

Discuz! 去掉帖子图片下载提示方法

开通本站Svip会员,全站资源免费下
默认图片鼠标移动过去会显示图片名和下载,如果开启了图片列表还有设为封面,有些Discuz!站长需要让帖子内容页面更美观,可以使用以下办法去除。
模板路径\template\模板风格\forum\discuzcode.htm
找到
  1. <img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']}
复制代码

有两处的下面,以下内容删除
  1. onmouSEOver="showMenu({'ctrlid':this.id,'pos':'12'})"
复制代码
保存后 后台更新缓存
如果想要去掉下载和保存相册,只保留设为封面:
用编辑器打开template/default/forum/discuzcode.htm文件
修改第258行,源码如下:
  1. <img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']} class="attprice"{/if} style="cursor:pointer" id="aimg_$attach[aid]" aid="$attach[aid]" src="{STATICURL}image/common/none.gif" onclick="zoom(this, this.getAttribute('zoomfile'), 0, 0, '{$_G[setting][showexif]}')" zoomfile="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes&#172;humb=yes{else}{$attach[url]}$attach[attachment]{/if}" file="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode{else}{$attach[url]}$attachthumb{/if}" inpost="1"{if $_GET['from'] != 'preview'} onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if} />
复制代码

修改为:
  1. <img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']} class="attprice"{/if} style="cursor:pointer" id="aimg_$attach[aid]" aid="$attach[aid]" src="{STATICURL}image/common/none.gif" onclick="zoom(this, this.getAttribute('zoomfile'), 0, 0, '{$_G[setting][showexif]}')" zoomfile="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes&#172;humb=yes{else}{$attach[url]}$attach[attachment]{/if}" file="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode{else}{$attach[url]}$attachthumb{/if}" inpost="1"{if $_GET['from'] != 'preview'} {if $firstpost && $_G['fid'] && $_G['forum']['picstyle'] && ($_G['forum']['ismoderator'] || $_G['uid'] == $attach['uid'])}onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if}{/if} />
复制代码

找到第260行代码如下:
  1. <img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']} class="attprice"{/if} id="aimg_$attach[aid]" aid="$attach[aid]" src="{STATICURL}image/common/none.gif" zoomfile="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes&#172;humb=yes{else}{$attach[url]}$attach[attachment]{/if}" file="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes{else}{$attach[url]}$attach[attachment]{/if}" $widthcode id="aimg_$attach[aid]" inpost="1"{if $_GET['from'] != 'preview'} onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if} />
复制代码

修改为:
  1. <img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']} class="attprice"{/if} id="aimg_$attach[aid]" aid="$attach[aid]" src="{STATICURL}image/common/none.gif" zoomfile="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes&#172;humb=yes{else}{$attach[url]}$attach[attachment]{/if}" file="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes{else}{$attach[url]}$attach[attachment]{/if}" $widthcode id="aimg_$attach[aid]" inpost="1"{if $_GET['from'] != 'preview'} {if $firstpost && $_G['fid'] && $_G['forum']['picstyle'] && ($_G['forum']['ismoderator'] || $_G['uid'] == $attach['uid'])}onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if}{/if} />
复制代码

删除267行代码,如下:
  1. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode&#172;humb=yes" target="_blank">{lang download}</a>
复制代码

修改后,如果后台->版块->编辑->扩展设置,没有开启图片列表模式,则鼠标移动到图片上时不会有任何提示。

全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部