X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshowgroup.php;h=c20941a35ee07776acb475fd69152e4b139b79b4;hb=5e816d7be208fc24419288234559c78da7391c8b;hp=72738d7853da15236f590db9372cdbf47e1402f8;hpb=13bd15b0b54fbdf1f95b27813a7dfc934525baae;p=quix0rs-gnu-social.git diff --git a/actions/showgroup.php b/actions/showgroup.php index 72738d7853..c20941a35e 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -129,6 +129,8 @@ class ShowgroupAction extends Action return false; } + common_set_returnto($this->selfUrl()); + return true; } @@ -242,7 +244,7 @@ class ShowgroupAction extends Action if ($this->group->location) { $this->elementStart('dl', 'entity_location'); $this->element('dt', null, _('Location')); - $this->element('dd', 'location', $this->group->location); + $this->element('dd', 'label', $this->group->location); $this->elementEnd('dl'); } @@ -269,7 +271,7 @@ class ShowgroupAction extends Action $this->elementStart('div', 'entity_actions'); $this->element('h2', null, _('Group actions')); $this->elementStart('ul'); - $this->elementStart('li', array('id' => 'entity_subscribe')); + $this->elementStart('li', 'entity_subscribe'); $cur = common_current_user(); if ($cur) { if ($cur->isMember($this->group)) { @@ -290,37 +292,18 @@ class ShowgroupAction extends Action } /** - * Show a list of links to feeds this page produces - * - * @return void - */ - - function showExportData() - { - $fl = new FeedList($this); - $fl->show(array(0=>array('href'=>common_local_url('grouprss', - array('nickname' => $this->group->nickname)), - 'type' => 'rss', - 'version' => 'RSS 1.0', - 'item' => 'notices'))); - } - - /** - * Show a list of links to feeds this page produces + * Get a list of the feeds for this page * * @return void */ - function showFeeds() + function getFeeds() { $url = common_local_url('grouprss', array('nickname' => $this->group->nickname)); - $this->element('link', array('rel' => 'alternate', - 'href' => $url, - 'type' => 'application/rss+xml', - 'title' => sprintf(_('Notice feed for %s group'), + return array(new Feed(Feed::RSS1, $url, sprintf(_('Notice feed for %s group'), $this->group->nickname))); } @@ -333,6 +316,7 @@ class ShowgroupAction extends Action function showSections() { $this->showMembers(); + $this->showStatistics(); $cloud = new GroupTagCloudSection($this, $this->group); $cloud->show(); } @@ -356,12 +340,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 +355,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 ' . @@ -380,7 +397,7 @@ class ShowgroupAction extends Action 'short messages about their life and interests. '. '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'), $this->group->nickname); - $this->elementStart('div', 'anonymous'); + $this->elementStart('div', array('id' => 'anon_notice')); $this->raw(common_markup_to_html($m)); $this->elementEnd('div'); }