From 849fb29545faf3d3e0d97febfbd7dac7506424bb Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 9 Apr 2009 12:55:18 +0000 Subject: Closes #974: Owner_guid may now be an array git-svn-id: https://code.elgg.org/elgg/trunk@3198 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/metadata.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'engine/lib/metadata.php') diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 35ea073f0..3decc1461 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -633,7 +633,13 @@ $offset = (int)$offset; if ($order_by == "") $order_by = "e.time_created desc"; $order_by = sanitise_string($order_by); - $owner_guid = (int) $owner_guid; + if ((is_array($owner_guid) && (count($owner_guid)))) { + foreach($owner_guid as $key => $guid) { + $owner_guid[$key] = (int) $guid; + } + } else { + $owner_guid = (int) $owner_guid; + } $site_guid = (int) $site_guid; if ($site_guid == 0) @@ -646,9 +652,13 @@ if ($entity_subtype) $where[] = "e.subtype = {$entity_subtype}"; if ($site_guid > 0) - $where[] = "e.site_guid = {$site_guid}"; - if ($owner_guid > 0) + $where[] = "e.site_guid = {$site_guid}"; + if (is_array($owner_guid)) { + $where[] = "e.container_guid in (".implode(",",$owner_guid).")"; + } else if ($owner_guid > 0) $where[] = "e.container_guid = {$owner_guid}"; + //if ($owner_guid > 0) + // $where[] = "e.container_guid = {$owner_guid}"; if ($count) { $query = "SELECT count(distinct e.guid) as total "; -- cgit v1.2.3