From 3fbd56b1908ae7f55416d8965b712cf22884cc07 Mon Sep 17 00:00:00 2001 From: laf Date: Sat, 22 Feb 2014 16:06:39 +0000 Subject: [PATCH] Top X boxes can now be switched off --- html/includes/front/boxes.inc.php | 15 +++++++++++---- includes/defaults.inc.php | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/html/includes/front/boxes.inc.php b/html/includes/front/boxes.inc.php index 45b45452c..378bbd4c2 100644 --- a/html/includes/front/boxes.inc.php +++ b/html/includes/front/boxes.inc.php @@ -20,10 +20,17 @@ echo(' data-cycle-slides="> div"> '); -foreach (get_matching_files($config['html_dir']."/includes/front/", "/^top_.*\.php$/") as $file) { - echo("
\n"); - include_once($file); - echo("
\n"); +foreach (get_matching_files($config['html_dir']."/includes/front/", "/^top_.*\.php$/") as $file) +{ + if(($file == 'top_ports.inc.php' && $config['top_ports'] == 0) || ($file == 'top_device_bits.inc.php' && $config['top_devices'] == 0)) + { + } + else + { + echo("
\n"); + include_once($file); + echo("
\n"); + } } echo("\n"); diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index e96e505f6..98cd51ad3 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -113,6 +113,8 @@ $config['page_refresh'] = "300"; // Refresh the page every xx seconds, 0 to $config['front_page'] = "pages/front/default.php"; $config['front_page_settings']['top']['ports'] = 10; $config['front_page_settings']['top']['devices'] = 10; +$config['top_ports'] = 1; // This enables the top X ports box +$config['top_devices'] = 1; // This enables the top X devices box $config['page_title_prefix'] = ""; $config['page_title_suffix'] = $config['project_name']; $config['timestamp_format'] = 'd-m-Y H:i:s';