summaryrefslogtreecommitdiff
path: root/includes/model/LogEntries_model.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2013-09-18 01:38:36 +0200
committerPhilip Häusler <msquare@notrademark.de>2013-09-18 01:38:36 +0200
commitbfb0cacd541cc20129a3c0ac77130370741dca18 (patch)
tree0a0e86e1a53d712065664c12d06603bc044df9ec /includes/model/LogEntries_model.php
parentd50cc21f50cb3ec3afdabb74a20d81bd1a53dfbd (diff)
mysql to mysqli and a lot of cleanup and mvc
Diffstat (limited to 'includes/model/LogEntries_model.php')
-rw-r--r--includes/model/LogEntries_model.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/includes/model/LogEntries_model.php b/includes/model/LogEntries_model.php
index f8a552f2..1fa97356 100644
--- a/includes/model/LogEntries_model.php
+++ b/includes/model/LogEntries_model.php
@@ -6,17 +6,14 @@
* @param $message Log Message
*/
function LogEntry_create($nick, $message) {
- $timestamp = time();
-
- sql_query("INSERT INTO `LogEntries` SET `timestamp`=" . sql_escape($timestamp) . ", `nick`='" . sql_escape($nick) . "', `message`='" . sql_escape($message) . "'");
+ return sql_query("INSERT INTO `LogEntries` SET `timestamp`=" . sql_escape(time()) . ", `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;
+ return sql_select("SELECT * FROM `LogEntries` WHERE `timestamp` > " . (time() - 24*60*60) . " ORDER BY `timestamp` DESC LIMIT 1000");
}