aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/access.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-25 11:21:03 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-25 11:21:03 +0000
commit1894d4e19fe7acb5fcd042b25abc2de9d8ee57fa (patch)
tree81df285c312bc86c05ad5bfe4b2d5d5e820acb80 /engine/lib/access.php
parented6238f72c00f27b5df94f478d4ff70ab91982a2 (diff)
downloadelgg-1894d4e19fe7acb5fcd042b25abc2de9d8ee57fa.tar.gz
elgg-1894d4e19fe7acb5fcd042b25abc2de9d8ee57fa.tar.bz2
Improved friend picker.
git-svn-id: https://code.elgg.org/elgg/trunk@1526 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/access.php')
-rw-r--r--engine/lib/access.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 64d982e30..2c9a886e6 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -310,17 +310,24 @@
* Get all of members of a friend collection
*
* @param int $collection The collection's ID
+ * @param true|false $idonly If set to true, will only return the members' IDs (default: false)
* @return ElggUser entities if successful, false if not
*/
- function get_members_of_access_collection($collection) {
+ function get_members_of_access_collection($collection, $idonly = false) {
$collection = (int)$collection;
global $CONFIG;
- $query = "select e.* from {$CONFIG->dbprefix}access_collection_membership m join {$CONFIG->dbprefix}entities e on e.guid = m.user_guid WHERE m.access_collection_id = {$collection}";
-
- $collection_members = get_data($query, "entity_row_to_elggstar");
+ if (!$idonly) {
+ $query = "select e.* from {$CONFIG->dbprefix}access_collection_membership m join {$CONFIG->dbprefix}entities e on e.guid = m.user_guid WHERE m.access_collection_id = {$collection}";
+ $collection_members = get_data($query, "entity_row_to_elggstar");
+ } else {
+ $query = "select e.guid from {$CONFIG->dbprefix}access_collection_membership m join {$CONFIG->dbprefix}entities e on e.guid = m.user_guid WHERE m.access_collection_id = {$collection}";
+ $collection_members = get_data($query);
+ foreach($collection_members as $key => $val)
+ $collection_members[$key] = $val->guid;
+ }
return $collection_members;
@@ -337,7 +344,8 @@
if ($collections = get_user_access_collections($owner_guid)) {
foreach($collections as $key => $collection) {
- $collections[$key]->entities = get_members_of_access_collection($collection->id);
+ $collections[$key]->members = get_members_of_access_collection($collection->id, true);
+ $collections[$key]->entities = get_user_friends($owner_guid,"",9999);
}
}