+$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" />
+
+</div>
+
+<div class="clear"></div>
+
+<?php if ( $comments ) { ?>
+<table class="widefat comments fixed" cellspacing="0">
+<thead>
+ <tr>
+<?php print_column_headers('edit-comments'); ?>
+ </tr>
+</thead>
+
+<tfoot>
+ <tr>
+<?php print_column_headers('edit-comments', false); ?>
+ </tr>
+</tfoot>
+
+<tbody id="the-comment-list" class="list:comment">
+<?php
+ foreach ($comments as $comment)
+ _wp_comment_row( $comment->comment_ID, $mode, $comment_status );
+?>
+</tbody>
+<tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
+<?php
+ foreach ($extra_comments as $comment)
+ _wp_comment_row( $comment->comment_ID, $mode, $comment_status );
+?>
+</tbody>
+</table>
+
+<div class="tablenav">
+<?php
+if ( $page_links )
+ echo "<div class='tablenav-pages'>$page_links_text</div>";
+?>
+
+<div class="alignleft actions">
+<select name="action2">
+<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="doaction2" id="doaction2" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
+
+<?php if ( 'spam' == $comment_status ) { ?>
+<input type="submit" name="delete_all_spam2" 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" />