More calendar error-proofing.

git-svn-id: https://develop.svn.wordpress.org/trunk@431 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dougal Campbell 2003-10-07 21:33:39 +00:00
parent 9d4b414b81
commit 444ca5379c
1 changed files with 6 additions and 3 deletions

View File

@ -57,9 +57,12 @@ require_once($abspath.$b2inc.'/b2functions.php');
require_once($abspath.$b2inc.'/b2vars.php');
// Quick check. If we have no posts at all, abort!
$gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' AND post_category > 0 ORDER BY post_date DESC LIMIT 1");
if (!$gotsome)
return;
if (!$posts) {
$gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' AND post_category > 0 ORDER BY post_date DESC LIMIT 1");
if (!$gotsome)
// if all else fails, just show this month's calendar
$calendar = date('Ym');
}
$w = $HTTP_GET_VARS['w'];
if (isset($HTTP_GET_VARS['w'])) {