From 9b270dd1e5850a9f288106c3e478736ebfd9cfad Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Mon, 19 Sep 2011 15:27:43 +0000 Subject: [PATCH] fix graphs without from or to, also my days only have 24 hours git-svn-id: http://www.observium.org/svn/observer/trunk@2515 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/graphs.inc.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/html/pages/graphs.inc.php b/html/pages/graphs.inc.php index c7a0bc0076..aa7d1cc750 100644 --- a/html/pages/graphs.inc.php +++ b/html/pages/graphs.inc.php @@ -13,8 +13,8 @@ if($_SESSION['widescreen']) $thumb_width=113; } -if (is_numeric($vars['from'])) { $from = $vars['from']; } else { $from = $config['time']['day']; } -if (is_numeric($vars['to'])) { $to = $vars['to']; } else { $to = $config['time']['now']; } +if (!is_numeric($vars['from'])) { $vars['from'] = $config['time']['day']; } +if (!is_numeric($vars['to'])) { $vars['to'] = $config['time']['now']; } preg_match('/^(?P[A-Za-z0-9]+)_(?P.+)/', mres($vars['type']), $graphtype); @@ -52,13 +52,12 @@ if (!$auth) echo("
"); - $thumb_array = array('sixhour' => '6 Hours', 'day' => '25 Hours', 'twoday' => '48 Hours', 'week' => 'One Week', 'twoweek' => 'Two Weeks', + $thumb_array = array('sixhour' => '6 Hours', 'day' => '24 Hours', 'twoday' => '48 Hours', 'week' => 'One Week', 'twoweek' => 'Two Weeks', 'month' => 'One Month', 'twomonth' => 'Two Months','year' => 'One Year', 'twoyear' => 'Two Years'); foreach ($thumb_array as $period => $text) { - $graph_array['from'] = $config['time'][$period]; $link_array = $vars; @@ -80,7 +79,7 @@ if (!$auth) $graph_array['height'] = "300"; $graph_array['width'] = $graph_width; - + echo generate_graph_js_state($graph_array); echo("
");