Changeset 2258 for trunk/wp-admin/moderation.php
- Timestamp:
- 02/11/2005 01:52:19 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/moderation.php
r2233 r2258 5 5 $parent_file = 'edit.php'; 6 6 7 $wpvarstoreset = array('action', 'item_ignored', 'item_deleted', 'item_approved', ' feelinglucky');7 $wpvarstoreset = array('action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky'); 8 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 9 9 $wpvar = $wpvarstoreset[$i]; … … 39 39 $item_deleted = 0; 40 40 $item_approved = 0; 41 41 $item_spam = 0; 42 42 43 foreach($comment as $key => $value) { 43 44 if ($feelinglucky && 'later' == $value) … … 49 50 ++$item_ignored; 50 51 break; 51 52 52 case 'delete': 53 53 wp_set_comment_status($key, 'delete'); 54 54 ++$item_deleted; 55 55 break; 56 56 case 'spam': 57 wp_set_comment_status($key, 'spam'); 58 ++$item_spam; 59 break; 57 60 case 'approve': 58 61 wp_set_comment_status($key, 'approve'); 59 if ( get_settings('comments_notify') == true) {62 if ( get_settings('comments_notify') == true ) { 60 63 wp_notify_postauthor($key); 61 64 } … … 66 69 67 70 $file = basename(__FILE__); 68 header("Location: $file?ignored=$item_ignored&deleted=$item_deleted&approved=$item_approved ");71 header("Location: $file?ignored=$item_ignored&deleted=$item_deleted&approved=$item_approved&spam=$item_spam"); 69 72 exit(); 70 73 … … 78 81 echo "<div class='updated'>\n<p>"; 79 82 $approved = (int) $_GET['approved']; 80 $deleted = (int) $_GET['deleted']; 81 $ignored = (int) $_GET['ignored']; 83 $deleted = (int) $_GET['deleted']; 84 $ignored = (int) $_GET['ignored']; 85 $spam = (int) $_GET['spam']; 82 86 if ($approved) { 83 87 if ('1' == $approved) { … … 94 98 } 95 99 } 100 if ($spam) { 101 if ('1' == $spam) { 102 echo __("1 comment marked as spam <br />") . "\n"; 103 } else { 104 echo sprintf(__("%s comments marked as spam <br />"), $spam) . "\n"; 105 } 106 } 96 107 if ($ignored) { 97 108 if ('1' == $ignored) { … … 140 151 echo " <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\">" . __('Delete just this comment') . "</a> | "; ?> <?php _e('Bulk action:') ?> 141 152 <input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-approve" value="approve" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-approve"><?php _e('Approve') ?></label> 153 <input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-spam" value="spam" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-spam"><?php _e('Spam') ?></label> 142 154 <input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-delete" value="delete" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-delete"><?php _e('Delete') ?></label> 143 155 <input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-nothing" value="later" checked="checked" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-nothing"><?php _e('Defer until later') ?></label> … … 174 186 } 175 187 } 176 document.write('<ul><li><a href="javascript:markAllForApprove()"><?php _e('Mark all for approval'); ?></a></li><li><a href="javascript:markAllForDelete()"><?php _e('Mark all for deletion'); ?></a></li><li><a href="javascript:markAllForDefer()"><?php _e('Mark all for later'); ?></a></li></ul>'); 188 function markAllAsSpam() { 189 for (var i=0; i< document.approval.length; i++) { 190 if (document.approval[i].value == "spam") { 191 document.approval[i].checked = true; 192 } 193 } 194 } 195 document.write('<ul><li><a href="javascript:markAllForApprove()"><?php _e('Mark all for approval'); ?></a></li><li><a href="javascript:markAllAsSpam()"><?php _e('Mark all as spam'); ?></a></li><li><a href="javascript:markAllForDelete()"><?php _e('Mark all for deletion'); ?></a></li><li><a href="javascript:markAllForDefer()"><?php _e('Mark all for later'); ?></a></li></ul>'); 177 196 // ]]> 178 197 </script>
Note: See TracChangeset
for help on using the changeset viewer.