From 820774cd9f9d5aa35e413e8d76d9811bbd9ed743 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 14 Apr 2008 17:43:24 +0200 Subject: [PATCH] [svn r14882] Minor - Minicalendar busgs fixed: Arrows and warnings. --- main/inc/lib/blog.lib.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/main/inc/lib/blog.lib.php b/main/inc/lib/blog.lib.php index 299e338a3b..a6aa8b11ea 100644 --- a/main/inc/lib/blog.lib.php +++ b/main/inc/lib/blog.lib.php @@ -2518,7 +2518,7 @@ class Blog $numberofdays[2] = 29; //Get the first day of the month - $dayone = getdate(mktime(0, 0, 0, $month, 1, $year)); + $dayone = getdate(mktime(0, 0, 0, $month, 1, $year)); $monthName = $MonthsLong[$month-1]; //Start the week on monday @@ -2537,7 +2537,7 @@ class Blog $result = api_sql_query($sql, __FILE__, __LINE__); // We will create an array of days on which there are posts. - if(mysql_num_rows($result) > 0) + if( Database::num_rows($result) > 0) { while($blog_post = mysql_fetch_array($result)) { @@ -2580,11 +2580,11 @@ class Blog } } - echo "\n", + echo '
', "\n", - "\n", - "\n", - "\n", "\n"; + "\n", + "\n", + "\n", "\n"; echo "\n"; @@ -2623,11 +2623,19 @@ class Blog echo '' . $curday . ''; else echo $dayheader; - - // Add tasks to calendar - foreach ($tasks[$curday] as $task) - echo 'Task'; - + + if (count($tasks) > 0) + { + if (is_array($tasks[$curday])) + { + // Add tasks to calendar + foreach ($tasks[$curday] as $task) + { + echo 'Task'; + } + } + } + echo "\n"; $curday ++;
", $monthName, " ", $year, "
«", $monthName, " ", $year, "»