Changeset 3032

Show
Ignore:
Timestamp:
11/10/05 23:36:50 (3 years ago)
Author:
ryan
Message:

Don't loop over empty list. Props Mark Jaquith. fixes #1827

Files:

Legend:

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

    r2832 r3032  
    8282</form> 
    8383 
     84<?php $arc_result = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts ORDER BY post_date DESC"); 
     85if ( count($arc_result) ) { ?> 
     86 
    8487<form name="viewarc" action="" method="get" style="float: left; width: 20em; margin-bottom: 1em;"> 
    8588    <fieldset> 
     
    8790    <select name='m'> 
    8891    <?php 
    89         $arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts ORDER BY post_date DESC"); 
    9092        foreach ($arc_result as $arc_row) {          
    9193            $arc_year  = $arc_row->yyear; 
     
    106108    </fieldset> 
    107109</form> 
     110 
     111<?php } ?> 
    108112 
    109113<br style="clear:both;" />