X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshowgroup.php;h=ff994976215263447b6151d5f65b131873c1039f;hb=7bd65a7b86d7d694d28e81f7d6897cbefd9d9e1d;hp=b6a0f4844e78a69752cd6c690203b54d869ede07;hpb=6328add622641e5f5721cc34d27d4d872c86a561;p=quix0rs-gnu-social.git diff --git a/actions/showgroup.php b/actions/showgroup.php index b6a0f4844e..ff99497621 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -1,6 +1,6 @@ . * * @category Group - * @package Laconica - * @author Evan Prodromou - * @author Sarven Capadisli - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -41,10 +41,10 @@ define('MEMBERS_PER_SECTION', 27); * Group main page * * @category Group - * @package Laconica - * @author Evan Prodromou + * @package StatusNet + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ShowgroupAction extends GroupDesignAction @@ -130,8 +130,18 @@ class ShowgroupAction extends GroupDesignAction $this->group = User_group::staticGet('nickname', $nickname); if (!$this->group) { - $this->clientError(_('No such group'), 404); - return false; + $alias = Group_alias::staticGet('alias', $nickname); + if ($alias) { + $args = array('id' => $alias->group_id); + if ($this->page != 1) { + $args['page'] = $this->page; + } + common_redirect(common_local_url('groupbyid', $args), 301); + return false; + } else { + $this->clientError(_('No such group'), 404); + return false; + } } common_set_returnto($this->selfUrl()); @@ -317,8 +327,25 @@ class ShowgroupAction extends GroupDesignAction common_local_url('grouprss', array('nickname' => $this->group->nickname)); - return array(new Feed(Feed::RSS1, $url, sprintf(_('Notice feed for %s group'), - $this->group->nickname))); + return array(new Feed(Feed::RSS1, + common_local_url('grouprss', + array('nickname' => $this->group->nickname)), + sprintf(_('Notice feed for %s group (RSS 1.0)'), + $this->group->nickname)), + new Feed(Feed::RSS2, + common_local_url('api', + array('apiaction' => 'groups', + 'method' => 'timeline', + 'argument' => $this->group->nickname.'.rss')), + sprintf(_('Notice feed for %s group (RSS 2.0)'), + $this->group->nickname)), + new Feed(Feed::ATOM, + common_local_url('api', + array('apiaction' => 'groups', + 'method' => 'timeline', + 'argument' => $this->group->nickname.'.atom')), + sprintf(_('Notice feed for %s group (Atom)'), + $this->group->nickname))); } /** @@ -331,6 +358,7 @@ class ShowgroupAction extends GroupDesignAction { $this->showMembers(); $this->showStatistics(); + $this->showAdmins(); $cloud = new GroupTagCloudSection($this, $this->group); $cloud->show(); } @@ -369,6 +397,18 @@ class ShowgroupAction extends GroupDesignAction $this->elementEnd('div'); } + /** + * Show list of admins + * + * @return void + */ + + function showAdmins() + { + $adminSection = new GroupAdminSection($this, $this->group); + $adminSection->show(); + } + /** * Show some statistics * @@ -408,13 +448,13 @@ class ShowgroupAction extends GroupDesignAction { if (!(common_config('site','closed') || common_config('site','inviteonly'))) { $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . - 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' . + 'based on the Free Software [StatusNet](http://status.net/) tool. Its members share ' . '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); } else { $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . - 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' . + 'based on the Free Software [StatusNet](http://status.net/) tool. Its members share ' . 'short messages about their life and interests. '), $this->group->nickname); } @@ -423,3 +463,34 @@ class ShowgroupAction extends GroupDesignAction $this->elementEnd('div'); } } + +class GroupAdminSection extends ProfileSection +{ + var $group; + + function __construct($out, $group) + { + parent::__construct($out); + $this->group = $group; + } + + function getProfiles() + { + return $this->group->getAdmins(); + } + + function title() + { + return _('Admins'); + } + + function divId() + { + return 'group_admins'; + } + + function moreUrl() + { + return null; + } +}