Changeset 10090
- Timestamp:
- 12/06/2008 09:23:36 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/dashboard.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/dashboard.php
r10080 r10090 405 405 406 406 // Select all comment types and filter out spam later for better query performance. 407 $comments = $wpdb->get_results( "SELECT * FROM $wpdb->comments ORDER BY comment_date_gmt DESC LIMIT 0, 50" ); 407 $comments = array(); 408 $start = 0; 409 410 while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments ORDER BY comment_date_gmt DESC LIMIT $start, 50" ) ) { 411 412 foreach ( $possible as $comment ) { 413 if ( count( $comments ) >= 5 ) 414 break; 415 if ( in_array( $comment->comment_approved, $allowed_states ) ) 416 $comments[] = $comment; 417 } 418 419 $start = $start + 50; 420 } 408 421 409 422 if ( $comments ) : … … 412 425 <div id="the-comment-list" class="list:comment"> 413 426 <?php 414 $count = 0; 415 foreach ( $comments as $comment ) { 416 if ( $count >= 5 ) 417 break; 418 if ( in_array($comment->comment_approved, $allowed_states) ) 419 _wp_dashboard_recent_comments_row( $comment ); 420 $count++; 421 } 427 foreach ( $comments as $comment ) 428 _wp_dashboard_recent_comments_row( $comment ); 422 429 ?> 423 430
Note: See TracChangeset
for help on using the changeset viewer.