diff --git a/src/chartgenerator.php b/src/chartgenerator.php index 4f764d2..e3821ce 100644 --- a/src/chartgenerator.php +++ b/src/chartgenerator.php @@ -32,16 +32,17 @@ */ // *** Default includes and procedures *** // -define('IN_PHPLOGCON', true); +if ( !defined('IN_PHPLOGCON') ) + define('IN_PHPLOGCON', true); $gl_root_path = './'; // Now include necessary include files! -include($gl_root_path . 'include/functions_common.php'); -include($gl_root_path . 'include/functions_frontendhelpers.php'); -include($gl_root_path . 'include/functions_filters.php'); +include_once($gl_root_path . 'include/functions_common.php'); +include_once($gl_root_path . 'include/functions_frontendhelpers.php'); +include_once($gl_root_path . 'include/functions_filters.php'); // Include LogStream facility -include($gl_root_path . 'classes/logstream.class.php'); +include_once($gl_root_path . 'classes/logstream.class.php'); InitPhpLogCon(); InitSourceConfigs(); @@ -465,8 +466,8 @@ if ( $content['error_occured'] ) // --- // --- Output the image -//$graph->Stroke(); -$graph->StrokeCSIM(); +//$graph->Stroke(); +$graph->StrokeCSIM( basename(__FILE__), '', 0); // --- ?> \ No newline at end of file diff --git a/src/include/functions_common.php b/src/include/functions_common.php index f48c585..1a789d1 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -108,7 +108,7 @@ function InitUserSystemPhpLogCon() if ( GetConfigSetting("UserDBEnabled", false) ) { // Include User Functions - include($gl_root_path . 'include/functions_users.php'); + include_once($gl_root_path . 'include/functions_users.php'); } } @@ -141,6 +141,10 @@ function InitPhpLogCon() // Needed to make global global $gl_root_path, $content; + // Abort if already defined + if ( defined('PHPLOGCON_INITIALIZED') ) + return; + // Init Basics which do not need a database InitBasicPhpLogCon(); @@ -181,6 +185,9 @@ function InitPhpLogCon() // --- Enable PHP Debug Mode InitPhpDebugMode(); // --- + + // Finally defined PHPLOGCON_INITIALIZED! + define( 'PHPLOGCON_INITIALIZED', TRUE ); } function CreateLogLineTypesList( $selectedType ) diff --git a/src/index.php b/src/index.php index 3f6975c..73c9d1b 100644 --- a/src/index.php +++ b/src/index.php @@ -534,7 +534,7 @@ if ( isset($content['Sources'][$currentSourceID]) ) if ( strlen($content['searchstr']) > 0 ) { $content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array( - 'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+eventid%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'], + 'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+eventcategory%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'], 'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $logArray[$mycolkey]), 'IconSource' => $content['MENU_BULLET_GREEN'] ); diff --git a/src/statistics.php b/src/statistics.php index 9794d13..9fe7dd7 100644 --- a/src/statistics.php +++ b/src/statistics.php @@ -61,11 +61,14 @@ if ( isset($content['Charts']) ) // PreProcess Charts Array for display! $i = 0; // Help counter! - foreach ($content['Charts'] as &$myChart ) + foreach ($content['Charts'] as $myChartID => &$myChart ) { // Only process if chart is enabled if ( isset($myChart['chart_enabled']) && $myChart['chart_enabled'] == 1 ) { + // Set Chart ID + $myChart['CHART_ID'] = $myChartID; + // --- Set display name for chart type switch($myChart['chart_type']) { diff --git a/src/templates/statistics.html b/src/templates/statistics.html index dfaebf5..ca1230c 100644 --- a/src/templates/statistics.html +++ b/src/templates/statistics.html @@ -50,7 +50,10 @@  {showpercent_display} - + +