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 != '') {