$pernum = 200;
        $postsdel = intval($_GET['postsdel']);
        $days = intval($_GET['days']);
        $timestamp = TIMESTAMP - max(0, $days * 86400);
        $postlist = array();
        loadcache('posttableids');
        $posttables = !empty($_G['cache']['posttableids']) ? $_G['cache']['posttableids'] : array(0);
        foreach ($posttables as $ptid) {
            foreach (C::t('forum_post')->fetch_all_pid_by_invisible_dateline($ptid, -5, $timestamp, 0, $pernum) as $post) {
                $postlist[$ptid][] = $post['pid'];
            }
        }
        $postsundel = 0;
        if ($postlist) {
            foreach ($postlist as $ptid => $deletepids) {
                $postsdel += recyclebinpostdelete($deletepids, $ptid);
            }
            $startlimit += $pernum;
            cpmsg('recyclebinpost_clean_next', 'action=recyclebinpost&operation=clean&cleanrbsubmit=1&days=' . $days . '&postsdel=' . $postsdel, 'succeed', array('postsdel' => $postsdel));
        } else {
            cpmsg('recyclebinpost_succeed', 'action=recyclebinpost&operation=clean', 'succeed', array('postsdel' => $postsdel, 'postsundel' => $postsundel));
        }
    }
}
function recyclebinpostshowpostlist($fid, $authors, $starttime, $endtime, $keywords, $start_limit, $lpp)
{
    global $_G, $lang, $posttableid, $security;
    $tids = $fids = array();
    if ($security) {
        $postlist = C::t('#security#security_evilpost')->fetch_all_by_search($posttableid, null, $keywords, -5, $fid, null, $authors ? explode(',', str_replace(' ', '', $authors)) : null, strtotime($starttime), strtotime($endtime), null, null, $start_limit, $lpp);
    } else {
$cachekey = 'srchresult_recycle_post_' . $posttableid . '_' . $_G['fid'];
if ($_G['fid'] && $_G['forum']['ismoderator'] && $modforums['recyclebins'][$_G['fid']]) {
    $srchupdate = false;
    if (in_array($_G['adminid'], array(1, 2, 3)) && ($op == 'delete' || $op == 'restore') && submitcheck('dosubmit')) {
        if ($ids = dimplode($_GET['moderate'])) {
            $pidarray = array();
            foreach (C::t('forum_post')->fetch_all($posttableid, $_GET['moderate'], false) as $post) {
                if ($post['fid'] != $_G['fid'] || $post['invisible'] != '-5') {
                    continue;
                }
                $pidarray[] = $post['pid'];
            }
            if ($pidarray) {
                require_once libfile('function/misc');
                if ($op == 'delete' && $_G['group']['allowclearrecycle']) {
                    recyclebinpostdelete($pidarray, $posttableid);
                }
                if ($op == 'restore') {
                    recyclebinpostundelete($pidarray, $posttableid);
                }
                if ($_GET['oldop'] == 'search') {
                    $srchupdate = true;
                }
            }
        }
        $op = dhtmlspecialchars($_GET['oldop']);
        showmessage('modcp_recyclebinpost_' . $op . '_succeed', '', array(), array('break' => 1));
    }
    if ($op == 'search' && submitcheck('searchsubmit')) {
        if ($starttime || $endtime || trim($keywords) || trim($users)) {
            $pids = array();