diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-02-17 23:14:33 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-02-17 23:14:33 +0000 |
commit | ba94a48ff66a001dd20c5ac2da34681880583945 (patch) | |
tree | 29b0ebfcd19ba03c69cd8ad7e4171c0002b3d207 /engine/lib/sites.php | |
parent | b3012350e2d8dafaf696e2c472f8cf0ae5e1674b (diff) | |
download | elgg-ba94a48ff66a001dd20c5ac2da34681880583945.tar.gz elgg-ba94a48ff66a001dd20c5ac2da34681880583945.tar.bz2 |
Fixes #1488: Removed use of deprecated functions in core.
git-svn-id: http://code.elgg.org/elgg/trunk@3947 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/sites.php')
-rw-r--r-- | engine/lib/sites.php | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php index e9da4bdab..13521a257 100644 --- a/engine/lib/sites.php +++ b/engine/lib/sites.php @@ -361,7 +361,13 @@ function get_site_members($site_guid, $limit = 10, $offset = 0) { $limit = (int)$limit; $offset = (int)$offset; - return get_entities_from_relationship("member_of_site", $site_guid, true, "user", "", 0, "time_created desc", $limit, $offset); + return elgg_get_entities_from_relationship(array( + 'relationship' => 'member_of_site', + 'relationship_guid' => $site_guid, + 'inverse_relationship' => TRUE, + 'types' => 'user', + 'limit' => $limit, 'offset' => $offset + )); } /** @@ -375,7 +381,16 @@ function get_site_members($site_guid, $limit = 10, $offset = 0) { function list_site_members($site_guid, $limit = 10, $fullview = true) { $offset = (int) get_input('offset'); $limit = (int) $limit; - $count = (int) get_entities_from_relationship("member_of_site", $site_guid, true, "user", "", 0, "time_created desc", $limit, $offset, true); + $options = array( + 'relationship' => 'member_of_site', + 'relationship_guid' => $site_guid, + 'inverse_relationship' => TRUE, + 'types' => 'user', + 'limit' => $limit, + 'offset' => $offset, + 'count' => TRUE + ); + $count = (int) elgg_get_entities_from_relationship($options); $entities = get_site_members($site_guid, $limit, $offset); return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview); @@ -424,7 +439,15 @@ function get_site_objects($site_guid, $subtype = "", $limit = 10, $offset = 0) { $limit = (int)$limit; $offset = (int)$offset; - return get_entities_from_relationship("member_of_site", $site_guid, true, "object", $subtype, 0, "time_created desc", $limit, $offset); + return elgg_get_entities_from_relationship(array( + 'relationship' => 'member_of_site', + 'relationship_guid' => $site_guid, + 'inverse_relationship' => TRUE, + 'types' => 'object', + 'subtypes' => $subtype, + 'limit' => $limit, + 'offset' => $offset + )); } /** @@ -469,7 +492,16 @@ function get_site_collections($site_guid, $subtype = "", $limit = 10, $offset = $limit = (int)$limit; $offset = (int)$offset; - return get_entities_from_relationship("member_of_site", $site_guid, true, "collection", $subtype, 0, "time_created desc", $limit, $offset); + // collection isn't a valid type. This won't work. + return elgg_get_entities_from_relationship(array( + 'relationship' => 'member_of_site', + 'relationship_guid' => $site_guid, + 'inverse_relationship' => TRUE, + 'types' => 'collection', + 'subtypes' => $subtype, + 'limit' => $limit, + 'offset' => $offset + )); } /** |