summaryrefslogtreecommitdiff
path: root/classes/User_group.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-29 10:22:17 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-06-29 10:22:17 -0400
commitd03b8c4276e5bd3822289a8b5c94be60cb90ef75 (patch)
tree6c4d2b063635a2a2de9ac822e6129c6d20a3cc57 /classes/User_group.php
parentffa40a84bae9932e390cb58a4ba3a21708e61977 (diff)
show section with admins in sidebar of group
Diffstat (limited to 'classes/User_group.php')
-rw-r--r--classes/User_group.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/classes/User_group.php b/classes/User_group.php
index 9b4b01ead..27b444705 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -126,6 +126,30 @@ class User_group extends Memcached_DataObject
return $members;
}
+ function getAdmins($offset=0, $limit=null)
+ {
+ $qry =
+ 'SELECT profile.* ' .
+ 'FROM profile JOIN group_member '.
+ 'ON profile.id = group_member.profile_id ' .
+ 'WHERE group_member.group_id = %d ' .
+ 'AND group_member.is_admin = 1 ' .
+ 'ORDER BY group_member.modified ASC ';
+
+ if ($limit != null) {
+ if (common_config('db','type') == 'pgsql') {
+ $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
+ } else {
+ $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+ }
+ }
+
+ $admins = new Profile();
+
+ $admins->query(sprintf($qry, $this->id));
+ return $admins;
+ }
+
function getBlocked($offset=0, $limit=null)
{
$qry =