diff --git a/index.php b/index.php index 72f1948..9814d3a 100644 --- a/index.php +++ b/index.php @@ -48,16 +48,20 @@ if ( isset($content['Sources'][$currentSourceID]) && $content['Sources'][$curren // Create LogStream Object $stream = $stream_config->LogStreamFactory($stream_config); $stream->Open( array ( SYSLOG_DATE, SYSLOG_FACILITY, SYSLOG_FACILITY_TEXT, SYSLOG_SEVERITY, SYSLOG_SEVERITY_TEXT, SYSLOG_HOST, SYSLOG_SYSLOGTAG, SYSLOG_MESSAGE, SYSLOG_MESSAGETYPE ), true); + $uID = -1; $counter = 0; // $stream->SetReadDirection(EnumReadDirection::Backward); - while ($stream->ReadNext($uID, $logArray) == 0 && $counter <= 30) + while ($stream->ReadNext($uID, $logArray) == SUCCESS && $counter <= 30) { // Copy Obtained array $content['syslogmessages'][] = $logArray; + // Copy UID + $content['syslogmessages'][$counter]['UID'] = $uID; + // Set truncasted message for display if ( isset($logArray[SYSLOG_MESSAGE]) ) $content['syslogmessages'][$counter][SYSLOG_MESSAGETRUNSCATED] = strlen($logArray[SYSLOG_MESSAGE]) > 100 ? substr($logArray[SYSLOG_MESSAGE], 0, 100 ) . " ..." : $logArray[SYSLOG_MESSAGE]; @@ -67,6 +71,14 @@ if ( isset($content['Sources'][$currentSourceID]) && $content['Sources'][$curren // Increment Counter $counter++; } + + if ( $stream->ReadNext($uID, $logArray) == SUCCESS ) + { + // Enable Player Pager + $content['main_pagerenabled'] = "true"; + } + + // Close file! $stream->Close(); diff --git a/lang/en/main.php b/lang/en/main.php index 2dc3bcb..2cd67dd 100644 --- a/lang/en/main.php +++ b/lang/en/main.php @@ -6,10 +6,16 @@ $content['LN_MAINTITLE'] = "Main PhpLogCon"; $content['LN_MAIN_SELECTSTYLE'] = "Select a Style"; $content['LN_GEN_LANGUAGE'] = "Select language"; $content['LN_GEN_SELECTSOURCE'] = "Select Source"; +$content['LN_GEN_MOREPAGES'] = "More then one Page available"; +$content['LN_GEN_FIRSTPAGE'] = "First Page"; +$content['LN_GEN_LASTPAGE'] = "Last Page"; +$content['LN_GEN_NEXTPAGE'] = "Next Page"; +$content['LN_GEN_PREVIOUSPAGE'] = "Previous Page"; // Main Index Site $content['LN_ERROR_INSTALLFILEREMINDER'] = "Warning! You still have NOT removed the 'install.php' from your PhpLogCon main directory!"; $content['LN_TOP_NUM'] = "No."; +$content['LN_TOP_UID'] = "uID"; $content['LN_GRID_DATE'] = "Date"; $content['LN_GRID_FACILITY'] = "Facility"; $content['LN_GRID_SEVERITY'] = "Severity"; @@ -18,5 +24,4 @@ $content['LN_GRID_INFOUNIT'] = "InfoUnit"; $content['LN_GRID_HOST'] = "Source"; $content['LN_GRID_MSG'] = "Message"; - ?> \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index d8f54e9..4c67397 100644 --- a/templates/index.html +++ b/templates/index.html @@ -25,13 +25,30 @@ + + +
Recent syslog messages
+ + + + + + + + + + + +
 {LN_GEN_MOREPAGES}Pager:     {mypagenumber}   
+ + - + @@ -43,7 +60,7 @@ - +
{LN_TOP_NUM}{LN_TOP_UID} {LN_GRID_DATE} {LN_GRID_FACILITY} {LN_GRID_SEVERITY}
{ZAEHLER}{UID} {timereported} {syslogfacility-text} {syslogseverity-text}