找回密码
 注册
首页 ≡≡网络技术≡≡ PHP语言 Discuz! Discuz! X3.2去掉帖子图片弹出“下载附件”并保留“设为 ...

Discuz! X3.2去掉帖子图片弹出“下载附件”并保留“设为封面"

灰儿 2017-5-15 17:08:40
我们打开帖子如果帖子里面有图片,鼠标移到图片上时弹出“下载附件”并保留“设为封面”等提示,有时候觉得看到很烦。那么下面我们来给大家说下如何去掉discuz! X3.2帖子图片弹出“下载附件”并保留“设为封面”等的方法!,修改前如下图:


用编辑器打开template/default/forum/discuzcode.htm文件
修改第258行,源码如下:

[color=rgb(51, 102, 153) !important]复制代码


修改为:
  • <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" zoomfile="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes¬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} />

[color=rgb(51, 102, 153) !important]复制代码


修改第260行,源码如下:
  • <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¬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} />

[color=rgb(51, 102, 153) !important]复制代码


修改为:
  • <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¬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} />

[color=rgb(51, 102, 153) !important]复制代码


删除第267行,源码如下:
  • <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode¬humb=yes" target="_blank">{lang download}</a>

[color=rgb(51, 102, 153) !important]复制代码



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

如果任何时候鼠标移动到图片上时都不想有提示,只需删除258和260行中的即可
  • onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"

[color=rgb(51, 102, 153) !important]复制代码



如果商品贴等其他页面方法也基本类似,需要在该文件找到对应代码删除即可。欢迎大家补充修正。
您需要登录后才可以回帖 登录 | 注册
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。