diff --git a/upload/source/admincp/admincp_recyclebin.php b/upload/source/admincp/admincp_recyclebin.php index 39a7a289b443315527a3ca26bcbafbfd666a2925..ede1836e6122b5e0f7dcdf277cda2e91ec8c90dd 100644 --- a/upload/source/admincp/admincp_recyclebin.php +++ b/upload/source/admincp/admincp_recyclebin.php @@ -294,10 +294,10 @@ EOT; $deletetids = array(); $timestamp = TIMESTAMP; - $pernum = 500; + $pernum = 20; $threadsdel = intval($_GET['threadsdel']); $days = intval($_GET['days']); - foreach(C::t('forum_threadmod')->fetch_all_recyclebin_by_dateline($timestamp-($days * 86400), 0, $pernum) as $thread) { + foreach(C::t('forum_thread')->fetch_all_recyclebin_by_dateline($timestamp-($days * 86400), 0, $pernum) as $thread) { $deletetids[] = $thread['tid']; } if($deletetids) { @@ -305,7 +305,7 @@ EOT; $delcount = deletethread($deletetids); $threadsdel += $delcount; $startlimit += $pernum; - cpmsg('recyclebin_clean_next', 'action=recyclebin&operation=clean&rbsubmit=1&threadsdel='.$threadsdel.'&days='.$days, 'succeed', array('threadsdel' => $threadsdel)); + cpmsg('recyclebin_clean_next', 'action=recyclebin&operation=clean&rbsubmit=1&threadsdel='.$threadsdel.'&days='.$days, 'loading', array('threadsdel' => $threadsdel)); } else { cpmsg('recyclebin_succeed', 'action=recyclebin&operation=clean', 'succeed', array('threadsdel' => $threadsdel, 'threadsundel' => 0)); } diff --git a/upload/source/class/table/table_forum_thread.php b/upload/source/class/table/table_forum_thread.php index 2736fec2be7160479716adb7ffcac5104789eb24..8c96347fedc377ba028e10a2a34199fb561acf89 100644 --- a/upload/source/class/table/table_forum_thread.php +++ b/upload/source/class/table/table_forum_thread.php @@ -446,6 +446,10 @@ class table_forum_thread extends discuz_table LEFT JOIN '.DB::table('forum_forum').' f ON f.fid=t.fid '.$sql[0].' ORDER BY t.dateline DESC '.DB::limit($start, $limit), $sql[1]); } + public function fetch_all_recyclebin_by_dateline($dateline, $start = 0, $limit = 0) { + return DB::fetch_all("SELECT tid FROM %t WHERE displayorder=-1 AND dateline<%d".DB::limit($start, $limit), array($this->_table, $dateline)); + } + public function fetch_all_moderate($fid = 0, $displayorder = null, $isgroup = null, $dateline = null, $author = null, $subject = null) { $parameter = $this->make_query_condition(null, $fid, $isgroup, $author, $subject, $displayorder, $dateline); return DB::fetch_all('SELECT * FROM %t '.$parameter[0], $parameter[1], $this->_pk);