aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/system_log.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-25 14:55:05 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-25 14:55:05 +0000
commit7d49e67a72a814f6261712390521531dfd7d0a33 (patch)
treee5a37e74cf5cfa5b3def71d5213acf441b0e7bc4 /engine/lib/system_log.php
parent223e5d08b3333dc93519676580b6d892ff7e19c3 (diff)
downloadelgg-7d49e67a72a814f6261712390521531dfd7d0a33.tar.gz
elgg-7d49e67a72a814f6261712390521531dfd7d0a33.tar.bz2
Made the friends river entities functions loads more efficient.
git-svn-id: https://code.elgg.org/elgg/trunk@1126 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/system_log.php')
-rw-r--r--engine/lib/system_log.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/engine/lib/system_log.php b/engine/lib/system_log.php
index 52ec6bee0..fbf0b073a 100644
--- a/engine/lib/system_log.php
+++ b/engine/lib/system_log.php
@@ -63,8 +63,14 @@
function get_system_log($by_user = "", $event = "", $class = "", $limit = 10, $offset = 0)
{
global $CONFIG;
-
- $by_user = (int)$by_user;
+
+ if (is_array($by_user) && sizeof($by_user) > 0) {
+ foreach($by_user as $key => $val) {
+ $by_user[$key] = (int) $val;
+ }
+ } else {
+ $by_user = (int)$by_user;
+ }
$event = sanitise_string($event);
$class = sanitise_string($class);
$limit = (int)$limit;
@@ -72,8 +78,11 @@
$where = array();
- if ($by_user != "")
- $where[] = "performed_by_guid=$by_user";
+ if (is_int($by_user) && $by_user > 0) {
+ $where[] = "performed_by_guid=$by_user";
+ } else if (is_array($by_user)) {
+ $where [] = "performed_by_guid in (". implode(",",$by_user) .")";
+ }
if ($event != "")
$where[] = "event='$event'";
if ($class!=="")
@@ -84,7 +93,7 @@
$query .= " and $w";
$query .= " order by time_created desc";
- $query .= " limit $offset, $limit"; // Add order and limit
+ $query .= " limit $offset, $limit"; // Add order and limit
return get_data($query);
}