X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshowgroup.php;h=4e1fcb6c7b1cb86b253870a3d50c1fb998054ea6;hb=88ae7f53bb4470a899678d231cecb8cb963b2075;hp=ff994976215263447b6151d5f65b131873c1039f;hpb=db9bc253cb3da1af41894f073e8aeebc265c876b;p=quix0rs-gnu-social.git diff --git a/actions/showgroup.php b/actions/showgroup.php index ff99497621..4e1fcb6c7b 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -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,13 +118,13 @@ 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); + $local = Local_group::staticGet('nickname', $nickname); - if (!$this->group) { + if (!$local) { $alias = Group_alias::staticGet('alias', $nickname); if ($alias) { $args = array('id' => $alias->group_id); @@ -139,11 +134,19 @@ class ShowgroupAction extends GroupDesignAction common_redirect(common_local_url('groupbyid', $args), 301); return false; } else { - $this->clientError(_('No such group'), 404); + common_log(LOG_NOTICE, "Couldn't find local group for nickname '$nickname'"); + $this->clientError(_('No such group.'), 404); return false; } } + $this->group = User_group::staticGet('id', $local->group_id); + + if (!$this->group) { + $this->clientError(_('No such group.'), 404); + return false; + } + common_set_returnto($this->selfUrl()); return true; @@ -333,19 +336,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->id)), 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->id)), 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))); } /**