diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-13 17:21:00 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-13 17:21:00 +0000 |
commit | 12de05107e4c8b006bde6ee8916f34eb476d08da (patch) | |
tree | 123ee54ecd1f3f777373b7df54a4604012d43640 /wp-admin/edit-comments.php | |
parent | e51c7a9ca4bfdb45fa3ec7334bd33871e78c68b1 (diff) | |
download | wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.gz wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.xz wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.zip |
WP Merge with revision 8075
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1328 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/edit-comments.php')
-rw-r--r-- | wp-admin/edit-comments.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index c756efe..6bb04aa 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -12,8 +12,7 @@ if ( !empty( $_REQUEST['delete_comments'] ) ) { $comments_deleted = $comments_approved = $comments_unapproved = $comments_spammed = 0; foreach ($_REQUEST['delete_comments'] as $comment) : // Check the permissions on each $comment = (int) $comment; - $post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); - // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); + $post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment) ); if ( !current_user_can('edit_post', $post_id) ) continue; if ( !empty( $_REQUEST['spamit'] ) ) { @@ -117,6 +116,7 @@ unset($status_links); </ul> <p id="post-search"> + <label class="hidden" for="post-search-input"><?php _e( 'Search Comments' ); ?>:</label> <input type="text" id="post-search-input" name="s" value="<?php echo $search; ?>" /> <input type="submit" value="<?php _e( 'Search Comments' ); ?>" class="button" /> </p> @@ -132,22 +132,24 @@ unset($status_links); <?php +$comments_per_page = apply_filters('comments_per_page', 20, $comment_status); + if ( isset( $_GET['apage'] ) ) $page = abs( (int) $_GET['apage'] ); else $page = 1; -$start = $offset = ( $page - 1 ) * 20; +$start = $offset = ( $page - 1 ) * $comments_per_page; -list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, 25 ); // Grab a few extra +list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5 ); // Grab a few extra -$comments = array_slice($_comments, 0, 20); -$extra_comments = array_slice($_comments, 20); +$comments = array_slice($_comments, 0, $comments_per_page); +$extra_comments = array_slice($_comments, $comments_per_page); $page_links = paginate_links( array( 'base' => add_query_arg( 'apage', '%#%' ), 'format' => '', - 'total' => ceil($total / 20), + 'total' => ceil($total / $comments_per_page), 'current' => $page )); @@ -186,7 +188,7 @@ if ($comments) { <table class="widefat"> <thead> <tr> - <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('comments-form'));" /></th> + <th scope="col" class="check-column"><input type="checkbox" /></th> <th scope="col"><?php _e('Comment') ?></th> <th scope="col"><?php _e('Date') ?></th> <th scope="col" class="action-links"><?php _e('Actions') ?></th> |