Changeset 9023
- Timestamp:
- 09/28/08 17:48:55 (2 months ago)
- Files:
-
- trunk/wp-admin/edit-comments.php (modified) (2 diffs)
- trunk/wp-admin/includes/template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/edit-comments.php
r9018 r9023 66 66 $comment_status = isset($_GET['comment_status']) ? attribute_escape($_GET['comment_status']) : ''; 67 67 68 $post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0; 69 68 70 $search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : ''; 69 71 $search = attribute_escape( $search_dirty ); ?> … … 152 154 $start = $offset = ( $page - 1 ) * $comments_per_page; 153 155 154 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5 ); // Grab a few extra156 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id ); // Grab a few extra 155 157 156 158 $comments = array_slice($_comments, 0, $comments_per_page); trunk/wp-admin/includes/template.php
r9022 r9023 1530 1530 } 1531 1531 1532 function _wp_get_comment_list( $status = '', $s = false, $start, $num ) {1532 function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0 ) { 1533 1533 global $wpdb; 1534 1534 1535 1535 $start = abs( (int) $start ); 1536 1536 $num = (int) $num; 1537 $post = (int) $post; 1537 1538 1538 1539 if ( 'moderated' == $status ) … … 1544 1545 else 1545 1546 $approved = "( comment_approved = '0' OR comment_approved = '1' )"; 1547 1548 if ( $post ) 1549 $post = " AND comment_post_ID = '$post'"; 1550 else 1551 $post = ''; 1546 1552 1547 1553 if ( $s ) { … … 1556 1562 ORDER BY comment_date_gmt DESC LIMIT $start, $num"); 1557 1563 } else { 1558 $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num" );1564 $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved $post ORDER BY comment_date_gmt DESC LIMIT $start, $num" ); 1559 1565 } 1560 1566
