Make WordPress Core

Changeset 1745


Ignore:
Timestamp:
10/05/2004 07:25:21 AM (22 years ago)
Author:
saxmatt
Message:

Page comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r1744 r1745  
    6262                ORDER BY comment_date DESC");
    6363} else {
    64         $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments ORDER BY comment_date DESC LIMIT 20");
     64        if ( isset($_GET['offset']) )
     65                $offset = (int) $_GET['offset'] * 20;
     66        else
     67                $offset = 0;
     68
     69        $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments ORDER BY comment_date DESC LIMIT $offset,20");
    6570}
    6671if ('view' == $mode) {
    6772        if ($comments) {
    68                 echo '<ol class="commentlist">';
     73                if ($offset)
     74                        $start = " start='$offset'";
     75                else
     76                        $start = '';
     77
     78                echo "<ol class='commentlist' $start>";
    6979                $i = 0;
    7080                foreach ($comments as $comment) {
     
    93103                </li>
    94104
    95                 <?php
    96                 } // end foreach
    97         echo '</ol>';
     105<?php } // end foreach ?>
     106</ol>
     107<form action="" method="get">
     108<p class="submit">
     109<input type="hidden" name="offset" value="<?php echo $_GET['offset']+ 1; ?>" />
     110<input type="submit" name="submit" value="<?php _e('View Next 20 Comments &raquo;');?>" />
     111</p>
     112</form>
     113
     114<?php
    98115        } else {
    99116
Note: See TracChangeset for help on using the changeset viewer.