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)) {