DiscuzX3.4列表页标题字数修改并去掉省略号

 时间:2026-02-15 03:30:32

1、找到 dz论坛目录下 的 :  template\default\forum\forumdisplay_list.htm w文件,并打开

DiscuzX3.4列表页标题字数修改并去掉省略号

2、搜索代码:$thread[subject],应该会找到5处,只修改其中的两处代码  

第一处为:

<a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra"$thread[highlight]{if $thread['isgroup'] == 1 || $thread['forumstick']} target="_blank"{else} onclick="atarget(this)"{/if} class="s xst">$thread[subject]</a>

第二处为:<a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra"$thread[highlight]{if $thread['isgroup'] == 1 || $thread['forumstick']} target="_blank"{else} onclick="atarget(this)"{/if} title="$thread[subject]">$thread[subject]</a>

———————————————————————————————

第一处修改为:

<a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra"$thread[highlight]{if $thread['isgroup'] == 1 || $thread['forumstick']} target="_blank"{else} onclick="atarget(this)"{/if} class="s xst">{echo cutstr($thread[subject],100,'')}</a>

第爹各墨二处修改为:

<a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra"$thread[highlight]{if $thread['isgroup'] == 1 || $thread['forumstick']} target="_blank"{else} onclick="atarget(this)"{/if} title="$thread[subject]">{echo cutstr($thread[subject],100,'')}</a>

——————————————————————————————

讲解备注:

将这两处的 $thread[subject]  修改为 :{echo cutstr($thread[subject],100,'')}

意思是 截取100个字符串 (发现80-100个字符串显示出来的效果比绵裹较好看,自己也可以根据自己需要修改截取的数量),后面的''表示 去掉省略号

DiscuzX3.4列表页标题字数修改并去掉省略号

DiscuzX3.4列表页标题字数修改并去掉省略号

3、最后 :更新缓存,在后台--->工具---->更新缓存  里面更新

这样就可以将列表页面显示的标题字数修改了,也去掉了省略号

注意:

1:  之前已经有省略号的 标题是改不了的,数据库存进去了

2:  如果字数显示的不多的,那就是调拒你还需要修改一处(将发帖时候的字数限制80个字符 也修改了  )

  • 蜀门仙禽单刷35副本全攻略
  • 易语言鼠标指针
  • 易语言到时间
  • discuz站点的模板目录介绍
  • 用易语言如何制作不规则透明窗口
  • 热门搜索
    旅游产品有哪些 走途旅游网 成都有哪些旅游景点 石家庄旅游地图 贺州旅游景点 黄山风景区旅游攻略 珠海东澳岛旅游攻略 蚂蚁窝旅游网 俄罗斯中国旅游年 去哪儿旅游网