summaryrefslogtreecommitdiff
path: root/includes/model/LogEntries_model.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2012-12-26 20:36:31 +0100
committerPhilip Häusler <msquare@notrademark.de>2012-12-27 01:35:05 +0100
commit74098af09d11d0af1292b17e6df0483a303b6cce (patch)
tree5cacd2eafb10c9bd89e0976e547c89172e9299f3 /includes/model/LogEntries_model.php
parent7c42769ab897f7fe7903d34523a8a6a5ff6a868b (diff)
#28 finnished logging
Diffstat (limited to 'includes/model/LogEntries_model.php')
-rw-r--r--includes/model/LogEntries_model.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/model/LogEntries_model.php b/includes/model/LogEntries_model.php
index d8615f0e..5659c0ee 100644
--- a/includes/model/LogEntries_model.php
+++ b/includes/model/LogEntries_model.php
@@ -6,10 +6,15 @@
* @param $message Log Message
*/
function LogEntry_create($nick, $message) {
- $timestamp = date();
+ $timestamp = time();
sql_query("INSERT INTO `LogEntries` SET `timestamp`=" . sql_escape($timestamp) . ", `nick`='" . sql_escape($nick) . "', `message`='" . sql_escape($message) . "'");
}
+function LogEntries() {
+ $log_entries_source = sql_select("SELECT * FROM `LogEntries` WHERE `timestamp` > " . (time() - 24*60*60) . " LIMIT 1000");
+ return $log_entries_source;
+}
+
?> \ No newline at end of file