mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Fix: Display blog-calendar of current month, regardless of if posts exist
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user