Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

解决升级 Discuz! X2.5 R20121101 后,审核帖子不显示标题的情况

[复制链接]
m.king 发表于 2012-11-7 10:58:26 | 显示全部楼层 |阅读模式
BUG解决方案
适用版本: Discuz! X2.5 » R20121101
影响程度: 一般
本帖最后由 m.king 于 2012-11-7 12:08 编辑

问题症状
       后台审核帖子不显示标题,包括前台的审核页面不显示帖子标题。

问题方法
       方法1:【适用于文件未做修改的用户】
              下载覆盖文件:   
              

              解压覆盖文件
              source\admincp\moderate\moderate_reply.php
              source\include\modcp\modcp_moderate.php

       方法2:【适用于文件已做自定义二次开发的用户】

一 、 打开文件:source\admincp\moderate\moderate_reply.php
1 、找到代码:
  1.         if($postarr) {
  2.                 $_fids = array();
  3.                 foreach($postarr as $_post) {
  4.                         $_fids[$_post['fid']] = $_post['fid'];
  5.                 }
  6.                 $_forums = C::t('forum_forum')->fetch_all($_fids);
  7.         }
复制代码
替换为:
  1.         if($postarr) {
  2.                 $_tids = $_fids = array();
  3.                 foreach($postarr as $_post) {
  4.                         $_fids[$_post['fid']] = $_post['fid'];
  5.                         $_tids[$_post['tid']] = $_post['tid'];
  6.                 }
  7.                 $_forums = C::t('forum_forum')->fetch_all($_fids);
  8.                 $_threads = C::t('forum_thread')->fetch_all($_tids);
  9.         }
复制代码
2、找到代码:
  1. $post['dateline'] = dgmdate($post['dateline']);
复制代码
替换为:
  1. $post['dateline'] = dgmdate($post['dateline']);
  2.                 $post['tsubject'] = $_threads[$post['tid']]['subject'];
复制代码
3、找到代码:
  1. "<h3><a href="javascript:;" onclick="display_toggle('$post[pid]');">$post[subject]</a> $post_censor_text</h3><p>$post[useip]</p>",
复制代码
替换为:
  1. "<h3>$post[tsubject] &rsaquo; <a href="javascript:;" onclick="display_toggle('$post[pid]');">$post[subject]</a> $post_censor_text</h3><p>$post[useip]</p>",
复制代码
4、 找到代码:
  1. $post['subject'] = $post['subject'] ? '<b>'.$post['subject'].'</b>' : '<i>'.$lang['nosubject'].'</i>';
复制代码
替换为:
  1. $post['subject'] = $post['subject'] ? '<b>'.$post['subject'].'</b>' : '';
复制代码
二 、 打开文件:source\include\modcp\modcp_moderate.php
1、找到代码:
  1. $_fids[$_post['fid']] = $post['fid'];
复制代码
替换为:
  1. $_fids[$post['fid']] = $post['fid'];
  2.                         $_tids[$post['tid']] = $post['tid'];
复制代码
2、找到代码:
  1. $_forums = array();
  2.                 if($_fids) {
  3.                         $_forums = C::t('forum_forum')->fetch_all($_fids);
  4.                         foreach($postlist as &$_post) {
  5.                                 $_forum = $_forums[$_post['fid']];
  6.                                 $_arr = array(
  7.                                         'forumname' => $_forum['name'],
  8.                                         'allowsmilies' => $_forum['allowsmilies'],
  9.                                         'allowhtml' => $_forum['allowhtml'],
  10.                                         'allowbbcode' => $_forum['allowbbcode'],
  11.                                         'allowimgcode' => $_forum['allowimgcode'],
  12.                                 );
  13.                                 $_post = array_merge($_post, $_arr);
  14.                         }
  15.                 }
复制代码
替换为:
  1.                 $_threads = $_forums = array();
  2.                 if($_fids) {
  3.                         $_forums = C::t('forum_forum')->fetch_all($_fids);
  4.                         foreach($postlist as &$_post) {
  5.                                 $_forum = $_forums[$_post['fid']];
  6.                                 $_arr = array(
  7.                                         'forumname' => $_forum['name'],
  8.                                         'allowsmilies' => $_forum['allowsmilies'],
  9.                                         'allowhtml' => $_forum['allowhtml'],
  10.                                         'allowbbcode' => $_forum['allowbbcode'],
  11.                                         'allowimgcode' => $_forum['allowimgcode'],
  12.                                 );
  13.                                 $_post = array_merge($_post, $_arr);
  14.                         }
  15.                 }
  16.                 if($_tids) {
  17.                         var_dump($_tids);
  18.                         $_threads = C::t('forum_thread')->fetch_all($_tids);
  19.                         foreach($postlist as &$_post) {
  20.                                 $_post['tsubject'] = $_threads[$_post['tid']]['subject'];
  21.                         }
  22.                 }
复制代码
然后您看看是否正常显示了。
有问题跟帖说明情况啊!


本帖子中包含更多资源

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

x

评分

2

查看全部评分

1314学习网 发表于 2012-11-7 11:29:14 | 显示全部楼层
前排支持。。。
回复

使用道具 举报

 楼主| m.king 发表于 2012-11-7 11:29:40 | 显示全部楼层
本帖最后由 m.king 于 2012-11-7 12:10 编辑

按照方法 2 、 修改文件一 、第 4 步。
能解决,显示主题标题后显示的【 &#8250; 无标题 】。
这个无标题是回帖的标题。

评分

1

查看全部评分

回复

使用道具 举报

neol123 发表于 2012-11-7 11:33:28 | 显示全部楼层
m.king 发表于 2012-11-7 11:29
按照以上方法修改后,可能大多数人会觉得后面还有个【 &#8250; 无标题 】这个无标题是回帖的标题,这个不是 ...

你们从审核者角度考虑了这个问题了吗?


审核的时候。站长想的是:这个回帖是回复的哪一个帖子的回帖啊?一般情况 可以大概知道这个回帖和帖子内容的关联性是否大,有时候也是是否通过的一个标准呢。。。

以前那个就很好。

现在你们非要改成了这个所谓回帖的标题

试问下。。。一百个里面有三个人会 将自己回帖写标题的吗?

百分之9999.9的人都会在 最下面快捷回复直接回帖。。或者 直接点击回复。。浮动窗口写回帖

这里面回复框都没有写标题的栏!!

怎么写标题。


相反。我觉得回帖的要写上 标题 这个功能可以彻底去掉

使用率太低了

相反增加复杂度

评分

1

查看全部评分

回复

使用道具 举报

solidedge 发表于 2012-11-7 11:45:33 | 显示全部楼层
同意楼上观点,回帖标题仅在分割主题时有点用处,但是分割主题的标题还是要自己重新输入更加稳妥一些!
回复

使用道具 举报

1314学习网 发表于 2012-11-7 11:45:36 | 显示全部楼层
neol123 发表于 2012-11-7 11:33
你们从审核者角度考虑了这个问题了吗?

有点道理
回复

使用道具 举报

neol123 发表于 2012-11-7 12:27:07 | 显示全部楼层
赞一个

你们反映很速度

呵呵


回复

使用道具 举报

hh427 发表于 2012-11-7 14:05:09 | 显示全部楼层
1101的补丁包是否已经重新更新包含了此解决方案?
回复

使用道具 举报

mark35 发表于 2012-11-7 16:52:38 | 显示全部楼层
neol123 发表于 2012-11-7 11:33
你们从审核者角度考虑了这个问题了吗?

赞同。跟帖标题毫无用处。在审核时显示被审核帖主题的标题对审核操作是有帮助的
回复

使用道具 举报

mark35 发表于 2012-11-7 16:54:50 | 显示全部楼层

  1.         if($postarr) {
  2.                 $_tids = $_fids = array();
  3.                 foreach($postarr as $_post) {
  4.                         $_fids[$_post['fid']] = $_post['fid'];
  5.                         $_tids[$_post['tid']] = $_post['tid'];
  6.                 }
  7.                 $_forums = C::t('forum_forum')->fetch_all($_fids);
  8.                 $_threads = C::t('forum_thread')->fetch_all($_tids);
  9.         }
复制代码
感觉这些问题和X2.5的所谓新构架有关:本来一条连表查询SQL给拆分成多条单表查询然后在PHP中做集合处理。对于中小型系统来说如此处理既降低性能也容易产生逻辑bug

评分

1

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-3-29 09:48 , Processed in 0.137630 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表