Discuz! 3.4全站帖子添加图片alt标签

首先找到:/template/你的模板/forum/discuzcode.htm文件,如果你使用的模板没有这个文件,不要嚷嚷,没有是正常的。只是有些特别的会有。没有的的话就去默认的模板下:/template/default/forum/discuzcode.htm文件

3.2正确的改法是有两处是需要修改的,有两处是需要添加的。

1.第一处修改;
是先找到 直接搜索 <!--{if _G['setting']['thumbstatus'] &&attach['thumb']}--> 得到的第一个里面有两个这样的差不多代码。对比下下面。

  1. <div class="mbn savephotop">
  2.                                                 <!--{if $_G['setting']['thumbstatus'] && $attach['thumb']}-->
  3.                                                         <a href="javascript:;"><img 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¬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}" alt="$_G[forum_thread][subject]" title="$_G[forum_thread][subject]" w="$attach[width]" /></a>
  4.                                                 <!--{else}-->
  5.                                                         <img 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 alt="$_G[forum_thread][subject]" title="$_G[forum_thread][subject]" w="$attach[width]" />
  6.                                                 <!--{/if}-->
  7.                                                 </div>
复制代码
其实就是把 alt="attach[imgalt]"title="attach[imgalt]" 改成了 alt="$_G[forum_thread][subject]" title="$_G[forum_thread][subject]" 而已。





上一篇:discuz搜索结果增加缩略图显示代码及教程
下一篇:dz论坛带数字序号的调用方式
如无回复请发邮件