diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-11 10:16:01 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-11 10:16:01 +0000 |
commit | 33e60e996e44d353b4e0c142b52311e44b847516 (patch) | |
tree | 23d1747759a5d1abd396822e43e5ebfa5f5db2fc | |
parent | 12e25d5275c7eadb7d496e2944f62dcc1aabf18d (diff) | |
download | elgg-33e60e996e44d353b4e0c142b52311e44b847516.tar.gz elgg-33e60e996e44d353b4e0c142b52311e44b847516.tar.bz2 |
Filtering on type,subtype and event
git-svn-id: https://code.elgg.org/elgg/trunk@2715 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/activity.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/engine/lib/activity.php b/engine/lib/activity.php index 20ca8ceec..40833c188 100644 --- a/engine/lib/activity.php +++ b/engine/lib/activity.php @@ -85,7 +85,21 @@ }
$f[$key] = $val;
}
- $activity_events[] = $f;
+
+ // Filter result based on parameters
+ $add = true;
+ if ($type) {
+ if (!in_array($f['type'], $type)) $add = false;
+ }
+ if (($add) && ($subtype)) {
+ if (!in_array($f['subtype'], $subtype)) $add = false;
+ }
+ if (($add) && ($event)) {
+ if (!in_array($f['event'], $event)) $add = false;
+ }
+
+ if ($add)
+ $activity_events[] = $f;
}
$done[] = $tmp;
|