X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..9c40b4d36daed9e28e48a5fe9205c32557195a4b:/wp-admin/edit-comments.php diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index ab1bdbce..da5ce020 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -1,203 +1,382 @@ +$post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0; - + +if ( $post_id ) + $title = sprintf(__('Edit Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50)); +else + $title = __('Edit Comments'); + +require_once('admin-header.php'); + +$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']); + +$comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all'; +if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam')) ) + $comment_status = 'all'; + +$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : ''; + +$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : ''; +$search = esc_attr( $search_dirty ); ?> +
';
- $i = 0;
- foreach ($_POST['delete_comments'] as $comment) : // Check the permissions on each
- $comment = (int) $comment;
- $post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");
- // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") );
- if ( current_user_can('edit_post', $post_id) ) {
- if ( !empty( $_POST['spam_button'] ) )
- wp_set_comment_status($comment, 'spam');
- else
- wp_set_comment_status($comment, 'delete');
- ++$i;
+ if ( $approved > 0 ) {
+ printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
+ echo '
';
}
- endforeach;
- echo '
';
- if ( !empty( $_POST['spam_button'] ) ) {
- printf(__ngettext('%s comment marked as spam', '%s comments marked as spam.', $i), $i);
- } else {
- printf(__ngettext('%s comment deleted.', '%s comments deleted.', $i), $i);
+
+ if ( $deleted > 0 ) {
+ printf( _n( '%s comment deleted', '%s comments deleted', $deleted ), $deleted );
+ echo '
';
+ }
+
+ if ( $spam > 0 ) {
+ printf( _n( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
+ echo '
';
+ }
+
+ echo '