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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

在版主管理面板删除帖子,回收站里不显示删帖人和删帖时间的bug

[复制链接]
下砂 发表于 2012-1-4 14:28:03 | 显示全部楼层 |阅读模式
BUG解决方案
适用版本: Discuz! X2 » R20111010
影响程度: 重要
本帖最后由 下砂 于 2012-1-4 14:28 编辑

问题描述:
在版主管理面板删除帖子,回收站里不显示删帖人和删帖时间

解决方法:
打开:source/include/modcp/modcp_thread.php

找到:
  1. if($pids = dimplode($_G['gp_delete'])) {
  2.     $result = $modsession->get($cachekey);
  3.     $result['pids'] = explode(',', $result['pids']);
  4.     $keys = array_flip($result['pids']);
  5.    
  6.     $query = DB::query('SELECT fid, tid, pid, first, authorid FROM '.DB::table(getposttable($posttableid)).' WHERE '."pid IN ($pids) $fidadd");
  7.     while($post = DB::fetch($query)) {
  8.         $prune['forums'][$post['fid']] = $post['fid'];
  9.         @$prune['thread'][$post['tid']]++;
  10.         $pidsdelete[$post['fid']][$post['pid']] = $post['pid'];
  11.         if($post['first']) {
  12.             $tidsdelete[$post['fid']][$post['tid']] = $post['tid'];
  13.         }
  14.         $key = $keys[$post['pid']];
  15.         unset($result['pids'][$key]);
  16.     }
  17.     $result['pids'] = implode(',', $result['pids']);
  18.     $result['count'] = count($result['pids']);
  19.     $modsession->set($cachekey, $result, true);
  20.     unset($result);
  21. }

  22. if($pidsdelete) {
  23.     require_once libfile('function/post');
  24.     require_once libfile('function/delete');
  25.     $forums = array();
  26.     $query = DB::query('SELECT fid, recyclebin FROM '.DB::table('forum_forum')." WHERE fid IN (".dimplode($prune['forums']).")");
  27.     while($value = DB::fetch($query)) {
  28.         $forums[$value['fid']] = $value;
  29.     }
  30.     foreach($pidsdelete as $fid => $pids) {
  31.         $deletedposts = deletepost($pids, 'pid', !getgpc('nocredit'), $posttableid, $forums[$fid]['recyclebin']);
  32.         $deletedthreads = deletethread($tidsdelete[$fid], false, !getgpc('nocredit'), $forums[$fid]['recyclebin']);
  33.     }
复制代码
替换为:
  1. if($pids = dimplode($_G['gp_delete'])) {
  2.     $result = $modsession->get($cachekey);
  3.     $result['pids'] = explode(',', $result['pids']);
  4.     $keys = array_flip($result['pids']);
  5.    
  6.     $query = DB::query('SELECT fid, tid, pid, first, authorid FROM '.DB::table(getposttable($posttableid)).' WHERE '."pid IN ($pids) $fidadd");
  7.     while($post = DB::fetch($query)) {
  8.         $prune['forums'][$post['fid']] = $post['fid'];
  9.         $pidsdelete[$post['fid']][$post['pid']] = $post['pid'];
  10.         $pids_tids[$post['pid']] = $post['tid'];
  11.         if($post['first']) {
  12.             $tidsdelete[$post['pid']] = $post['tid'];
  13.         } else {
  14.             @$prune['thread'][$post['tid']]++;
  15.         }
  16.         $key = $keys[$post['pid']];
  17.         unset($result['pids'][$key]);
  18.     }
  19.     $result['pids'] = implode(',', $result['pids']);
  20.     $result['count'] = count($result['pids']);
  21.     $modsession->set($cachekey, $result, true);
  22.     unset($result);
  23. }

  24. if($pidsdelete) {
  25.     require_once libfile('function/post');
  26.     require_once libfile('function/delete');
  27.     $forums = array();
  28.     $query = DB::query('SELECT fid, recyclebin FROM '.DB::table('forum_forum')." WHERE fid IN (".dimplode($prune['forums']).")");
  29.     while($value = DB::fetch($query)) {
  30.         $forums[$value['fid']] = $value;
  31.     }
  32.     foreach($pidsdelete as $fid => $pids) {
  33.         foreach($pids as $pid) {
  34.             if(!$tidsdelete[$pid]) {
  35.                 $deletedposts = deletepost($pid, 'pid', !getgpc('nocredit'), $posttableid, $forums[$fid]['recyclebin']);
  36.                 updatemodlog($pids_tids[$pid], 'DLP');
  37.             } else {
  38.                 $deletedthreads = deletethread($tidsdelete[$pid], false, !getgpc('nocredit'), $forums[$fid]['recyclebin']);
  39.                 updatemodlog($tidsdelete[$pid], 'DEL');
  40.             }
  41.         }
  42.     }
  43.     updatemodworks($modaction, $modpostsnum);
  44.     foreach($threadlist as $thread) {
  45.         modlog($thread, $modaction);
  46.     }
复制代码

评分

1

查看全部评分

花到飞靡 发表于 2012-1-4 14:32:17 | 显示全部楼层
沙发支持了 。~~
回复

使用道具 举报

ybs885 发表于 2012-1-4 14:32:37 | 显示全部楼层
非常支持!!
回复

使用道具 举报

cr180 发表于 2012-1-4 14:33:06 | 显示全部楼层
这个不错 解决版主之间的烦恼
回复

使用道具 举报

nanhuboy 发表于 2012-1-4 14:35:44 | 显示全部楼层
方便跟踪操作·
回复

使用道具 举报

ARCHY` 发表于 2012-1-4 14:42:15 | 显示全部楼层
前排支持下了
回复

使用道具 举报

idong 发表于 2012-1-4 16:33:06 | 显示全部楼层
丫的,我还纳闷我去后台检查编辑的工作时怎么出现了没有操作人的情况....
回复

使用道具 举报

idong 发表于 2012-1-4 17:31:27 | 显示全部楼层
貌似没有解决问题。管理员的后台依然显示1970.1.1无操作人
回复

使用道具 举报

huangliming 发表于 2012-1-5 13:28:38 | 显示全部楼层
idong 发表于 2012-1-4 17:31
貌似没有解决问题。管理员的后台依然显示1970.1.1无操作人

对打完补丁之后新删除的帖子才有效哦
回复

使用道具 举报

idong 发表于 2012-1-5 13:30:02 | 显示全部楼层
huangliming 发表于 2012-1-5 13:28
对打完补丁之后新删除的帖子才有效哦

好吧,果然如此,我昨天还在想是不是这个问题呢....
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-5 13:57 , Processed in 0.108734 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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