Make WordPress Core


Ignore:
Timestamp:
05/09/2004 05:47:02 AM (21 years ago)
Author:
saxmatt
Message:

Various fixes and cleanups, inspired and pointed out by Joseph Scott.

File:
1 edited

Legend:

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

    r1239 r1245  
    4646    <fieldset>
    4747    <legend><?php _e('Show Posts From Month of...') ?></legend>
    48    
     48    <select name='m'>
    4949    <?php
    50         echo "<select name=\"m\" style=\"width:120px;\">";
    51         $arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date) FROM $tableposts ORDER BY post_date DESC",ARRAY_A);
     50        $arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $tableposts ORDER BY post_date DESC");
    5251        foreach ($arc_result as $arc_row) {         
    53             $arc_year  = $arc_row["YEAR(post_date)"];
    54             $arc_month = $arc_row["MONTH(post_date)"];
     52            $arc_year  = $arc_row->yyear;
     53            $arc_month = $arc_row->mmonth;
    5554           
    56             if( $arc_year.zeroise($arc_month,2) == $_GET['m'] )
    57                 $default = "selected";
     55            if( isset($_GET['m']) && $arc_year . zeroise($arc_month, 2) == $_GET['m'] )
     56                $default = 'selected="selected"';
    5857            else
    5958                $default = null;
    6059           
    61             echo "<option ".$default." value=\"".$arc_year.zeroise($arc_month,2)."\">";
    62             echo $month[zeroise($arc_month,2)]." $arc_year";
     60            echo "<option $default value=\"" . $arc_year.zeroise($arc_month, 2) . '">';
     61            echo $month[zeroise($arc_month, 2)] . " $arc_year";
    6362            echo "</option>\n";
    6463        }
    65         echo "</select>";
    6664    ?>
     65    </select>
    6766        <input type="submit" name="submit" value="<?php _e('Show Month') ?>"  />
    6867    </fieldset>
     
    9392
    9493if ($posts) {
     94$bgcolor = '';
    9595foreach ($posts as $post) { start_wp();
    9696$bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
     
    9999    <th scope="row"><?php echo $id ?></th>
    100100    <td><?php the_time('Y-m-d \<\b\r \/\> g:i:s a'); ?></td>
    101     <td><a href="<?php permalink_link(); ?>" rel="permalink">
     101    <td><a href="<?php the_permalink(); ?>" rel="permalink">
    102102      <?php the_title() ?>
    103103      </a>
     
    123123</table>
    124124<?php
    125 if (($withcomments) or ($single)) {
     125if ( 1 == count($posts) ) {
    126126
    127127    $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
     
    172172    }//end if comments
    173173    ?>
    174     <p><a href="edit.php"><?php _e('Back to posts') ?></a></p>
    175174<?php } ?>
    176175</div>
Note: See TracChangeset for help on using the changeset viewer.