From ecef1f6ffa8ecd35ffc818aef50c6e8d75a65fb1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 6 Apr 2017 11:02:54 -0700 Subject: [PATCH] Date Class terms() method corrected. 'months' now uses the correct key. terms() method usage updated throughout. Chart Class debug() method added --- e107_handlers/chart_class.php | 10 ++++++++++ e107_handlers/date_handler.php | 2 +- e107_plugins/blogcalendar_menu/archive.php | 4 ++-- e107_plugins/blogcalendar_menu/blogcalendar_menu.php | 2 +- e107_plugins/blogcalendar_menu/calendar.php | 2 +- e107_plugins/news/news_months_menu.php | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/e107_handlers/chart_class.php b/e107_handlers/chart_class.php index b113b3079..f7c43b528 100644 --- a/e107_handlers/chart_class.php +++ b/e107_handlers/chart_class.php @@ -208,6 +208,16 @@ class e_chart return json_encode($this->options); } + public function debug($flag=false) + { + if($flag === true) + { + e107::getDebug()->log($this->data); + } + + return $this; + } + /** * Set the type of graph * @param string $type - line | bar | pie | radar | doughnut | polar diff --git a/e107_handlers/date_handler.php b/e107_handlers/date_handler.php index 0f788d1f7..a3aeb93b9 100644 --- a/e107_handlers/date_handler.php +++ b/e107_handlers/date_handler.php @@ -92,7 +92,7 @@ class convert $marray = array(); for ($i=1; $i < 13; $i++) { - $marray[] = strftime($val,mktime(1,1,1,$i,1,2000)); + $marray[$i] = strftime($val,mktime(1,1,1,$i,1,2000)); } return $marray; diff --git a/e107_plugins/blogcalendar_menu/archive.php b/e107_plugins/blogcalendar_menu/archive.php index 9c96b7aeb..d8464ac78 100644 --- a/e107_plugins/blogcalendar_menu/archive.php +++ b/e107_plugins/blogcalendar_menu/archive.php @@ -129,11 +129,11 @@ for($i = 1; $i <= 12; $i++) // href the current month regardless of newsposts or any month with news if (($req_year == $cur_year && $i == $cur_month) || $day_links[$i]) { - $archive .= "".$marray[$i-1].""; + $archive .= "".$marray[$i].""; } else { - $archive .= $marray[$i-1]; + $archive .= $marray[$i]; } $archive .= ""; diff --git a/e107_plugins/blogcalendar_menu/blogcalendar_menu.php b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php index 23ab83532..63ce0a1b7 100644 --- a/e107_plugins/blogcalendar_menu/blogcalendar_menu.php +++ b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php @@ -199,7 +199,7 @@ if(false === $cached) { $month_selector .= ""; } $month_selector .= ""; diff --git a/e107_plugins/blogcalendar_menu/calendar.php b/e107_plugins/blogcalendar_menu/calendar.php index a1d81ae9c..fc3f2f526 100644 --- a/e107_plugins/blogcalendar_menu/calendar.php +++ b/e107_plugins/blogcalendar_menu/calendar.php @@ -142,7 +142,7 @@ function calendar($req_day, $req_month, $req_year, $links = NULL, $ws = "sunday" { $active = date("n-Y") == ($req_month."-".$req_year) ? 'active' : ''; $text = "
"; - $text .= "
".$marray[$req_month - 1]." ".$req_year."
"; + $text .= "
".$marray[$req_month]." ".$req_year."
"; $text .= $calendar; $text .= "
"; } diff --git a/e107_plugins/news/news_months_menu.php b/e107_plugins/news/news_months_menu.php index c75043f0c..92a845db0 100644 --- a/e107_plugins/news/news_months_menu.php +++ b/e107_plugins/news/news_months_menu.php @@ -116,7 +116,7 @@ if(false === $cached) $vars->addData(array( 'active' => $index == $req_month ? " active" : '', 'url' => $val, - 'month' => $marray[$index-1], + 'month' => $marray[$index], 'count' => $xmonth_cnt[$index], )); $menu_text[] = $tp->simpleParse($template['item'], $vars);