EOT;
showtagheader('div', 'threadsearch', !$searchsubmit);
showformheader('recyclebin&operation=search', '', 'rbsearchform');
showhiddenfields(array('page' => $page));
showtableheader('recyclebin_search');
showsetting('recyclebin_search_forum', '', '', $forumselect);
showsetting('recyclebin_search_author', 'authors', $authors, 'text');
showsetting('recyclebin_search_keyword', 'keywords', $keywords, 'text');
showsetting('recyclebin_search_admin', 'admins', $admins, 'text');
showsetting('recyclebin_search_post_time', array('pstarttime', 'pendtime'), array($pstarttime, $pendtime), 'daterange');
showsetting('recyclebin_search_mod_time', array('mstarttime', 'mendtime'), array($mstarttime, $mendtime), 'daterange');
if($secStatus){
showsetting('recyclebin_search_security_thread', 'security', $security, 'radio');
}
showsubmit('searchsubmit');
showtablefooter();
showformfooter();
showtagfooter('div');
/*search*/
if(submitcheck('searchsubmit')) {
$sql = '';
$isgroup = $fid = 0;
if($inforum == 'groupthread') {
$isgroup = 1;
} else {
$fid = $inforum ? $inforum : 0;
}
$author = $authors != '' ? explode(' ', $authors) : '';
$admins = $admins != '' ? explode(' ', $admins) : '';
$pstarttime = $pstarttime != '' ? strtotime($pstarttime) : '';
$pendtime = $pendtime != '' ? strtotime($pendtime) : '';
$mstarttime = $mstarttime != '' ? strtotime($mstarttime) : '';
$mendtime = $mendtime != '' ? strtotime($mendtime) : '';
$security = $secStatus && $security;
if($security){
$threadcount = C::t('#security#security_evilpost')->count_by_recyclebine($fid, $isgroup, $author, $admins, $pstarttime, $pendtime, $mstarttime, $mendtime, $keywords);
}else{
$threadcount = C::t('forum_thread')->count_by_recyclebine($fid, $isgroup, $author, $admins, $pstarttime, $pendtime, $mstarttime, $mendtime, $keywords);
}
$pagetmp = $page;
$multi = multi($threadcount, $_G['ppp'], $page, ADMINSCRIPT."?action=recyclebin");
$multi = preg_replace("/href=\"".ADMINSCRIPT."\?action=recyclebin&page=(\d+)\"/", "href=\"javascript:page(\\1)\"", $multi);
$multi = str_replace("window.location='".ADMINSCRIPT."?action=recyclebin&page='+this.value", "page(this.value)", $multi);
echo '';
showtagheader('div', 'threadlist', $searchsubmit);
showformheader('recyclebin&operation=search&frame=no', 'target="rbframe"', 'rbform');
showtableheader(cplang('recyclebin_result').' '.$threadcount.' '.cplang('research').'', 'fixpadding');
if($threadcount) {
if($security){
$searchresult = C::t('#security#security_evilpost')->fetch_all_by_recyclebine($fid, $isgroup, $author, $admins, $pstarttime, $pendtime, $mstarttime, $mendtime, $keywords, ($pagetmp - 1) * $_G['ppp'], $_G['ppp']);
}else{
$searchresult = C::t('forum_thread')->fetch_all_by_recyclebine($fid, $isgroup, $author, $admins, $pstarttime, $pendtime, $mstarttime, $mendtime, $keywords, ($pagetmp - 1) * $_G['ppp'], $_G['ppp']);
}
$issettids = array();
foreach($searchresult as $thread) {
$disabledstr = '';
if(isset($issettids[$thread['tid']])) {
$disabledstr = 'disabled';
} else {
$issettids[$thread['tid']] = $thread['tid'];
}
$post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']);
$thread = array_merge($thread, $post);
$thread['message'] = discuzcode($thread['message'], $thread['smileyoff'], $thread['bbcodeoff'], sprintf('%00b', $thread['htmlon']), $thread['allowsmilies'], $thread['allowbbcode'], $thread['allowimgcode'], $thread['allowhtml']);
$thread['moddateline'] = dgmdate($thread['moddateline']);
$thread['dateline'] = dgmdate($thread['dateline']);
if($thread['attachment']) {
require_once libfile('function/attachment');
foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$thread['tid'], 'tid', $thread['tid']) as $attach) {
$_G['setting']['attachurl'] = $attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl'];
$attach['url'] = $attach['isimage']
? " $attach[filename] (".sizecount($attach['filesize']).")
100) {this.resized=true; this.width=100;}\">"
: "$attach[filename] (".sizecount($attach['filesize']).")";
$thread['message'] .= "
$lang[attachment]: ".attachtype(fileext($attach['filename'])."\t").$attach['url'];
}
}
showtablerow("id=\"mod_$thread[tid]_row1\"", array('rowspan="3" class="rowform threadopt" style="width:80px;"', 'class="threadtitle"'), array(
"",
"$lang[author]: $thread[author] $lang[time]: $thread[dateline] $lang[threads_replies]: $thread[replies] $lang[threads_views]: $thread[views]
"
));
showtablerow("id=\"mod_$thread[tid]_row2\"", 'colspan="2" style="padding: 10px; line-height: 180%;"', ''.$thread['message'].'
');
showtablerow("id=\"mod_$thread[tid]_row3\"", 'class="threadopt threadtitle" colspan="2"', "$lang[operator]: $thread[modusername] $lang[recyclebin_delete_time]: $thread[moddateline] $lang[reason]: $thread[reason]");
}
}
showsubmit('rbsubmit', 'submit', '', ''.cplang('recyclebin_all_delete').' '.cplang('recyclebin_all_undelete').' '.cplang('recyclebin_all_ignore').' ', $multi);
showtablefooter();
showformfooter();
echo '';
showtagfooter('div');
}
} else {
$moderate = $_GET['moderate'];
$moderation = array('delete' => array(), 'undelete' => array(), 'ignore' => array());
if(is_array($moderate)) {
foreach($moderate as $tid => $action) {
$moderation[$action][] = intval($tid);
}
}
require_once libfile('function/delete');
$threadsdel = deletethread($moderation['delete']);
$threadsundel = undeletethreads($moderation['undelete']);
if($threadsdel || $threadsundel) {
$cpmsg = cplang('recyclebin_succeed', array('threadsdel' => $threadsdel, 'threadsundel' => $threadsundel));
} else {
$cpmsg = cplang('recyclebin_nothread');
}
?>
fetch_all_recyclebin_by_dateline($timestamp-($days * 86400), 0, $pernum) as $thread) {
$deletetids[] = $thread['tid'];
}
if($deletetids) {
require_once libfile('function/delete');
$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));
} else {
cpmsg('recyclebin_succeed', 'action=recyclebin&operation=clean', 'succeed', array('threadsdel' => $threadsdel, 'threadsundel' => 0));
}
}
}
?>