From d74f54a7166fc25d4fbffd85447a33387f63f513 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 19 Feb 2009 11:49:57 +0000 Subject: Fix for user object counting with upper and lower time limits. git-svn-id: https://code.elgg.org/elgg/trunk@2806 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/users.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/lib/users.php b/engine/lib/users.php index f859f9681..94cf9684a 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -621,10 +621,12 @@ * * @param int $user_guid The GUID of the owning user * @param string $subtype Optionally, the subtype of objects + * @param int $timelower The earliest time the entity can have been created. Default: all + * @param int $timeupper The latest time the entity can have been created. Default: all * @return int The number of objects the user owns (of this subtype) */ - function count_user_objects($user_guid, $subtype = "") { - $total = get_entities('object', $subtype, $user_guid, "time_created desc", null, null, true, 0, $user_guid); + function count_user_objects($user_guid, $subtype = "", $timelower, $timeupper) { + $total = get_entities('object', $subtype, $user_guid, "time_created desc", null, null, true, 0, $user_guid,$timelower,$timeupper); return $total; } @@ -645,7 +647,7 @@ $offset = (int) get_input('offset'); $limit = (int) $limit; - $count = (int) count_user_objects($user_guid, $subtype); + $count = (int) count_user_objects($user_guid, $subtype,$timelower,$timeupper); $entities = get_user_objects($user_guid, $subtype, $limit, $offset, $timelower, $timeupper); return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination); -- cgit v1.2.3