aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/system_log.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/system_log.php')
-rw-r--r--engine/lib/system_log.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/engine/lib/system_log.php b/engine/lib/system_log.php
index fbf0b073a..85087219b 100644
--- a/engine/lib/system_log.php
+++ b/engine/lib/system_log.php
@@ -59,8 +59,9 @@
* @param string $class The class of object it effects.
* @param int $limit Maximum number of responses to return.
* @param int $offset Offset of where to start.
+ * @param bool $count Return count or not
*/
- function get_system_log($by_user = "", $event = "", $class = "", $limit = 10, $offset = 0)
+ function get_system_log($by_user = "", $event = "", $class = "", $limit = 10, $offset = 0, $count = false)
{
global $CONFIG;
@@ -88,12 +89,14 @@
if ($class!=="")
$where[] = "object_class='$class'";
- $query = "SELECT * from {$CONFIG->dbprefix}system_log where 1 ";
+ $select = "*";
+ if ($count) $select = "count(*)";
+ $query = "SELECT $select; from {$CONFIG->dbprefix}system_log where 1 ";
foreach ($where as $w)
$query .= " and $w";
$query .= " order by time_created desc";
- $query .= " limit $offset, $limit"; // Add order and limit
+ if (!$count) $query .= " limit $offset, $limit"; // Add order and limit
return get_data($query);
}