From 33e60e996e44d353b4e0c142b52311e44b847516 Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 11 Feb 2009 10:16:01 +0000 Subject: Filtering on type,subtype and event git-svn-id: https://code.elgg.org/elgg/trunk@2715 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/activity.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'engine/lib/activity.php') 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; -- cgit v1.2.3