·设为首页收藏本站📧邮箱修改🎁免费下载专区📒收藏夹👽聊天室📱AI智能体
返回列表 发布新帖

请教一下有没有办法让discuz的回复缩短一些,显得紧凑

167 2
发表于 2023-2-28 09:32:44 | 查看全部 阅读模式

马上注册,免费下载更多dz插件网资源。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
请教一下有没有办法让discuz的回复缩短一些,显得紧凑
比如这样

请教一下有没有办法让discuz的回复缩短一些,显得紧凑 请教,一下,有没有,没有,办法


我要说一句 收起回复

评论2

CrystαlLv.8 发表于 2023-2-28 09:32:49 | 查看全部
显示上去掉HTML结构、左右空格即可。
我要说一句 收起回复
Discuz智能体Lv.8 发表于 2025-3-15 19:26:42 | 查看全部
要让Discuz的帖子回复显示更紧凑,可以通过以下5个维度进行深度优化(基于Discuz! X3.4内核):

1. 核心CSS层叠样式优化
在template/当前模板/common/extend_common.css中添加:
  1. /* 压缩回复区域 */
  2. .pl .pi {padding:8px 10px;margin-bottom:5px}
  3. .pl .authi {margin-right:5px;display:inline-block}
  4. .pl .authicn {width:16px;height:16px}
  5. .pl .pct {padding-top:5px}
  6. .pi .mn {line-height:1.2}

  7. /* 紧凑内容区 */
  8. .pcb {margin-left:60px}
  9. .pcb .t_f {font-size:13px;line-height:1.5}
  10. .quote {margin:5px 0;padding:5px}

  11. /* 行内元素布局 */
  12. .pi .xg1,.pi .xg1 a {display:inline;margin:0 3px}
  13. .pi .d {float:none;display:inline}
复制代码


2. 模板结构改造
修改template/当前模板/forum/viewthread_node.htm:
  1. <!-- 简化用户信息区 -->
  2. <div class="pi">
  3.         <!-- 合并用户身份组与昵称 -->
  4.         <strong class="authi">
  5.                 <!--{if $post['authorid']}-->
  6.                 <a href="home.php?mod=space&uid=$post[authorid]" target="_blank" class="xw1">$post[author]</a>
  7.                 <em class="xg1">• $post[status]</em>
  8.                 <!--{/if}-->
  9.         </strong>
  10.         <span class="xg1">$post[dateline]</span>
  11. </div>
复制代码


3. 头像展示优化
在模板中增加水平布局结构:
  1. <div class="plc cl">
  2.         <div class="avatar" style="width:40px;float:left">
  3.                 <!--{avatar($post,small)}-->
  4.         </div>
  5.         <div class="userinfo" style="width:120px;float:left">
  6.                 <!-- 用户基础信息 -->
  7.         </div>
  8.         <div class="postcontent" style="margin-left:160px">
  9.                 <!-- 帖子内容 -->
  10.         </div>
  11. </div>
复制代码


4. PHP端数据加载优化
在source/module/forum/forum_viewthread.php约第680行附近:
  1. // 精简返回字段
  2. $postlist = C::t('forum_post')->fetch_all_by_tid(
  3.         $tid,
  4.         true,
  5.         '',
  6.         $page,
  7.         $ppp,
  8.         $ordertype,
  9.         0,
  10.         array('author','dateline','message','useip','port','invisible','anonymous','usesig','htmlon','bbcodeoff','smileyoff','parseurloff','attachment','status')
  11. );
复制代码


5. 移动端适配调整
在template/当前模板/touch/forum/viewthread.htm中:
  1. <style>
  2. .mod-reply .list-item {padding:8px}
  3. .mod-reply .avatar {width:36px;height:36px}
  4. .mod-reply .content {margin-left:40px}
  5. </style>
复制代码


建议通过DZ插件网的样式优化工具包进行可视化调试,具体路径:DZ插件网 > 模板工具 > 紧凑模式生成器,可实时预览调整效果。注意修改前备份template目录,建议使用新建的模板风格进行调试。如果遇到层叠样式冲突,可使用!important属性强制覆盖默认样式。
-- 本回答由 人工智能 AI智能体 生成,内容仅供参考,请仔细甄别。
我要说一句 收起回复

回复

 懒得打字嘛,点击右侧快捷回复【查看最新发布】   【应用商城享更多资源】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

AI智能体
投诉/建议联系

discuzaddons@vip.qq.com

未经授权禁止转载,复制和建立镜像,
如有违反,按照公告处理!!!
  • 联系QQ客服
  • 添加微信客服

联系DZ插件网微信客服|最近更新|Archiver|手机版|小黑屋|DZ插件网! ( 鄂ICP备20010621号-1 )|网站地图 知道创宇云防御

您的IP:3.23.101.44,GMT+8, 2025-4-19 16:29 , Processed in 0.350194 second(s), 76 queries , Gzip On, Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2025 Discuz! Team.

关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表