summaryrefslogtreecommitdiff
path: root/classes/User_group.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-01-21 02:22:10 -0500
committerEvan Prodromou <evan@controlyourself.ca>2009-01-21 02:22:10 -0500
commit26652e92f2ef0cedda9823e17c81fc78be82fe9b (patch)
tree06cda4f98d37dac0824e96f98f727f25ce3146da /classes/User_group.php
parent97f14ef1f9c9a1151c149eb1e95646081918befb (diff)
First pass at a group home page
This is the first pass at a group home page.
Diffstat (limited to 'classes/User_group.php')
-rwxr-xr-xclasses/User_group.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/classes/User_group.php b/classes/User_group.php
index e8aaec744..e0b6f2885 100755
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -2,7 +2,7 @@
/**
* Table Definition for user_group
*/
-require_once 'classes/Memcached_DataObject';
+require_once 'classes/Memcached_DataObject.php';
class User_group extends Memcached_DataObject
{
@@ -28,4 +28,31 @@ class User_group extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+
+ function defaultLogo($size) {
+ static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
+ AVATAR_STREAM_SIZE => 'stream',
+ AVATAR_MINI_SIZE => 'mini');
+ return theme_path('default-avatar-'.$sizenames[$size].'.png');
+ }
+
+ function homeUrl() {
+ return common_local_url('showgroup',
+ array('nickname' => $this->nickname));
+ }
+
+ function permalink() {
+ return common_local_url('groupbyid',
+ array('id' => $this->id));
+ }
+
+ function getNotices($offset, $limit) {
+ $qry =
+ 'SELECT notice.* ' .
+ 'FROM notice JOIN group_inbox ON notice.id = group_inbox.notice_id ' .
+ 'WHERE group_inbox.group_id = %d ';
+ return Notice::getStream(sprintf($qry, $this->id),
+ 'group:notices:'.$this->id,
+ $offset, $limit);
+ }
}