+$_comment_pending_count_temp = (array) get_pending_comments_num($_comment_post_ids);
+foreach ( (array) $_comment_post_ids as $_cpid )
+ $_comment_pending_count[$_cpid] = isset( $_comment_pending_count_temp[$_cpid] ) ? $_comment_pending_count_temp[$_cpid] : 0;
+if ( empty($_comment_pending_count) )
+ $_comment_pending_count = array();
+
+$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' => '',
+ 'prev_text' => __('«'),
+ 'next_text' => __('»'),
+ 'total' => ceil($total / $comments_per_page),
+ 'current' => $page
+));
+
+?>
+
+<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
+<?php if ( $post_id ) : ?>
+<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
+<?php endif; ?>
+<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
+<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
+
+<div class="tablenav">
+
+<?php if ( $page_links ) : ?>
+<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
+ number_format_i18n( $start + 1 ),
+ number_format_i18n( min( $page * $comments_per_page, $total ) ),
+ '<span class="total-type-count">' . number_format_i18n( $total ) . '</span>',
+ $page_links
+); echo $page_links_text; ?></div>
+<input type="hidden" name="_total" value="<?php echo esc_attr($total); ?>" />
+<input type="hidden" name="_per_page" value="<?php echo esc_attr($comments_per_page); ?>" />
+<input type="hidden" name="_page" value="<?php echo esc_attr($page); ?>" />
+<?php endif; ?>
+
+<div class="alignleft actions">
+<select name="action">
+<option value="-1" selected="selected"><?php _e('Bulk Actions') ?></option>
+<?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?>
+<option value="unapprove"><?php _e('Unapprove'); ?></option>
+<?php endif; ?>
+<?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
+<option value="approve"><?php _e('Approve'); ?></option>
+<?php endif; ?>
+<?php if ( 'spam' != $comment_status ): ?>
+<option value="markspam"><?php _e('Mark as Spam'); ?></option>
+<?php endif; ?>
+<option value="delete"><?php _e('Delete'); ?></option>
+</select>
+<input type="submit" name="doaction" id="doaction" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
+<?php wp_nonce_field('bulk-comments'); ?>
+
+<select name="comment_type">
+ <option value="all"><?php _e('Show all comment types'); ?></option>
+<?php
+ $comment_types = apply_filters( 'admin_comment_types_dropdown', array(
+ 'comment' => __('Comments'),
+ 'pings' => __('Pings'),
+ ) );
+
+ foreach ( $comment_types as $type => $label ) {
+ echo " <option value='" . esc_attr($type) . "'";
+ selected( $comment_type, $type );
+ echo ">$label</option>\n";
+ }
+?>
+</select>
+<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
+
+<?php if ( isset($_GET['apage']) ) { ?>
+ <input type="hidden" name="apage" value="<?php echo esc_attr( absint( $_GET['apage'] ) ); ?>" />
+<?php }
+
+if ( 'spam' == $comment_status ) {
+ wp_nonce_field('bulk-spam-delete', '_spam_nonce');
+ if ( current_user_can ('moderate_comments')) { ?>
+ <input type="submit" name="delete_all_spam" value="<?php esc_attr_e('Delete All Spam'); ?>" class="button-secondary apply" />
+<?php }
+} ?>
+<?php do_action('manage_comments_nav', $comment_status); ?>
+</div>
+
+<br class="clear" />