summaryrefslogtreecommitdiff
path: root/actions/showgroup.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-01-21 10:15:48 -0500
committerEvan Prodromou <evan@controlyourself.ca>2009-01-21 10:15:48 -0500
commit57a9e33b3ca034e4c52ab2e858103d792f9fd5af (patch)
tree5ede481f3c022379a94a6a6c176fada6d205e477 /actions/showgroup.php
parent79db73d4ac0f23e4177b712d0be98f92c289af01 (diff)
Add members mini-icons to group page
Diffstat (limited to 'actions/showgroup.php')
-rw-r--r--actions/showgroup.php69
1 files changed, 69 insertions, 0 deletions
diff --git a/actions/showgroup.php b/actions/showgroup.php
index 9dbad1127..a1e89a3a3 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -35,6 +35,8 @@ if (!defined('LACONICA')) {
require_once INSTALLDIR.'/lib/noticelist.php';
require_once INSTALLDIR.'/lib/feedlist.php';
+define('MEMBERS_PER_SECTION', 81);
+
/**
* Group main page
*
@@ -314,4 +316,71 @@ class ShowgroupAction extends Action
'title' => sprintf(_('Notice feed for %s group'),
$this->group->nickname)));
}
+
+ /**
+ * Fill in the sidebar.
+ *
+ * @return void
+ */
+
+ function showSections()
+ {
+ $this->showMembers();
+ }
+
+ /**
+ * Show mini-list of members
+ *
+ * @return void
+ */
+
+ function showMembers()
+ {
+ $member = $this->group->getMembers(0, MEMBERS_PER_SECTION);
+
+ if (!$member) {
+ return;
+ }
+
+ $this->elementStart('div', array('id' => 'user_subscriptions',
+ 'class' => 'section'));
+
+ $this->element('h2', null, _('Members'));
+
+ $this->elementStart('ul', 'users');
+
+ $cnt = 0;
+
+ while ($member->fetch() && ++$cnt < MEMBERS_PER_SECTION) {
+
+ $cnt++;
+
+ $this->elementStart('li', 'vcard');
+ $this->elementStart('a', array('title' => ($member->fullname) ?
+ $member->fullname :
+ $member->nickname,
+ 'href' => $member->profileurl,
+ 'rel' => 'contact',
+ 'class' => 'url'));
+ $avatar = $member->getAvatar(AVATAR_MINI_SIZE);
+ $this->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)),
+ 'width' => AVATAR_MINI_SIZE,
+ 'height' => AVATAR_MINI_SIZE,
+ 'class' => 'avatar photo',
+ 'alt' => ($member->fullname) ?
+ $member->fullname :
+ $member->nickname));
+ $this->element('span', 'fn nickname', $member->nickname);
+ $this->elementEnd('a');
+ $this->elementEnd('li');
+ }
+
+ $this->elementEnd('ul');
+
+ if ($cnt == MEMBERS_PER_SECTION) {
+ $this->element('a', array('href' => common_local_url('groupmembers',
+ array('nickname' => $this->group->nickname))),
+ _('All members'));
+ }
+ }
} \ No newline at end of file