fetch_all_post('tid:'.$_G['tid'], $topiclist) as $post) { if($post['tid'] != $_G['tid']) { continue; } $banstatus = ($post['status'] & 1) || $banstatus; $authors[$post['authorid']] = 1; $posts[] = $post; } $authorcount = count(array_keys($authors)); if(!submitcheck('modsubmit')) { $banid = $checkunban = $checkban = ''; foreach($topiclist as $id) { $banid .= ''; } $banstatus ? $checkunban = 'checked="checked"' : $checkban = 'checked="checked"'; if($modpostsnum == 1 || $authorcount == 1) { include_once libfile('function/member'); $crimenum = crime('getcount', $posts[0]['authorid'], 'crime_banpost'); $crimeauthor = $posts[0]['author']; } include template('forum/topicadmin_action'); } else { $banned = intval($_GET['banned']); $modaction = $banned ? 'BNP' : 'UBN'; $reason = checkreasonpm(); include_once libfile('function/member'); $pids = $comma = ''; foreach($posts as $k => $post) { if($banned) { C::t('forum_postcomment')->delete_by_rpid($post['pid']); C::t('forum_post')->increase_status_by_pid('tid:'.$_G['tid'], $post['pid'], 1, '|', true); crime('recordaction', $post['authorid'], 'crime_banpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $_G['tid'], 'pid' => $post['pid']))); } else { C::t('forum_post')->increase_status_by_pid('tid:'.$_G['tid'], $post['pid'], 1, '&~', true); } $pids .= $comma.$post['pid']; $comma = ','; } $resultarray = array( 'redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page=$page", 'reasonpm' => ($sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_ban_post', 'notictype' => 'post') : array()), 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), 'modtids' => 0, 'modlog' => $thread ); } ?>