From 26ffee4a96f08aa58a348d11674f6fd29c1498b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Thu, 27 Dec 2012 02:18:56 +0100 Subject: [PATCH] #28 logging doku --- includes/model/LogEntries_model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/model/LogEntries_model.php b/includes/model/LogEntries_model.php index 95ecf6cd..f8a552f2 100644 --- a/includes/model/LogEntries_model.php +++ b/includes/model/LogEntries_model.php @@ -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) . "'"); } +/** + * Returns log entries of the last 24 hours with maximum count of 1000. + */ function LogEntries() { $log_entries_source = sql_select("SELECT * FROM `LogEntries` WHERE `timestamp` > " . (time() - 24*60*60) . " ORDER BY `timestamp` DESC LIMIT 1000"); return $log_entries_source;