From 0c54d7f6f4436e3107608a7b7dd142069f9b4dd1 Mon Sep 17 00:00:00 2001 From: Alexandr Alakin Date: Wed, 11 Dec 2019 09:54:08 +0600 Subject: [PATCH] Resolving Issue #100 (even/odd rows in report) Only even classes are used. Fix resolves to correct usage of even/odd clases for even/odd rows within the report --- README.md | 1 + syslog_process.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ec6916..4ee0e78 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ The sylog plugin has been in development for well over a decade with increasing --- develop --- +* issue#100: Fix odd/even classes generation in report * issue#96: Syslog filtering does not work with some international characters * issue#87: Program data is not sync with syslog_incoming under PHP 7.2 diff --git a/syslog_process.php b/syslog_process.php index 16200a5..7221a1f 100644 --- a/syslog_process.php +++ b/syslog_process.php @@ -664,13 +664,13 @@ $classes = array('even', 'odd'); - $i = 0; if (cacti_sizeof($items)) { - $class = $classes[$i % 2]; + $i = 0; foreach($items as $item) { + $class = $classes[$i % 2]; $reptext .= '' . $item['host'] . '' . $item['logtime'] . '' . html_escape($item['message']) . "\n"; + $i++; } - $i++; } if ($reptext != '') {