notification_add($updo['uid'], 'doing', $note); } $_POST['refer'] = preg_replace("/((\\#|\\&highlight|\\-highlight|\\.html).*?)\$/", '', $_POST['refer']); if (strexists($_POST['refer'], '?')) { $_POST['refer'] .= "&highlight={$newid}#dl{$updo[doid]}"; } else { $_POST['refer'] .= "-highlight-{$newid}.html#dl{$updo[doid]}"; } showmessage('do_success', $_POST['refer'], 0); } //删除 if ($_GET['op'] == 'delete') { if (submitcheck('deletesubmit')) { if ($id) { $allowmanage = checkperm('managedoing'); $query = $_SGLOBAL['db']->query("SELECT dc.*, d.uid as duid FROM " . tname('docomment') . " dc, " . tname('doing') . " d WHERE dc.id='{$id}' AND dc.doid=d.doid"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { if ($allowmanage || $value['uid'] == $_SGLOBAL['supe_uid'] || $value['duid'] == $_SGLOBAL['supe_uid']) { $_SGLOBAL['db']->query("DELETE FROM " . tname('docomment') . " WHERE (id='{$id}' || upid='{$id}')"); $replynum = getcount('docomment', array('doid' => $value['doid'])); updatetable('doing', array('replynum' => $replynum), array('doid' => $value['doid'])); } } } else { include_once S_ROOT . './source/function_delete.php'; deletedoings(array($doid)); } showmessage('do_success', $_POST['refer'], 0); } } include template('cp_doing');
<?php if (!defined('iBUAA') || !defined('IN_ADMINCP')) { exit('Access Denied'); } //权限 if (!($allowmanage = checkperm('managedoing'))) { $_GET['uid'] = $_SGLOBAL['supe_uid']; //只能操作本人的 $_GET['username'] = ''; } if (submitcheck('batchsubmit')) { include_once S_ROOT . './source/function_delete.php'; if (!empty($_POST['ids']) && deletedoings($_POST['ids'])) { cpmessage('do_success', $_POST['mpurl']); } else { cpmessage('choose_to_delete_events', $_POST['mpurl']); } } $mpurl = 'admincp.php?ac=doing'; //处理搜索 $intkeys = array('uid'); $strkeys = array('ip', 'username'); $randkeys = array(array('sstrtotime', 'dateline')); $likekeys = array('message'); $results = getwheres($intkeys, $strkeys, $randkeys, $likekeys); $wherearr = $results['wherearr']; $wheresql = empty($wherearr) ? '1' : implode(' AND ', $wherearr); $mpurl .= '&' . implode('&', $results['urls']); //排序 $orders = getorders(array('dateline', 'lastpost'), 'doid');
} if ($pics) { deletepics($pics); } else { $next = 0; $nextdeleteitem = 'doing'; } } if ($deleteitem == 'doing') { $doings = array(); $query = C::t('home_doing')->fetch_all_by_uid_doid($uids, '', '', 0, $pertask); foreach ($query as $doings) { $doings[] = $doing['doid']; } if ($doings) { deletedoings($doings); } else { $next = 0; $nextdeleteitem = 'share'; } } if ($deleteitem == 'share') { $shares = array(); foreach (C::t('home_share')->fetch_all_by_uid($uids, $pertask) as $share) { $shares[] = $share['sid']; } if ($shares) { deleteshares($shares); } else { $next = 0; $nextdeleteitem = 'feed';
showtableheader(); showsetting('doing_search_detail', 'detail', $detail, 'radio'); showsetting('doing_search_user', 'users', $users, 'text'); showsetting('doing_search_ip', 'userip', $userip, 'text'); showsetting('doing_search_keyword', 'keywords', $keywords, 'text'); showsetting('doing_search_lengthlimit', 'lengthlimit', $lengthlimit, 'text'); showsetting('doing_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange'); showsubmit('searchsubmit'); showtablefooter(); showformfooter(); showtagfooter('div'); } else { $doids = authcode($doids, 'DECODE'); $doidsadd = $doids ? explode(',', $doids) : $_G['gp_delete']; include_once libfile('function/delete'); $deletecount = count(deletedoings($doidsadd)); $cpmsg = cplang('doing_succeed', array('deletecount' => $deletecount)); ?> <script type="text/JavaScript">alert('<?php echo $cpmsg; ?> ');parent.$('doingforum').searchsubmit.click();</script> <?php } if (submitcheck('searchsubmit')) { $doids = $doingcount = '0'; $sql = $error = ''; $keywords = trim($keywords); $users = trim($users); if ($users != '') { $uids = '-1';
} elseif ($type == 'cloud') { $tab = 5; $firstday = date("Ym01", time()); $nowday = date("Ymd"); $startDay = $_GET['starttime'] ? trim($_GET['starttime']) : $firstday; $endDay = $_GET['endtime'] ? trim($_GET['endtime']) : $nowday; $query = $_SGLOBAL['db']->query("select tag_word as text, sum(tag_count) as weight from " . tname("complain_tagcloud") . " where datatime >= '{$startDay}' and datatime < '{$endDay}' group by tag_word"); $tags = array(); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $tags[] = $value; } } elseif ($type == 'complains') { $removedoid = $_GET['remove'] ? intval($_GET['remove']) : 0; if ($removedoid) { include_once S_ROOT . './source/function_delete.php'; deletedoings(array($removedoid)); showmessage('do_success', $_SERVER['HTTP_REFERER']); } $tab = 1; $Complains = array(); //存放complain记录 $perpage = 20; $page = empty($_GET['page']) ? 1 : intval($_GET['page']); if ($page < 1) { $page = 1; } $start = ($page - 1) * $perpage; //检查开始数 ckstart($start, $perpage); $firstday = date("Y-m-01", time()); $nowday = date("Y-m-d");
$moderation[$act][] = $doid; } } if ($validate_doids = dimplode($moderation['validate'])) { DB::update('home_doing', array('status' => '0'), "doid IN ({$validate_doids})"); $query_t = DB::query("SELECT * FROM " . DB::table('home_doing') . " WHERE doid IN ({$validate_doids})"); while ($doing = DB::fetch($query_t)) { $feedarr = array('appid' => '', 'icon' => 'doing', 'uid' => $doing['uid'], 'username' => $doing['username'], 'dateline' => $doing['dateline'], 'title_template' => lang('feed', 'feed_doing_title'), 'title_data' => daddslashes(serialize(dstripslashes(array('message' => $doing['message'])))), 'body_template' => '', 'body_data' => '', 'id' => $doing['doid'], 'idtype' => 'doid'); DB::insert('home_feed', $feedarr); } $validates = DB::affected_rows(); updatemoderate('doid', $moderation['validate'], 2); } if (!empty($moderation['delete'])) { require_once libfile('function/delete'); $doings = deletedoings($moderation['delete']); $deletes = count($doings); updatemoderate('doid', $moderation['delete'], 2); } if ($ignore_doids = dimplode($moderation['ignore'])) { DB::update('home_doing', array('status' => '2'), "doid IN ({$ignore_doids})"); $ignores = DB::affected_rows(); updatemoderate('doid', $moderation['ignore'], 1); } if ($_G['gp_fast']) { echo callback_js($_G['gp_doid']); exit; } else { cpmsg('moderate_doings_succeed', "action=moderate&operation=doings&page={$page}&filter={$filter}&dateline={$_G['gp_dateline']}&username={$_G['gp_username']}&keyword={$_G['gp_keyword']}&tpp={$_G['gp_tpp']}&showcensor={$showcensor}", 'succeed', array('validates' => $validates, 'ignores' => $ignores, 'deletes' => $deletes)); } }
function deleteinfo($ids) { global $_SGLOBAL; include_once S_ROOT . './source/function_delete.php'; $deltype = array(); $reportuser = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('report') . " WHERE rid IN (" . simplode($ids) . ")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['user'] = unserialize($value['uids']); $reportuser[] = array_shift(array_flip($value['user'])); $deltype[$value['idtype']][] = $value['id']; } $gid = getgroupid($_SGLOBAL['member']['experience'], $_SGLOBAL['member']['groupid']); //执行相应的删除操作 $i = 0; $_SGLOBAL['usergroup'][$gid]['managebatch'] = 1; foreach ($deltype as $key => $value) { switch ($key) { case 'blogid': $_SGLOBAL['usergroup'][$gid]['manageblog'] = 1; deleteblogs($value); break; case 'arrangementid': $_SGLOBAL['usergroup'][$gid]['manageblog'] = 1; deletearrangements($value); break; case 'picid': $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1; deletepics($value); break; case 'albumid': $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1; deletealbums($value); break; case 'tid': $_SGLOBAL['usergroup'][$gid]['managethread'] = 1; deletethreads(0, $value); break; case 'tagid': $_SGLOBAL['usergroup'][$gid]['managemtag'] = 1; deletemtag($value); break; case 'sid': $_SGLOBAL['usergroup'][$gid]['manageshare'] = 1; deleteshares($value); break; case 'uid': $_SGLOBAL['usergroup'][$gid]['managedelspace'] = 1; foreach ($value as $uid) { deletespace($uid); } break; case 'eventid': $_SGLOBAL['usergroup'][$gid]['manageevent'] = 1; deleteevents($value); break; case 'pid': $_SGLOBAL['usergroup'][$gid]['managepoll'] = 1; deletepolls($value); break; case 'comment': $_SGLOBAL['usergroup'][$gid]['managecomment'] = 1; deletecomments($value); break; case 'post': $_SGLOBAL['usergroup'][$gid]['managethread'] = 1; deleteposts(0, $value); break; case 'doid': $_SGLOBAL['usergroup'][$gid]['managedoing'] = 1; deletedoings($value); break; } //奖励第一个举报者 getreward('report', 1, $reportuser[$i], '', 0); $i++; } }
function deletefeeds($feedids) { global $_SGLOBAL; $allowmanage = checkperm('managefeed'); $managebatch = checkperm('managebatch'); $delnum = 0; $feeds = $newfeedids = $newdoids = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('feed') . " WHERE feedid IN (" . simplode($feedids) . ")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { if ($allowmanage || $value['uid'] == $_SGLOBAL['supe_uid']) { //¹ÜÀíÔ±/×÷Õß $newfeedids[] = $value['feedid']; if ($value['icon'] == 'doing') { $newdoids[] = $value['id']; } if (!$managebatch && $value['uid'] != $_SGLOBAL['supe_uid']) { $delnum++; } $feeds[] = $value; } } if (empty($newfeedids) || !$managebatch && $delnum > 1) { return array(); } $_SGLOBAL['db']->query("UPDATE " . tname('feed') . " SET isdeleted=1 WHERE feedid IN (" . simplode($newfeedids) . ")"); //ɾ³ýÏàÓ¦µÄËßÇó¼Ç¼ÐÅÏ¢ //$_SGLOBAL['db']->query("DELETE FROM ".tname('complain')." WHERE doid IN (".simplode($newdoids).")"); // deleteComplains($newdoids); if (!empty($newdoids)) { deletedoings($newdoids); } return $feeds; }