summaryrefslogtreecommitdiff
path: root/classes/User_group.php
diff options
context:
space:
mode:
authorAdrian Lang <mail@adrianlang.de>2009-02-01 22:24:54 +0100
committerAdrian Lang <mail@adrianlang.de>2009-02-01 22:24:54 +0100
commit2f37539967efa3e30873d836b308a64fdc48078a (patch)
tree43dbdf5f314bb132763596160616c3e1fdb7f1cb /classes/User_group.php
parent37a769205387c0f9c41f60a675e963678d9a966f (diff)
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.
Diffstat (limited to 'classes/User_group.php')
-rwxr-xr-xclasses/User_group.php13
1 files changed, 7 insertions, 6 deletions
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;
}