From 2f37539967efa3e30873d836b308a64fdc48078a Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Sun, 1 Feb 2009 22:24:54 +0100 Subject: Fixes #1088: Show number of group members. Unlike the bugreport requested, the stats are displayed similar to userstream stats in a section in the sidebar. Additionaly, I removed a redundant notnull if check in ShowgroupAction->showMembers, fixed a SQL error in User_group->getMembers when no limit is passed, removed return value storing of void function and added an usage of Profile->getBestName. --- classes/User_group.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'classes') diff --git a/classes/User_group.php b/classes/User_group.php index 5b5b102c7..522dd8143 100755 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -74,16 +74,17 @@ class User_group extends Memcached_DataObject 'WHERE group_member.group_id = %d ' . 'ORDER BY group_member.created DESC '; - if (common_config('db','type') == 'pgsql') { - $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; - } else { - $qry .= ' LIMIT ' . $offset . ', ' . $limit; + if ($limit != null) { + if (common_config('db','type') == 'pgsql') { + $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; + } else { + $qry .= ' LIMIT ' . $offset . ', ' . $limit; + } } $members = new Profile(); - $cnt = $members->query(sprintf($qry, $this->id)); - + $members->query(sprintf($qry, $this->id)); return $members; } -- cgit v1.2.3-54-g00ecf