aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-25 17:36:06 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-25 17:36:06 +0000
commitc9eafde198c9b5d07489de2b5084849e8e314bfa (patch)
tree6c0cb4c4da834b389d8b6d18f9d30f5e9d28d041 /engine/lib
parent10e8d3529df24ccb205211f3030353cd2db9e0e0 (diff)
downloadelgg-c9eafde198c9b5d07489de2b5084849e8e314bfa.tar.gz
elgg-c9eafde198c9b5d07489de2b5084849e8e314bfa.tar.bz2
get_tags can now take an array as owner_guid.
git-svn-id: https://code.elgg.org/elgg/trunk@1129 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/tags.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/engine/lib/tags.php b/engine/lib/tags.php
index 8648fb3f8..ee770b492 100644
--- a/engine/lib/tags.php
+++ b/engine/lib/tags.php
@@ -93,7 +93,12 @@
$entity_subtype = get_subtype_id($entity_type, $entity_subtype);
$entity_type = sanitise_string($entity_type);
- $owner_guid = (int) $owner_guid;
+ if (is_array($owner_guid)) {
+ foreach($owner_guid as $key => $val)
+ $owner_guid[$key] = (int) $val;
+ } else {
+ $owner_guid = (int) $owner_guid;
+ }
if ($site_guid < 0) {
$site_guid = $CONFIG->site_id;
@@ -120,14 +125,16 @@
if ($entity_type != "") {
$query .= " and e.type = '{$entity_type}' ";
}
- if ($owner_guid > 0) {
+ if (is_array($owner_guid)) {
+ $query .= " and e.owner_guid in (".implode(",",$owner_guid).")";
+ } else if (is_int($owner_guid)) {
$query .= " and e.owner_guid = {$owner_guid} ";
}
$query .= " and (e.access_id in {$access} or (e.access_id = 0 and e.owner_guid = {$_SESSION['id']}))";
$query .= " group by msvalue.string having total > {$threshold} order by total desc limit {$limit} ";
-
+
return get_data($query);
}