From 9ac29ebf4127c128611252ae2b1d5de1a0f14e08 Mon Sep 17 00:00:00 2001 From: saxmatt 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: http://svn.automattic.com/wordpress/trunk@512 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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)) {