3 * StatusNet, the distributed open-source microblogging tool
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * @author Evan Prodromou <evan@status.net>
25 * @author Sarven Capadisli <csarven@status.net>
26 * @copyright 2008-2009 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET') && !defined('LACONICA')) {
35 require_once INSTALLDIR.'/lib/rssaction.php';
37 define('MEMBERS_PER_SECTION', 27);
44 * @author Evan Prodromou <evan@status.net>
45 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
46 * @link http://status.net/
49 class groupRssAction extends Rss10Action
51 /** group we're viewing. */
55 * Is this page read-only?
57 * @return boolean true
60 function isReadOnly($args)
68 * Reads and validates arguments and instantiates the attributes.
70 * @param array $args $_REQUEST args
72 * @return boolean success flag
75 function prepare($args)
77 parent::prepare($args);
79 if (!common_config('inboxes','enabled')) {
80 $this->serverError(_('Inboxes must be enabled for groups to work'));
84 $nickname_arg = $this->arg('nickname');
85 $nickname = common_canonical_nickname($nickname_arg);
87 // Permanent redirect on non-canonical nickname
89 if ($nickname_arg != $nickname) {
90 $args = array('nickname' => $nickname);
91 common_redirect(common_local_url('showgroup', $args), 301);
96 $this->clientError(_('No nickname'), 404);
100 $this->group = User_group::staticGet('nickname', $nickname);
103 $this->clientError(_('No such group'), 404);
107 $this->notices = $this->getNotices($this->limit);
111 function getNotices($limit=0)
114 $group = $this->group;
116 if (is_null($group)) {
121 $notice = $group->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
123 while ($notice->fetch()) {
124 $notices[] = clone($notice);
130 function getChannel()
132 $group = $this->group;
133 $c = array('url' => common_local_url('grouprss',
136 'title' => sprintf(_('%s timeline'), $group->nickname),
137 'link' => common_local_url('showgroup', array('nickname' => $group->nickname)),
138 'description' => sprintf(_('Updates from members of %1$s on %2$s!'),
139 $group->nickname, common_config('site', 'name')));
145 return $this->group->homepage_logo;