diff options
author | Felix Favre <gnomus@gnomus.de> | 2014-12-15 21:23:57 +0100 |
---|---|---|
committer | Felix Favre <gnomus@gnomus.de> | 2014-12-15 21:23:57 +0100 |
commit | be1bb5fbeb2cb93105b12cc9d9b4cae676f59a7f (patch) | |
tree | 85615b140784a093a5db3439132e489c5047f992 /includes/model/LogEntries_model.php | |
parent | 388dd0e1369755875a8eeb2259291f57d0a92990 (diff) |
add simple search to log view
Diffstat (limited to 'includes/model/LogEntries_model.php')
-rw-r--r-- | includes/model/LogEntries_model.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/model/LogEntries_model.php b/includes/model/LogEntries_model.php index 49e063dc..2e8a8cf7 100644 --- a/includes/model/LogEntries_model.php +++ b/includes/model/LogEntries_model.php @@ -18,4 +18,11 @@ function LogEntries() { return sql_select("SELECT * FROM `LogEntries` ORDER BY `timestamp` DESC LIMIT 10000"); } -?>
\ No newline at end of file +/** + * Returns log entries filtered by a keyword + */ +function LogEntries_filter($keyword) { + return sql_select("SELECT * FROM `LogEntries` WHERE `nick` LIKE '%" . sql_escape($keyword) . "%' OR `message` LIKE '%" . sql_escape($keyword) . "%' ORDER BY `timestamp` DESC"); +} + +?> |