Make WordPress Core

Changeset 431


Ignore:
Timestamp:
10/07/2003 09:33:39 PM (21 years ago)
Author:
emc3
Message:

More calendar error-proofing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/b2calendar.php

    r425 r431  
    5858
    5959// Quick check. If we have no posts at all, abort!
    60 $gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' AND post_category > 0 ORDER BY post_date DESC LIMIT 1");
    61 if (!$gotsome)
    62     return;
     60if (!$posts) {
     61    $gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' AND post_category > 0 ORDER BY post_date DESC LIMIT 1");
     62    if (!$gotsome)
     63        // if all else fails, just show this month's calendar
     64        $calendar = date('Ym');
     65}
    6366
    6467$w = $HTTP_GET_VARS['w'];
Note: See TracChangeset for help on using the changeset viewer.