Ejemplo n.º 1
0
     }
     $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) {
     // Decide if we need to send back '1' or a more complicated response including page links and comment counts
     _nxt_ajax_delete_comment_response($comment->comment_ID, $delta);
 }
 die('0');
 break;
Ejemplo n.º 2
0
 }
 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':
         nxt_delete_comment($comment_id);
         $deleted++;
         break;
 }