diff --git a/e107_plugins/blogcalendar_menu/blogcalendar_menu.php b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php index a277bdb03..6807177f8 100644 --- a/e107_plugins/blogcalendar_menu/blogcalendar_menu.php +++ b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php @@ -23,6 +23,7 @@ if (!defined('e107_INIT')) { exit; } $cString = 'nq_news_blogacalendar_menu_'.preg_replace('#[^\w]#', '', $parm); $cached = e107::getCache()->retrieve($cString); + if(false === $cached) { @@ -106,12 +107,12 @@ if(false === $cached) $year_start = mktime(0, 0, 0, 1, 1, $req_year); $year_end = mktime(23, 59, 59, 12, 31, $req_year); - $sql->db_Select("news", "news_id, news_datestamp", "news_class IN (".USERCLASS_LIST.") AND news_datestamp > ".intval($start)." AND news_datestamp < ".intval($end)); + $sql->select("news", "news_id, news_datestamp", "news_class IN (".USERCLASS_LIST.") AND news_datestamp > ".intval($start)." AND news_datestamp < ".intval($end)); $links = array(); $months = array(); - while ($news = $sql->db_Fetch()) + while ($news = $sql->fetch()) { $xmonth = date("n", $news['news_datestamp']); $xyear = date("Y", $news['news_datestamp']); @@ -141,10 +142,13 @@ if(false === $cached) // go over the link array and create the option fields + if(!isset($months[$cur_year][$cur_month])) // display current month even if no links available. + { + $months[$cur_year][$cur_month] = 1; + } - // ------------------------ // create and show calendar