diff options
Diffstat (limited to 'actions')
-rw-r--r-- | actions/disfavor.php | 2 | ||||
-rw-r--r-- | actions/favor.php | 2 | ||||
-rw-r--r-- | actions/newnotice.php | 2 | ||||
-rw-r--r-- | actions/nudge.php | 2 | ||||
-rw-r--r-- | actions/showgroup.php | 46 | ||||
-rw-r--r-- | actions/subscribe.php | 2 | ||||
-rw-r--r-- | actions/tagother.php | 2 | ||||
-rw-r--r-- | actions/unsubscribe.php | 2 |
8 files changed, 47 insertions, 13 deletions
diff --git a/actions/disfavor.php b/actions/disfavor.php index 09b3bf18d..90bab3cca 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -89,7 +89,7 @@ class DisfavorAction extends Action } $user->blowFavesCache(); if ($this->boolean('ajax')) { - $this->startHTML('text/xml;charset=utf-8', true); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); $this->element('title', null, _('Add to favorites')); $this->elementEnd('head'); diff --git a/actions/favor.php b/actions/favor.php index 8ecde4b11..3940df688 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -89,7 +89,7 @@ class FavorAction extends Action $this->notify($notice, $user); $user->blowFavesCache(); if ($this->boolean('ajax')) { - $this->startHTML('text/xml;charset=utf-8', true); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); $this->element('title', null, _('Disfavor favorite')); $this->elementEnd('head'); diff --git a/actions/newnotice.php b/actions/newnotice.php index 572adbb23..5142cb5ff 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -161,7 +161,7 @@ class NewnoticeAction extends Action common_broadcast_notice($notice); if ($this->boolean('ajax')) { - $this->startHTML('text/xml;charset=utf-8', true); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); $this->element('title', null, _('Notice posted')); $this->elementEnd('head'); diff --git a/actions/nudge.php b/actions/nudge.php index ca7947f5a..bc3d48478 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -89,7 +89,7 @@ class NudgeAction extends Action $this->notify($user, $other); if ($this->boolean('ajax')) { - $this->startHTML('text/xml;charset=utf-8', true); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); $this->element('title', null, _('Nudge sent')); $this->elementEnd('head'); 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 ' . diff --git a/actions/subscribe.php b/actions/subscribe.php index 171332734..f761992de 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -64,7 +64,7 @@ class SubscribeAction extends Action } if ($this->boolean('ajax')) { - $this->startHTML('text/xml;charset=utf-8', true); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); $this->element('title', null, _('Subscribed')); $this->elementEnd('head'); diff --git a/actions/tagother.php b/actions/tagother.php index 9b06cb43e..cbace5b6b 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -203,7 +203,7 @@ class TagotherAction extends Action $action = $user->isSubscribed($this->profile) ? 'subscriptions' : 'subscribers'; if ($this->boolean('ajax')) { - $this->startHTML('text/xml'); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); $this->element('title', null, _('Tags')); $this->elementEnd('head'); diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index f9dd6f821..b1e2b6425 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -66,7 +66,7 @@ class UnsubscribeAction extends Action } if ($this->boolean('ajax')) { - $this->startHTML('text/xml;charset=utf-8', true); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); $this->element('title', null, _('Unsubscribed')); $this->elementEnd('head'); |