Permalink
Browse files

Include only approved comments when determining page of comment. Prop…

…s GregMulhauser. fixes #8973 for 2.7

git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
ryan
ryan committed Jan 28, 2009
1 parent 73d12e0 commit 6816c5011d83882fc93ac5f0ee31b0a2f72947f5
Showing with 1 addition and 1 deletion.
  1. +1 −1 wp-includes/comment.php
View
@@ -592,7 +592,7 @@ function get_page_of_comment( $comment_ID, $args = array() ) {
$comtypewhere = ( 'all' != $args['type'] && isset($allowedtypes[$args['type']]) ) ? " AND comment_type = '" . $allowedtypes[$args['type']] . "'" : '';
// Count comments older than this one
- $oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_date_gmt < '%s'" . $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt ) );
+ $oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_approved = '1' AND comment_date_gmt < '%s'" . $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt ) );
// No older comments? Then it's page #1.
if ( 0 == $oldercoms )

0 comments on commit 6816c50

Please sign in to comment.