summaryrefslogtreecommitdiff
path: root/actions/showgroup.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-02-02 16:42:27 -0500
committerEvan Prodromou <evan@controlyourself.ca>2009-02-02 16:42:27 -0500
commitdaa5797809ec9315db463c5ecc721f1273c0d17e (patch)
tree8ecd1328f3b22baefc2c77a0dc61ebe3163ed5b0 /actions/showgroup.php
parenta381bff4da077b84baaa56ef9780eb806e14b7dd (diff)
parent2f37539967efa3e30873d836b308a64fdc48078a (diff)
Merge branch 'master' of git://gitorious.org/laconica/adrianlang-clone into adrianlang/master
Diffstat (limited to 'actions/showgroup.php')
-rw-r--r--actions/showgroup.php46
1 files changed, 40 insertions, 6 deletions
diff --git a/actions/showgroup.php b/actions/showgroup.php
index c29b7d426..468990e7b 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -333,6 +333,7 @@ class ShowgroupAction extends Action
function showSections()
{
$this->showMembers();
+ $this->showStatistics();
$cloud = new GroupTagCloudSection($this, $this->group);
$cloud->show();
}
@@ -356,12 +357,10 @@ class ShowgroupAction extends Action
$this->element('h2', null, _('Members'));
- if ($member) {
- $pml = new ProfileMiniList($member, null, $this);
- $cnt = $pml->show();
- if ($cnt == 0) {
- $this->element('p', null, _('(None)'));
- }
+ $pml = new ProfileMiniList($member, null, $this);
+ $cnt = $pml->show();
+ if ($cnt == 0) {
+ $this->element('p', null, _('(None)'));
}
if ($cnt == MEMBERS_PER_SECTION) {
@@ -373,6 +372,41 @@ class ShowgroupAction extends Action
$this->elementEnd('div');
}
+ /**
+ * Show some statistics
+ *
+ * @return void
+ */
+
+ function showStatistics()
+ {
+ // XXX: WORM cache this
+ $members = $this->group->getMembers();
+ $members_count = 0;
+ /** $member->count() doesn't work. */
+ while ($members->fetch()) {
+ $members_count++;
+ }
+
+ $this->elementStart('div', array('id' => 'entity_statistics',
+ 'class' => 'section'));
+
+ $this->element('h2', null, _('Statistics'));
+
+ $this->elementStart('dl', 'entity_created');
+ $this->element('dt', null, _('Created'));
+ $this->element('dd', null, date('j M Y',
+ strtotime($this->group->created)));
+ $this->elementEnd('dl');
+
+ $this->elementStart('dl', 'entity_members');
+ $this->element('dt', null, _('Members'));
+ $this->element('dd', null, (is_int($members_count)) ? $members_count : '0');
+ $this->elementEnd('dl');
+
+ $this->elementEnd('div');
+ }
+
function showAnonymousMessage()
{
$m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .