/** * Returns a list of log entries */ public static function getList($keywords, $type, $limit) { $db = Loader::db(); if ($keywords != '') { $kw = 'and logText like ' . $db->quote('%' . $keywords . '%'); } if ($type != false) { $v = array($type); $r = $db->Execute('select logID from Logs where logType = ? ' . $kw . ' order by timestamp desc limit ' . $limit, $v); } else { $r = $db->Execute('select logID from Logs where 1=1 ' . $kw . ' order by timestamp desc limit ' . $limit); } $entries = array(); while ($row = $r->FetchRow()) { $entries[] = LogEntry::getByID($row['logID']); } return $entries; }