From 269386b9cfa0e1558edde89442c6f571ef32c645 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 18 Jun 2008 13:34:58 +0000 Subject: Added generic listing and pagination functions git-svn-id: https://code.elgg.org/elgg/trunk@964 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/sites.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'engine/lib/sites.php') diff --git a/engine/lib/sites.php b/engine/lib/sites.php index c8636fdc8..9d81c7364 100644 --- a/engine/lib/sites.php +++ b/engine/lib/sites.php @@ -367,6 +367,24 @@ $offset = (int)$offset; return get_entities_from_relationship("member_of_site", $site_guid, true, "user", "", 0, "time_created desc", $limit, $offset); + } + + /** + * Display a list of site members + * + * @param int $site_guid The GUID of the site + * @param int $limit The number of members to display on a page + * @return string A displayable list of members + */ + function list_site_members($site_guid, $limit = 10) { + + $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); + $entities = get_site_members($site_guid, $limit, $offset); + + return elgg_view_entity_list($entities, $count, $offset, $limit); + } /** @@ -415,8 +433,8 @@ $offset = (int)$offset; return get_entities_from_relationship("member_of_site", $site_guid, true, "object", $subtype, 0, "time_created desc", $limit, $offset); - } - + } + /** * Add a collection to a site. * -- cgit v1.2.3