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

git-svn-id: https://develop.svn.wordpress.org/trunk@3032 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-11-10 23:36:50 +00:00
parent 58b39edd36
commit 6204cb5e82
1 changed files with 5 additions and 1 deletions

View File

@ -81,12 +81,14 @@ if ( is_month() ) {
</fieldset>
</form>
<?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");
if ( count($arc_result) ) { ?>
<form name="viewarc" action="" method="get" style="float: left; width: 20em; margin-bottom: 1em;">
<fieldset>
<legend><?php _e('Browse Month&hellip;') ?></legend>
<select name='m'>
<?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");
foreach ($arc_result as $arc_row) {
$arc_year = $arc_row->yyear;
$arc_month = $arc_row->mmonth;
@ -106,6 +108,8 @@ if ( is_month() ) {
</fieldset>
</form>
<?php } ?>
<br style="clear:both;" />
<?php