diff --git a/src/admin/index.php b/src/admin/index.php index a4df05b..53cff38 100644 --- a/src/admin/index.php +++ b/src/admin/index.php @@ -93,6 +93,7 @@ if ( isset($_POST['op']) && $content['EditAllowed'] ) if ( isset ($_POST['MiscShowPageRenderStats']) ) { $content['MiscShowPageRenderStats'] = 1; } else { $content['MiscShowPageRenderStats'] = 0; } if ( isset ($_POST['MiscEnableGzipCompression']) ) { $content['MiscEnableGzipCompression'] = 1; } else { $content['MiscEnableGzipCompression'] = 0; } if ( isset ($_POST['DebugUserLogin']) ) { $content['DebugUserLogin'] = 1; } else { $content['DebugUserLogin'] = 0; } + if ( isset ($_POST['SuppressDuplicatedMessages']) ) { $content['SuppressDuplicatedMessages'] = 1; } else { $content['SuppressDuplicatedMessages'] = 0; } // Read Text number fields if ( isset ($_POST['ViewMessageCharacterLimit']) && is_numeric($_POST['ViewMessageCharacterLimit']) ) { $content['ViewMessageCharacterLimit'] = $_POST['ViewMessageCharacterLimit']; } @@ -123,6 +124,7 @@ if ($content['MiscShowDebugGridCounter'] == 1) { $content['MiscShowDebugGridCoun if ($content['MiscShowPageRenderStats'] == 1) { $content['MiscShowPageRenderStats_checked'] = "checked"; } else { $content['MiscShowPageRenderStats_checked'] = ""; } if ($content['MiscEnableGzipCompression'] == 1) { $content['MiscEnableGzipCompression_checked'] = "checked"; } else { $content['MiscEnableGzipCompression_checked'] = ""; } if ($content['DebugUserLogin'] == 1) { $content['DebugUserLogin_checked'] = "checked"; } else { $content['DebugUserLogin_checked'] = ""; } +if ($content['SuppressDuplicatedMessages'] == 1) { $content['SuppressDuplicatedMessages_checked'] = "checked"; } else { $content['SuppressDuplicatedMessages_checked'] = ""; } // --- // --- Init for DefaultView field! diff --git a/src/include/config.sample.php b/src/include/config.sample.php index 3dcc336..4de4764 100644 --- a/src/include/config.sample.php +++ b/src/include/config.sample.php @@ -76,6 +76,7 @@ $CFG['SearchCustomButtonCaption'] = "I'd like to feel sad"; // Default caption f $CFG['SearchCustomButtonSearch'] = "error"; // Default search string for the custom search button $CFG['EnableIPAddressResolve'] = 1; // If enabled, IP Addresses inline messages are automatically resolved and the result is added in brackets {} behind the IP Address +$CFG['SuppressDuplicatedMessages'] = 0; // If enabled, duplicated messages will be suppressed in the main display. // --- // --- Define which fields you want to see diff --git a/src/include/functions_common.php b/src/include/functions_common.php index bfb9c65..2da004c 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -1061,6 +1061,7 @@ function SaveGeneralSettingsIntoDB() WriteConfigValue( "MiscShowPageRenderStats", true ); WriteConfigValue( "MiscEnableGzipCompression", true ); WriteConfigValue( "DebugUserLogin", true ); + WriteConfigValue( "SuppressDuplicatedMessages", true ); WriteConfigValue( "ViewMessageCharacterLimit", true ); WriteConfigValue( "ViewEntriesPerPage", true ); diff --git a/src/index.php b/src/index.php index fb3b1c4..7e86e68 100644 --- a/src/index.php +++ b/src/index.php @@ -298,6 +298,31 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c //Loop through the messages! do { + // --- Extra stuff for suppressing messages + if ( + isset($CFG['SuppressDuplicatedMessages']) && $CFG['SuppressDuplicatedMessages'] == 1 + && + isset($logArray[SYSLOG_MESSAGE]) + ) + { + + if ( !isset($szLastMessage) ) // Only set lastmgr + $szLastMessage = $logArray[SYSLOG_MESSAGE]; + else + { + // Skip if same msg + if ( $szLastMessage == $logArray[SYSLOG_MESSAGE] ) + { + // Set last mgr + $szLastMessage = $logArray[SYSLOG_MESSAGE]; + + // Skip entry + continue; + } + } + } + // --- + // --- Set CSS Class if ( $counter % 2 == 0 ) $content['syslogmessages'][$counter]['cssclass'] = "line1"; diff --git a/src/lang/de/admin.php b/src/lang/de/admin.php index 59c988a..115e7ad 100644 --- a/src/lang/de/admin.php +++ b/src/lang/de/admin.php @@ -77,6 +77,7 @@ $content['LN_GEN_CONFIGFILE'] = "Configuration File"; $content['LN_GEN_ACCESSDENIED'] = "Access denied to this function"; $content['LN_GEN_DEFVIEWS'] = "Default selected view"; $content['LN_GEN_DEFSOURCE'] = "Default selected source"; +$content['LN_GEN_SUPPRESSDUPMSG'] = "Suppress duplicated messages"; // User Center $content['LN_USER_CENTER'] = "User Options"; diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php index 877b34c..115e7ad 100644 --- a/src/lang/en/admin.php +++ b/src/lang/en/admin.php @@ -77,7 +77,7 @@ $content['LN_GEN_CONFIGFILE'] = "Configuration File"; $content['LN_GEN_ACCESSDENIED'] = "Access denied to this function"; $content['LN_GEN_DEFVIEWS'] = "Default selected view"; $content['LN_GEN_DEFSOURCE'] = "Default selected source"; - +$content['LN_GEN_SUPPRESSDUPMSG'] = "Suppress duplicated messages"; // User Center $content['LN_USER_CENTER'] = "User Options"; diff --git a/src/lang/pt_BR/admin.php b/src/lang/pt_BR/admin.php index 59c988a..115e7ad 100644 --- a/src/lang/pt_BR/admin.php +++ b/src/lang/pt_BR/admin.php @@ -77,6 +77,7 @@ $content['LN_GEN_CONFIGFILE'] = "Configuration File"; $content['LN_GEN_ACCESSDENIED'] = "Access denied to this function"; $content['LN_GEN_DEFVIEWS'] = "Default selected view"; $content['LN_GEN_DEFSOURCE'] = "Default selected source"; +$content['LN_GEN_SUPPRESSDUPMSG'] = "Suppress duplicated messages"; // User Center $content['LN_USER_CENTER'] = "User Options"; diff --git a/src/templates/admin/admin_index.html b/src/templates/admin/admin_index.html index 4b124a8..1fc7f04 100644 --- a/src/templates/admin/admin_index.html +++ b/src/templates/admin/admin_index.html @@ -93,7 +93,10 @@ {LN_GEN_IPADRRESOLVE} - + + {LN_GEN_SUPPRESSDUPMSG} + + {LN_ADMIN_MISC}