From b6ce582bcec4475990bc5c0fb3ade39de67d43a4 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Mon, 3 Nov 2003 17:49:15 +0000 Subject: [PATCH] Don't highlight day if we're in a different month. :) git-svn-id: https://develop.svn.wordpress.org/trunk@512 602fd350-edb4-49c9-b593-d223f7449a82 --- b2-include/b2template.functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/b2-include/b2template.functions.php b/b2-include/b2template.functions.php index 7faaf16bcc..71446b8692 100644 --- a/b2-include/b2template.functions.php +++ b/b2-include/b2template.functions.php @@ -247,7 +247,7 @@ if (!empty($monthnum) && !empty($year)) { } elseif (!empty($w)) { // We need to get the month from MySQL $thisyear = ''.intval(substr($m, 0, 4)); - $d = (($w - 1) * 7) + 6; //it seems mysqls weeks disagree with php's + $d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')"); } elseif (!empty($m)) { $calendar = substr($m, 0, 6); @@ -342,7 +342,7 @@ for ($day = 1; $day <= $daysinmonth; ++$day) { if ($newrow) echo "\n \n \n\t"; $newrow = false; - if ($day == date('j', (time() + ($time_difference * 3600)))) echo ''; + if ($day == date('j', (time() + ($time_difference * 3600))) && $thismonth == date('m', time()+($time_difference * 3600))) echo ''; else echo ""; if (in_array($day, $daywithpost)) {