diff --git a/src/classes/logstreamdb.class.php b/src/classes/logstreamdb.class.php index 85aae70..cc5f19f 100644 --- a/src/classes/logstreamdb.class.php +++ b/src/classes/logstreamdb.class.php @@ -185,6 +185,23 @@ class LogStreamDB extends LogStream { // No buffer? then read from DB! if ( $this->bufferedRecords == null ) $ret = $this->ReadNextRecordsFromDB($uID); + else + { + if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) ) + { + // We need to load new records, so clear the old ones first! + $this->ResetBufferedRecords(); + + // Set new Record start, will be used in the SQL Statement! + $this->_currentRecordStart = $this->_currentRecordNum; // + 1; + + // Now read new ones + $ret = $this->ReadNextRecordsFromDB($uID); + + if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) ) + $ret = ERROR_NOMORERECORDS; + } + } if ( $ret == SUCCESS ) { @@ -215,21 +232,6 @@ class LogStreamDB extends LogStream { // Increment $_currentRecordNum $this->_currentRecordNum++; - - if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) ) - { - // We need to load new records, so clear the old ones first! - $this->ResetBufferedRecords(); - - // Set new Record start, will be used in the SQL Statement! - $this->_currentRecordStart = $this->_currentRecordNum; // + 1; - - // Now read new ones - $ret = $this->ReadNextRecordsFromDB($uID); - - // TODO Check and READ next record! -// die ("omfg wtf ReadNext " . $this->_currentRecordNum); - } } // reached here means return result! diff --git a/src/config.php b/src/config.php index 9a8168b..4f5ba78 100644 --- a/src/config.php +++ b/src/config.php @@ -49,7 +49,7 @@ $CFG['UserDBPass'] = ""; // --- Misc Options $CFG['MiscShowDebugMsg'] = 1; // if enabled, you will get additional output on certain places -$CFG['MiscShowDebugGridCounter'] = 0; // Only for debugging purposes, will add a counter column into the grid! +$CFG['MiscShowDebugGridCounter'] = 1; // Only for debugging purposes, will add a counter column into the grid! $CFG["MiscShowPageRenderStats"] = 1; // If enabled, you will see Pagerender Settings // --- @@ -105,7 +105,7 @@ $CFG['Sources'][Source5]['SourceType'] = SOURCE_DB; $CFG['Sources'][Source5]['DBTableType'] = "winsyslog"; $CFG['Sources'][Source5]['DBType'] = DB_MYSQL; $CFG['Sources'][Source5]['DBServer'] = "127.0.0.1"; -$CFG['Sources'][Source5]['DBName'] = "phplogcon"; +$CFG['Sources'][Source5]['DBName'] = "phplogcon_test"; $CFG['Sources'][Source5]['DBUser'] = "root"; $CFG['Sources'][Source5]['DBPassword'] = ""; $CFG['Sources'][Source5]['DBTableName'] = "systemevents"; diff --git a/src/index.php b/src/index.php index 91a5f69..f9c80be 100644 --- a/src/index.php +++ b/src/index.php @@ -380,7 +380,9 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c // Increment Counter $counter++; } while ($stream->ReadNext($uID, $logArray) == SUCCESS && $counter < $CFG['ViewEntriesPerPage']); - + +//print_r ( $content['syslogmessages'] ); + if ( $content['main_recordcount'] == -1 || $content['main_recordcount'] > $CFG['ViewEntriesPerPage'] ) { // Enable Pager in any case here!