X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/cc7b1505cd9fafd87c3672f669e13e98b0c544f7..refs/tags/wordpress-2.9:/wp-admin/edit-comments.php diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 88e672a7..ee23b3e3 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -1,175 +1,461 @@ +wp_enqueue_script('admin-comments'); +enqueue_comment_hotkeys_js(); + +$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', 'trash')) ) + $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 ); ?> +
';
+
+ if ( $approved > 0 ) {
+ printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
+ echo '
';
+ }
+ if ( $spammed > 0 ) {
+ printf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed );
+ $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
+ echo ' ' . __('Undo') . '
';
+ }
+ if ( $unspammed > 0 ) {
+ printf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
+ echo '
';
+ }
+ if ( $trashed > 0 ) {
+ printf( _n( '%s comment moved to the trash.', '%s comments moved to the trash.', $trashed ), $trashed );
+ $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
+ echo ' ' . __('Undo') . '
';
+ }
+ if ( $untrashed > 0 ) {
+ printf( _n( '%s comment restored from the trash', '%s comments restored from the trash', $untrashed ), $untrashed );
+ echo '
';
+ }
+ if ( $deleted > 0 ) {
+ printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
+ echo '
';
+ }
- $i = 0;
- foreach ($_POST['delete_comments'] as $comment) : // Check the permissions on each
- $comment = (int) $comment;
- $post_id = $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) ) :
- wp_set_comment_status($comment, "delete");
- ++$i;
- endif;
- endforeach;
- echo "
" . sprintf(__('%s comments deleted.'), $i) . "
comment_author_email) { ?>| comment_author_url && 'http://' != $comment->comment_author_url ) { ?> | |
- - - -comment_post_ID) ) { - echo " | comment_ID."\">" . __('Edit Comment') . ""; - echo ' | " . __('Delete Comment') . ' '; - } // end if any comments to show - // Get post title - if ( current_user_can('edit_post', $comment->comment_post_ID) ) { - $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"); - $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; - ?> | - - |
-