From 51ce46e8928f771c0266dc5384381c373c088c08 Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 29 Jul 2007 19:56:55 +0000 Subject: [PATCH] Shows pending moderation comments in title and bold comment numbers with comments that need attention. git-svn-id: http://svn.automattic.com/wordpress/trunk@5821 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-post-rows.php | 226 ++++++++++++++++++---------------- wp-admin/includes/comment.php | 7 ++ 2 files changed, 124 insertions(+), 109 deletions(-) diff --git a/wp-admin/edit-post-rows.php b/wp-admin/edit-post-rows.php index f5d5dae257..fa610c1b29 100644 --- a/wp-admin/edit-post-rows.php +++ b/wp-admin/edit-post-rows.php @@ -1,109 +1,117 @@ - - - - - - - - - - - -ID == $post->post_author ? 'self' : 'other' ); -?> - post_status ); ?>'> - -$column_display_name) { - - switch($column_name) { - - case 'id': - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
post_modified ) _e('Never'); else the_modified_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?>post_modified ) _e('Unpublished'); else the_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?> - post_status) _e(' - Private'); ?> - " . __('0') . '', "" . __('1') . '', "" . __('%') . '') ?> - ID) ) { echo "" . __('Edit') . ""; } ?>ID) ) { echo "ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . js_escape(sprintf(__("You are about to delete this post '%s'.\n'OK' to delete, 'Cancel' to stop."), get_the_title())) . "' );\">" . __('Delete') . ""; } ?>
+ + + + + + + + + + + +ID == $post->post_author ? 'self' : 'other' ); +?> + post_status ); ?>'> + +$column_display_name) { + + switch($column_name) { + + case 'id': + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
post_modified ) _e('Never'); else the_modified_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?>post_modified ) _e('Unpublished'); else the_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?> + post_status) _e(' - Private'); ?> + ID ); + $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); + if ( $left ) + echo ''; + comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); + if ( $left ) + echo ''; + ?> + ID) ) { echo "" . __('Edit') . ""; } ?>ID) ) { echo "ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . js_escape(sprintf(__("You are about to delete this post '%s'.\n'OK' to delete, 'Cancel' to stop."), get_the_title())) . "' );\">" . __('Delete') . ""; } ?>
diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php index 7171d31b5a..ae0d1d9631 100644 --- a/wp-admin/includes/comment.php +++ b/wp-admin/includes/comment.php @@ -58,4 +58,11 @@ function get_comment_to_edit( $id ) { return $comment; } +function get_pending_comments_num( $post_id ) { + global $wpdb; + $post_id = (int) $post_id; + $pending = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = $post_id AND comment_approved = '0'" ); + return $pending; +} + ?> \ No newline at end of file