Ejemplo n.º 1
0
     }
     $r = nxt_trash_comment($comment->comment_ID);
 } elseif (isset($_POST['untrash']) && 1 == $_POST['untrash']) {
     if ('trash' != $status) {
         die((string) time());
     }
     $r = nxt_untrash_comment($comment->comment_ID);
     if (!isset($_POST['comment_status']) || $_POST['comment_status'] != 'trash') {
         // undo trash, not in trash
         $delta = 1;
     }
 } elseif (isset($_POST['spam']) && 1 == $_POST['spam']) {
     if ('spam' == $status) {
         die((string) time());
     }
     $r = nxt_spam_comment($comment->comment_ID);
 } elseif (isset($_POST['unspam']) && 1 == $_POST['unspam']) {
     if ('spam' != $status) {
         die((string) time());
     }
     $r = nxt_unspam_comment($comment->comment_ID);
     if (!isset($_POST['comment_status']) || $_POST['comment_status'] != 'spam') {
         // undo spam, not in spam
         $delta = 1;
     }
 } elseif (isset($_POST['delete']) && 1 == $_POST['delete']) {
     $r = nxt_delete_comment($comment->comment_ID);
 } else {
     die('-1');
 }
 if ($r) {
Ejemplo n.º 2
0
 foreach ($comment_ids as $comment_id) {
     // Check the permissions on each
     if (!current_user_can('edit_comment', $comment_id)) {
         continue;
     }
     switch ($doaction) {
         case 'approve':
             nxt_set_comment_status($comment_id, 'approve');
             $approved++;
             break;
         case 'unapprove':
             nxt_set_comment_status($comment_id, 'hold');
             $unapproved++;
             break;
         case 'spam':
             nxt_spam_comment($comment_id);
             $spammed++;
             break;
         case 'unspam':
             nxt_unspam_comment($comment_id);
             $unspammed++;
             break;
         case 'trash':
             nxt_trash_comment($comment_id);
             $trashed++;
             break;
         case 'untrash':
             nxt_untrash_comment($comment_id);
             $untrashed++;
             break;
         case 'delete':