[discuz优化]discuz!x2.0 帖子图片附件alt自动显示为帖子主题的方法
discuz!x2.0 帖子图片附件alt自动显示为帖子主题的方法
修改方法如下:
修改discuzx模板目录template/default/forum/discuzcode.htm文件
找到大约190行左右 alt=”$attach[imgalt]” title=”$attach[imgalt]”
修改为alt=”{$_G[forum_thread][short_subject]}-$attach[imgalt]” title=”{$_G[forum_thread][short_subject]}-$attach[imgalt]”
修改后的代码如下
1 2 3 4 5 |
<!--{if $_G['setting']['thumbstatus'] && $attach['thumb']}--> <img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']}{/if} style="cursor:pointer" id="aimg_$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" alt="{$_G[forum_thread][short_subject]}-$attach[imgalt]" title="{$_G[forum_thread][short_subject]}-$attach[imgalt]" /> <!--{else}--> <img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']}{/if} id="aimg_$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" alt="{$_G[forum_thread][short_subject]}-$attach[imgalt]" title="{$_G[forum_thread][short_subject]}-$attach[imgalt]" /> <!--{/if}--> |
我去掉了图片附件这个下载提示代码,
onmouseover=”showMenu({‘ctrlid’:this.id,’pos’:’12’})”
可能不太一样,效果是一样的