本帖最后由 下砂 于 2012-1-4 14:28 编辑
问题描述:
在版主管理面板删除帖子,回收站里不显示删帖人和删帖时间
解决方法:
打开:source/include/modcp/modcp_thread.php
找到:- if($pids = dimplode($_G['gp_delete'])) {
- $result = $modsession->get($cachekey);
- $result['pids'] = explode(',', $result['pids']);
- $keys = array_flip($result['pids']);
-
- $query = DB::query('SELECT fid, tid, pid, first, authorid FROM '.DB::table(getposttable($posttableid)).' WHERE '."pid IN ($pids) $fidadd");
- while($post = DB::fetch($query)) {
- $prune['forums'][$post['fid']] = $post['fid'];
- @$prune['thread'][$post['tid']]++;
- $pidsdelete[$post['fid']][$post['pid']] = $post['pid'];
- if($post['first']) {
- $tidsdelete[$post['fid']][$post['tid']] = $post['tid'];
- }
- $key = $keys[$post['pid']];
- unset($result['pids'][$key]);
- }
- $result['pids'] = implode(',', $result['pids']);
- $result['count'] = count($result['pids']);
- $modsession->set($cachekey, $result, true);
- unset($result);
- }
- if($pidsdelete) {
- require_once libfile('function/post');
- require_once libfile('function/delete');
- $forums = array();
- $query = DB::query('SELECT fid, recyclebin FROM '.DB::table('forum_forum')." WHERE fid IN (".dimplode($prune['forums']).")");
- while($value = DB::fetch($query)) {
- $forums[$value['fid']] = $value;
- }
- foreach($pidsdelete as $fid => $pids) {
- $deletedposts = deletepost($pids, 'pid', !getgpc('nocredit'), $posttableid, $forums[$fid]['recyclebin']);
- $deletedthreads = deletethread($tidsdelete[$fid], false, !getgpc('nocredit'), $forums[$fid]['recyclebin']);
- }
复制代码 替换为:- if($pids = dimplode($_G['gp_delete'])) {
- $result = $modsession->get($cachekey);
- $result['pids'] = explode(',', $result['pids']);
- $keys = array_flip($result['pids']);
-
- $query = DB::query('SELECT fid, tid, pid, first, authorid FROM '.DB::table(getposttable($posttableid)).' WHERE '."pid IN ($pids) $fidadd");
- while($post = DB::fetch($query)) {
- $prune['forums'][$post['fid']] = $post['fid'];
- $pidsdelete[$post['fid']][$post['pid']] = $post['pid'];
- $pids_tids[$post['pid']] = $post['tid'];
- if($post['first']) {
- $tidsdelete[$post['pid']] = $post['tid'];
- } else {
- @$prune['thread'][$post['tid']]++;
- }
- $key = $keys[$post['pid']];
- unset($result['pids'][$key]);
- }
- $result['pids'] = implode(',', $result['pids']);
- $result['count'] = count($result['pids']);
- $modsession->set($cachekey, $result, true);
- unset($result);
- }
- if($pidsdelete) {
- require_once libfile('function/post');
- require_once libfile('function/delete');
- $forums = array();
- $query = DB::query('SELECT fid, recyclebin FROM '.DB::table('forum_forum')." WHERE fid IN (".dimplode($prune['forums']).")");
- while($value = DB::fetch($query)) {
- $forums[$value['fid']] = $value;
- }
- foreach($pidsdelete as $fid => $pids) {
- foreach($pids as $pid) {
- if(!$tidsdelete[$pid]) {
- $deletedposts = deletepost($pid, 'pid', !getgpc('nocredit'), $posttableid, $forums[$fid]['recyclebin']);
- updatemodlog($pids_tids[$pid], 'DLP');
- } else {
- $deletedthreads = deletethread($tidsdelete[$pid], false, !getgpc('nocredit'), $forums[$fid]['recyclebin']);
- updatemodlog($tidsdelete[$pid], 'DEL');
- }
- }
- }
- updatemodworks($modaction, $modpostsnum);
- foreach($threadlist as $thread) {
- modlog($thread, $modaction);
- }
复制代码 |