예제 #1
0
                 echo json_encode(array("data" => '3', "url" => get_forum_link($fid)));
             }
         } else {
             redirect(get_forum_link($fid), $lang->redirect_threaddeleted);
         }
     } else {
         error_no_permission();
     }
 } else {
     if ($forumpermissions['candeleteposts'] == 1 || is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts")) {
         // Select the first post before this
         require_once MYBB_ROOT . "inc/class_moderation.php";
         $moderation = new Moderation();
         if ($mybb->settings['soft_delete'] == 1 || is_moderator($fid, "cansoftdeleteposts")) {
             $modlogdata['pid'] = $pid;
             $moderation->soft_delete_posts(array($pid));
             log_moderator_action($modlogdata, $lang->post_soft_deleted);
         } else {
             $moderation->delete_post($pid);
             mark_reports($pid, "post");
             log_moderator_action($modlogdata, $lang->post_deleted);
         }
         $query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline <= '{$post['dateline']}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "desc"));
         $next_post = $db->fetch_array($query);
         if ($next_post['pid']) {
             $redirect = get_post_link($next_post['pid'], $tid) . "#pid{$next_post['pid']}";
         } else {
             $redirect = get_thread_link($tid);
         }
         if ($mybb->input['ajax'] == 1) {
             header("Content-type: application/json; charset={$lang->settings['charset']}");
예제 #2
0
             if ($action == "delete" && $mybb->settings['soft_delete'] != 1) {
                 $moderation->delete_post($post['pid']);
             } else {
                 if ($action == "delete") {
                     $posts_to_delete[] = $post['pid'];
                 }
             }
         }
     }
     if (!empty($posts_to_approve)) {
         $moderation->approve_posts($posts_to_approve);
         log_moderator_action(array('pids' => $posts_to_approve), $lang->multi_approve_posts);
     }
     if (!empty($posts_to_delete)) {
         if ($mybb->settings['soft_delete'] == 1) {
             $moderation->soft_delete_posts($posts_to_delete);
             log_moderator_action(array('pids' => $posts_to_delete), $lang->multi_soft_delete_posts);
         } else {
             log_moderator_action(array('pids' => $posts_to_delete), $lang->multi_delete_posts);
         }
     }
     $plugins->run_hooks("modcp_do_modqueue_end");
     redirect("modcp.php?action=modqueue&type=posts", $lang->redirect_postsmoderated);
 } else {
     if (!empty($mybb->input['attachments'])) {
         $attachments = array_map("intval", array_keys($mybb->input['attachments']));
         $query = $db->query("\n\t\t\tSELECT a.pid, a.aid\n\t\t\tFROM  " . TABLE_PREFIX . "attachments a\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "posts p ON (a.pid=p.pid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "threads t ON (t.tid=p.tid)\n\t\t\tWHERE aid IN (" . implode(",", $attachments) . "){$tflist_queue_attach}\n\t\t");
         while ($attachment = $db->fetch_array($query)) {
             if (!isset($mybb->input['attachments'][$attachment['aid']])) {
                 continue;
             }
예제 #3
0
     if ($mybb->get_input('inlinetype') == 'search') {
         $posts = getids($mybb->get_input('searchid'), 'search');
     } else {
         $posts = getids($tid, 'thread');
     }
     if (count($posts) < 1) {
         error($lang->error_inline_nopostsselected);
     }
     $pids = array();
     if (!is_moderator_by_pids($posts, "cansoftdeleteposts")) {
         error_no_permission();
     }
     foreach ($posts as $pid) {
         $pids[] = (int) $pid;
     }
     $moderation->soft_delete_posts($pids);
     log_moderator_action($modlogdata, $lang->multi_soft_delete_posts);
     if ($mybb->get_input('inlinetype') == 'search') {
         clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
     } else {
         clearinline($tid, 'thread');
     }
     moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postssoftdeleted);
     break;
 case "do_purgespammer":
 case "purgespammer":
     require_once MYBB_ROOT . "inc/functions_user.php";
     $groups = explode(",", $mybb->settings['purgespammergroups']);
     if (!in_array($mybb->user['usergroup'], $groups)) {
         error_no_permission();
     }