X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshowgroup.php;h=8042a4951339a26f7aebaf4ad56f2e05de3a386b;hb=03e8ba144eadab6e28a96482a1162c4109eca822;hp=4d8ba5fa8da498497710fa1fc0866b573b62d1ed;hpb=2d29800b6f2f5e7581241dfa3e0a19fc5925049c;p=quix0rs-gnu-social.git diff --git a/actions/showgroup.php b/actions/showgroup.php index 4d8ba5fa8d..8042a49513 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 @@ -79,9 +79,9 @@ class ShowgroupAction extends GroupDesignAction } if ($this->page == 1) { - return sprintf(_("%s group"), $base); + return sprintf(_('%s group'), $base); } else { - return sprintf(_("%s group, page %d"), + return sprintf(_('%1$s group, page %2$d'), $base, $this->page); } @@ -101,11 +101,6 @@ class ShowgroupAction extends GroupDesignAction { parent::prepare($args); - if (!common_config('inboxes','enabled')) { - $this->serverError(_('Inboxes must be enabled for groups to work')); - return false; - } - $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; $nickname_arg = $this->arg('nickname'); @@ -123,15 +118,25 @@ class ShowgroupAction extends GroupDesignAction } if (!$nickname) { - $this->clientError(_('No nickname'), 404); + $this->clientError(_('No nickname.'), 404); return false; } $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()); @@ -323,19 +328,22 @@ class ShowgroupAction extends GroupDesignAction 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')), + common_local_url('ApiTimelineGroup', + array('format' => 'rss', + 'id' => $this->group->nickname)), 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')), + common_local_url('ApiTimelineGroup', + array('format' => 'atom', + 'id' => $this->group->nickname)), sprintf(_('Notice feed for %s group (Atom)'), - $this->group->nickname))); + $this->group->nickname)), + new Feed(Feed::FOAF, + common_local_url('foafgroup', + array('nickname' => $this->group->nickname)), + sprintf(_('FOAF for %s group'), + $this->group->nickname))); } /** @@ -438,14 +446,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.%s%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'), - $this->group->nickname, - (!common_config('site','openidonly')) ? 'register' : 'openidlogin'); + '[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); }