diff --git a/e107_plugins/blogcalendar_menu/archive.php b/e107_plugins/blogcalendar_menu/archive.php index 3c0e626b3..cd5ae5b39 100644 --- a/e107_plugins/blogcalendar_menu/archive.php +++ b/e107_plugins/blogcalendar_menu/archive.php @@ -107,7 +107,9 @@ $year_selector .= "\n"; // create the archive display // -------------------------- $newline = 0; -$archive = "
"; +$archive = "
+
+ "; $archive .= ""; for($i = 1; $i <= 12; $i++) { diff --git a/e107_plugins/blogcalendar_menu/blogcalendar_menu.php b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php index 5ff4b9cf7..041f2ad3b 100644 --- a/e107_plugins/blogcalendar_menu/blogcalendar_menu.php +++ b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php @@ -101,7 +101,7 @@ if(false === $cached) $month_start = mktime(0, 0, 0, $req_month, 1, $req_year); $lastday = date("t", $month_start); $month_end = mktime(23, 59, 59, $req_month, $lastday, $req_year); - $start = mktime(0, 0, 0, 1, 1, $req_year); + $start = mktime(0, 0, 0, 1, 1, 1980); $end = time(); $year_start = mktime(0, 0, 0, 1, 1, $req_year); @@ -115,22 +115,23 @@ if(false === $cached) while ($news = $sql->db_Fetch()) { $xmonth = date("n", $news['news_datestamp']); + $xyear = date("Y", $news['news_datestamp']); if (!isset($month_links[$xmonth]) || !$month_links[$xmonth]) { $month_links[$xmonth] = e107::getUrl()->create('news/list/month', 'idv='.formatDate($req_year, $xmonth));//e_BASE."news.php?month.".formatDate($req_year, $xmonth); } - if(($news['news_datestamp'] >= $month_start && $news['news_datestamp'] <= $month_end) || (deftrue('e_BOOTSTRAP') && $news['news_datestamp'] >= $year_start && $news['news_datestamp'] <= $year_end)) + // if(($news['news_datestamp'] >= $month_start && $news['news_datestamp'] <= $month_end) || (deftrue('e_BOOTSTRAP') && $news['news_datestamp'] >= $year_start && $news['news_datestamp'] <= $year_end)) { $xday = date("j", $news['news_datestamp']); if (!isset($day_links[$xday]) || !$day_links[$xday]) { - $links[$xmonth][$xday] = e107::getUrl()->create('news/list/day', 'id='.formatDate($req_year, $xmonth, $xday));//e_BASE."news.php?day.".formatDate($req_year, $req_month, $xday); + $links[$xyear][$xmonth][$xday] = e107::getUrl()->create('news/list/day', 'id='.formatDate($req_year, $xmonth, $xday));//e_BASE."news.php?day.".formatDate($req_year, $req_month, $xday); $day_links[$xday] = e107::getUrl()->create('news/list/day', 'id='.formatDate($req_year, $xmonth, $xday));//e_BASE."news.php?day.".formatDate($req_year, $req_month, $xday); } } - $months[$xmonth] = 1; + $months[$xyear][$xmonth] = 1; } // if we're listing the current year, add the current month to the list regardless of posts @@ -158,7 +159,7 @@ if(false === $cached) { $month_selector = '
'; - $caption = "
".BLOGCAL_L1." ".$req_year.$month_selector."
"; + $caption = "
".BLOGCAL_L1." ".$month_selector."
"; } else { @@ -186,9 +187,13 @@ if(false === $cached) $menu .= ""; $menu .= " diff --git a/e107_plugins/blogcalendar_menu/calendar.php b/e107_plugins/blogcalendar_menu/calendar.php index 10cd8002a..3cf318595 100644 --- a/e107_plugins/blogcalendar_menu/calendar.php +++ b/e107_plugins/blogcalendar_menu/calendar.php @@ -102,17 +102,25 @@ function calendar($req_day, $req_month, $req_year, $links = NULL, $ws = "sunday" } else { - $day_style = isset($links[$day_of_month]) ? "indent blogcalendar-day-active" : "forumheader3 blogcalendar-day"; + $day_style = isset($links[$day_of_month]) ? "indent blogcalendar-day-active " : "forumheader3 blogcalendar-day"; } - $calendar .= ""; + + $calendar .= ""; $day_of_month++; $day_of_week++; } + + if ($day_of_week-$ws != 7) { @@ -121,9 +129,9 @@ function calendar($req_day, $req_month, $req_year, $links = NULL, $ws = "sunday" $calendar .= ""; - if ($tablerow != 5) + if ($tablerow != 6) { - $calendar .= ""; + $calendar .= ""; } $calendar .= "
{$year_selector}
"; + $label_style = isset($links[$day_of_month]) ? 'label label-info' : ''; //TODO A pref in admin to choose between info, danger, etc. + + $calendar .= ""; + $calendar .= isset($links[$day_of_month]) ? "":""; + $calendar .= ""; $calendar .= $day_of_month; + $calendar .= ""; $calendar .= isset($links[$day_of_month]) ? "" : ""; - $calendar .= "
 
 
"; diff --git a/e107_plugins/blogcalendar_menu/languages/English.php b/e107_plugins/blogcalendar_menu/languages/English.php index b091abb60..7ee63695b 100644 --- a/e107_plugins/blogcalendar_menu/languages/English.php +++ b/e107_plugins/blogcalendar_menu/languages/English.php @@ -8,7 +8,7 @@ * */ -define("BLOGCAL_L1", "News for "); +define("BLOGCAL_L1", "News by month"); define("BLOGCAL_L2", "Archive"); define("BLOGCAL_D1", "Mo");