aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metadata.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-04-09 12:55:18 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-04-09 12:55:18 +0000
commit849fb29545faf3d3e0d97febfbd7dac7506424bb (patch)
treebb99e39bf9022a789748c7424cf67f843258543d /engine/lib/metadata.php
parent4cfe0887d68f3d89d63e2d7a857fc12186e6fae1 (diff)
downloadelgg-849fb29545faf3d3e0d97febfbd7dac7506424bb.tar.gz
elgg-849fb29545faf3d3e0d97febfbd7dac7506424bb.tar.bz2
Closes #974: Owner_guid may now be an array
git-svn-id: https://code.elgg.org/elgg/trunk@3198 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r--engine/lib/metadata.php16
1 files changed, 13 insertions, 3 deletions
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 ";