#28 logging doku

This commit is contained in:
Philip Häusler 2012-12-27 02:18:56 +01:00
parent 29a6f020e6
commit 26ffee4a96
1 changed files with 3 additions and 0 deletions

View File

@ -11,6 +11,9 @@ function LogEntry_create($nick, $message) {
sql_query("INSERT INTO `LogEntries` SET `timestamp`=" . sql_escape($timestamp) . ", `nick`='" . sql_escape($nick) . "', `message`='" . sql_escape($message) . "'"); sql_query("INSERT INTO `LogEntries` SET `timestamp`=" . sql_escape($timestamp) . ", `nick`='" . sql_escape($nick) . "', `message`='" . sql_escape($message) . "'");
} }
/**
* Returns log entries of the last 24 hours with maximum count of 1000.
*/
function LogEntries() { function LogEntries() {
$log_entries_source = sql_select("SELECT * FROM `LogEntries` WHERE `timestamp` > " . (time() - 24*60*60) . " ORDER BY `timestamp` DESC LIMIT 1000"); $log_entries_source = sql_select("SELECT * FROM `LogEntries` WHERE `timestamp` > " . (time() - 24*60*60) . " ORDER BY `timestamp` DESC LIMIT 1000");
return $log_entries_source; return $log_entries_source;