From 2719e8796a5b133a84e2c5d27ca2a9ffa62d9e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3na=20Lore?= Date: Sun, 10 Dec 2017 11:52:26 +0100 Subject: [PATCH] Fix for PHP Notice Undefined offset: 0, Line 60 of /e107_plugins/user/e_dashboard.php --- e107_plugins/user/e_dashboard.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/e107_plugins/user/e_dashboard.php b/e107_plugins/user/e_dashboard.php index b90900123..d7d7113f8 100644 --- a/e107_plugins/user/e_dashboard.php +++ b/e107_plugins/user/e_dashboard.php @@ -57,14 +57,15 @@ class user_dashboard // plugin-folder + '_url' $months = e107::getDate()->terms('month'); - $data['labels'] = array($months[0], //"January", - $months[1], //"February", - $months[2], //"March", - $months[3], //"April", - $months[4], //"May", - $months[5], //"June", - $months[6] //"July" - ); + foreach($months as $month) + { + // We need only the first 6 months for demo. + if (!empty($data['labels']) && count($data['labels']) >= 6) + { + continue; + } + $data['labels'][] = $month; + } $data['datasets'][] = array( 'fillColor' => "rgba(220,220,220,0.5)",