EOT; showtagheader('div', 'searchposts', !$searchsubmit && empty($newlist)); showformheader("postcomment".(!empty($_GET['search']) ? '&search=true' : ''), '', 'postcommentforum'); showhiddenfields(array('page' => $page, 'pp' => $_GET['pp'] ? $_GET['pp'] : $_GET['perpage'])); showtableheader(); showsetting('postcomment_search_detail', 'detail', $detail, 'radio'); showsetting('comment_search_perpage', '', $_GET['perpage'], ""); showsetting('postcomment_content', 'message', $message, 'text'); showsetting('postcomment_search_tid', 'searchtid', $searchtid, 'text'); showsetting('postcomment_search_pid', 'searchpid', $searchpid, 'text'); showsetting('postcomment_search_author', 'author', $author, 'text'); showsetting('postcomment_search_authorid', 'authorid', $authorid, 'text'); showsetting('comment_search_ip', 'ip', $ip, 'text'); showsetting('postcomment_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange'); showsubmit('searchsubmit'); showtablefooter(); showformfooter(); showtagfooter('div'); } else { $cids = authcode($cids, 'DECODE'); $cidsadd = $cids ? explode(',', $cids) : $_GET['delete']; $pids = array(); foreach(C::t('forum_postcomment')->fetch_all($cidsadd) as $postcomment) { $pids[$postcomment['pid']] = $postcomment['pid']; } C::t('forum_postcache')->delete($pids); $cidsadd && C::t('forum_postcomment')->delete($cidsadd); $cpmsg = cplang('postcomment_delete'); ?> fetch_all_uid_by_username(array_map('trim', explode(',', $author))); $authorid = ($authorid ? $authorid.',' : '').implode(',',$authorids); } $authorid = trim($authorid,', '); if($starttime != '0') { $starttime = strtotime($starttime); } if($_G['adminid'] == 1 && $endtime != dgmdate(TIMESTAMP, 'Y-n-j')) { if($endtime != '0') { $endtime = strtotime($endtime); } } else { $endtime = TIMESTAMP; } if(($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16) || ($_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8)) { $error = 'comment_mod_range_illegal'; } if(!$error) { if($detail) { $commentcount = C::t('forum_postcomment')->count_by_search($searchtid, $searchpid, ($authorid ? explode(',', str_replace(' ', '', $authorid)) : null), $starttime, $endtime, $ip, $message); if($commentcount) { $_GET['perpage'] = intval($_GET['perpage']) < 1 ? 20 : intval($_GET['perpage']); $perpage = $_GET['pp'] ? $_GET['pp'] : $_GET['perpage']; $comments = ''; foreach(C::t('forum_postcomment')->fetch_all_by_search($searchtid, $searchpid, ($authorid ? explode(',', str_replace(' ', '', $authorid)) : null), $starttime, $endtime, $ip, $message, (($page - 1) * $perpage), $perpage) as $comment) { $comment['dateline'] = dgmdate($comment['dateline']); $comments .= showtablerow('', '', array( "", str_replace(array('[b]', '[/b]', '[/color]'), array('', '', ''), preg_replace("/\[color=([#\w]+?)\]/i", "", $comment['comment'])), ($comment['author'] ? "".$comment['author']."" : cplang('postcomment_guest')), $comment['dateline'], $comment['useip'], "".cplang('postcomment_pid')."" ), TRUE); } $multi = multi($commentcount, $perpage, $page, ADMINSCRIPT."?action=postcomment"); $multi = preg_replace("/href=\"".ADMINSCRIPT."\?action=postcomment&page=(\d+)\"/", "href=\"javascript:page(\\1)\"", $multi); $multi = str_replace("window.location='".ADMINSCRIPT."?action=postcomment&page='+this.value", "page(this.value)", $multi); } else { $error = 'postcomment_nonexistence'; } } else { $commentcount = 0; foreach(C::t('forum_postcomment')->fetch_all_by_search($searchtid, $searchpid, ($authorid ? explode(',', str_replace(' ', '', $authorid)) : null), $starttime, $endtime, $ip, $message) as $row) { $cids .= ','.$row['id']; $commentcount++; } $multi = ''; } } showtagheader('div', 'postlist', $searchsubmit || $newlist); showformheader('postcomment&frame=no', 'target="postcommentframe"'); showhiddenfields(array('cids' => authcode($cids, 'ENCODE'))); if(!$search_tips) { showtableheader(cplang('postcomment_new_result').' '.$commentcount, 'fixpadding'); } else { showtableheader(cplang('postcomment_result').' '.$commentcount.(empty($newlist) ? ' '.cplang('research').'' : ''), 'fixpadding'); } if($error) { echo "$lang[$error]"; } elseif($detail) { showsubtitle(array('', 'postcomment_content', 'author', 'time', 'ip' ,'')); echo $comments; } showsubmit('postcommentsubmit', 'delete', $detail ? 'del' : '', '', $multi); showtablefooter(); showformfooter(); echo ''; showtagfooter('div'); } ?>