summaryrefslogtreecommitdiff
path: root/classes/User_group.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/User_group.php')
-rw-r--r--classes/User_group.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/classes/User_group.php b/classes/User_group.php
index a135015ba..9f9977755 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -125,6 +125,29 @@ class User_group extends Memcached_DataObject
return $members;
}
+ function getBlocked($offset=0, $limit=null)
+ {
+ $qry =
+ 'SELECT profile.* ' .
+ 'FROM profile JOIN group_block '.
+ 'ON profile.id = group_block.blocked ' .
+ 'WHERE group_block.group_id = %d ' .
+ 'ORDER BY group_block.modified DESC ';
+
+ if ($limit != null) {
+ if (common_config('db','type') == 'pgsql') {
+ $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
+ } else {
+ $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+ }
+ }
+
+ $blocked = new Profile();
+
+ $blocked->query(sprintf($qry, $this->id));
+ return $blocked;
+ }
+
function setOriginal($filename)
{
$imagefile = new ImageFile($this->id, Avatar::path($filename));
@@ -137,4 +160,9 @@ class User_group extends Memcached_DataObject
common_debug(common_log_objstring($this));
return $this->update($orig);
}
+
+ function getBestName()
+ {
+ return ($this->fullname) ? $this->fullname : $this->nickname;
+ }
}