diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index c78c66678e..50139a1bc1 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -190,6 +190,16 @@ $start = $offset = ( $page - 1 ) * $comments_per_page; list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id, $comment_type ); // Grab a few extra +$_comment_post_ids = array(); +foreach ( $_comments as $_c ) { + $_comment_post_ids[] = $_c->comment_post_ID; +} +$_comment_pending_count_temp = (array) get_pending_comments_num($_comment_post_ids); +foreach ( (array) $_comment_post_ids as $_cpid ) + $_comment_pending_count[$_cpid] = isset( $_comment_pending_count_temp[$_cpid] ) ? $_comment_pending_count_temp[$_cpid] : 0; +if ( empty($_comment_pending_count) ) + $_comment_pending_count = array(); + $comments = array_slice($_comments, 0, $comments_per_page); $extra_comments = array_slice($_comments, $comments_per_page); diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 436988bdcb..36d0b253eb 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1944,18 +1944,11 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0 * @param unknown_type $checkbox */ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $from_ajax = false ) { - global $comment, $post; + global $comment, $post, $_comment_pending_count; $comment = get_comment( $comment_id ); $post = get_post($comment->comment_post_ID); $the_comment_status = wp_get_comment_status($comment->comment_ID); - if ( current_user_can( 'edit_post', $post->ID ) ) { - $post_link = ""; - $post_link .= get_the_title($comment->comment_post_ID) . ''; - } else { - $post_link = get_the_title($comment->comment_post_ID); - } - $author_url = get_comment_author_url(); if ( 'http://' == $author_url ) $author_url = ''; @@ -1971,10 +1964,10 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, else $ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date ); - $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); - $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); - $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) ); - $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); + $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$post->ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); + $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); + $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) ); + $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$post->ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); echo ""; $columns = get_column_headers('edit-comments'); @@ -1992,7 +1985,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, case 'cb': if ( !$checkbox ) break; echo ''; - if ( current_user_can('edit_post', $comment->comment_post_ID) ) echo ""; + if ( current_user_can('edit_post', $post->ID) ) echo ""; echo ''; break; case 'comment': @@ -2011,7 +2004,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, comment_post_ID) ) { + if ( current_user_can('edit_post', $post->ID) ) { $actions['approve'] = "" . __( 'Approve' ) . ''; $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; if ( $comment_status ) { // not looking at all comments @@ -2072,12 +2065,30 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, break; case 'response': if ( 'single' !== $mode ) { + if ( isset( $_comment_pending_count[$post->ID] ) ) { + $pending_comments = absint( $_comment_pending_count[$post->ID] ); + } else { + $_comment_pending_count_temp = (array) get_pending_comments_num( array( $post->ID ) ); + $pending_comments = $_comment_pending_count[$post->ID] = $_comment_pending_count_temp[$post->ID]; + } + if ( current_user_can( 'edit_post', $post->ID ) ) { + $post_link = ""; + $post_link .= get_the_title($post->ID) . ''; + } else { + $post_link = get_the_title($post->ID); + } echo "\n"; - echo ""$post_link" "; - echo '' . sprintf ( __ngettext('(%s)', '(%s)', $post->comment_count), number_format_i18n($post->comment_count) ) . ' #
'; - echo get_the_time(__('Y/m/d \a\t g:ia')); + echo "“$post_link”
"; + + echo ''; + $pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) ); + if ( $pending_comments ) + echo ''; + comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); + if ( $pending_comments ) + echo ''; + echo ' '; + echo "#"; echo ''; } } diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index a408896982..5075c1640d 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -1094,6 +1094,15 @@ strong .post-com-count { background-position: center -3px; } +.column-response .post-com-count-wrapper { +} + +.column-response .post-com-count { + float: left; + margin-right: 5px; + text-align: center; +} + /* end menu stuff */ /* Admin Footer */ diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index b49cf9a012..c23b9ca379 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -302,7 +302,7 @@ function wp_default_styles( &$styles ) { $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'farbtastic' ); - $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20081206' ); + $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20081207' ); $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20081206' );