Changeset 5700 for trunk/wp-admin/moderation.php
- Timestamp:
- 06/14/2007 02:25:30 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/moderation.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/moderation.php
r5663 r5700 20 20 if ( $action == 'update' ) { 21 21 check_admin_referer( 'moderate-comments' ); 22 22 23 23 if ( !current_user_can( 'moderate_comments' ) ) { 24 24 wp_die( __( 'Your level is not high enough to moderate comments.' ) ); 25 25 } 26 26 27 27 $item_ignored = 0; 28 28 $item_deleted = 0; 29 29 $item_approved = 0; 30 30 $item_spam = 0; 31 31 32 32 foreach ( $comment as $k => $v ) { 33 33 if ( $feelinglucky && $v == 'later' ) { 34 34 $v = 'delete'; 35 35 } 36 36 37 37 switch ( $v ) { 38 38 case 'later' : 39 39 $item_ignored++; 40 40 break; 41 41 42 42 case 'delete' : 43 43 wp_set_comment_status( $k, 'delete' ); 44 44 $item_deleted++; 45 45 break; 46 46 47 47 case 'spam' : 48 48 wp_set_comment_status( $k, 'spam' ); 49 49 $item_spam++; 50 50 break; 51 51 52 52 case 'approve' : 53 53 wp_set_comment_status( $k, 'approve' ); 54 54 55 55 if ( get_option( 'comments_notify' ) == true ) { 56 56 wp_notify_postauthor( $k ); 57 57 } 58 58 59 59 $item_approved++; 60 60 break; 61 61 } 62 62 } 63 63 64 64 wp_redirect( basename( __FILE__ ) . '?ignored=' . $item_ignored . '&deleted=' . $item_deleted . '&approved=' . $item_approved . '&spam=' . $item_spam ); 65 65 exit; … … 78 78 $deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0; 79 79 $spam = isset( $_GET['ignored'] ) ? (int) $_GET['spam'] : 0; 80 80 81 81 if ( $approved > 0 || $deleted > 0 || $spam > 0 ) { 82 82 echo '<div id="moderated" class="updated fade"><p>'; 83 83 84 84 if ( $approved > 0 ) { 85 85 printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved ); 86 86 echo '<br />'; 87 87 } 88 88 89 89 if ( $deleted > 0 ) { 90 90 printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted ); 91 91 echo '<br />'; 92 92 } 93 93 94 94 if ( $spam > 0 ) { 95 95 printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); 96 96 echo '<br />'; 97 97 } 98 98 99 99 echo '</p></div>'; 100 100 } … … 138 138 ?> 139 139 <h2><?php _e( 'Moderation Queue' ); ?></h2> 140 140 141 141 <?php 142 142 if ( $page_links ) { … … 144 144 } 145 145 ?> 146 146 147 147 <form name="approval" id="approval" action="<?php echo basename( __FILE__ ); ?>" method="post"> 148 148 <?php wp_nonce_field( 'moderate-comments' ); ?> … … 151 151 <?php 152 152 $i = 0; 153 153 154 154 foreach ( $comments as $comment ) { 155 155 $class = 'js-unapproved'; 156 156 157 157 if ( $i++ % 2 ) { 158 158 $class .= ' alternate'; … … 166 166 | <?php _e( 'IP:' ); ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP(); ?>"><?php comment_author_IP(); ?></a> 167 167 </p> 168 168 169 169 <p> 170 170 <?php comment_text(); ?> … … 190 190 ?> 191 191 </ol> 192 192 193 193 <?php 194 194 if ( $page_links ) { … … 196 196 } 197 197 ?> 198 198 199 199 <div id="ajax-response"></div> 200 200 201 201 <noscript> 202 202 <p class="submit"> … … 204 204 </p> 205 205 </noscript> 206 206 207 207 <p class="submit"> 208 208 <input type="submit" id="submit" name="submit" value="<?php _e( 'Bulk Moderate Comments »' ); ?>" /> 209 209 </p> 210 210 211 211 <script type="text/javascript"> 212 212 // <![CDATA[ … … 218 218 } 219 219 } 220 220 221 221 document.write( '<p><strong><?php _e( 'Mark all:' ); ?></strong> <a href="javascript:mark_all_as(\'approve\')"><?php _e( 'Approved' ); ?></a> – <a href="javascript:mark_all_as(\'spam\')"><?php _e( 'Spam' ); ?></a> – <a href="javascript:mark_all_as(\'delete\')"><?php _e( 'Deleted' ); ?></a> – <a href="javascript:mark_all_as(\'later\')"><?php _e( 'Later' ); ?></a></p>' ); 222 222 // ]]>
Note: See TracChangeset
for help on using the changeset viewer.