123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- define('MEMBERS_PER_SECTION', 27);
- class GroupRssAction extends TargetedRss10Action
- {
-
- protected $group = null;
-
- function isReadOnly($args)
- {
- return true;
- }
- protected function doStreamPreparation()
- {
- $nickname_arg = $this->arg('nickname');
- $nickname = common_canonical_nickname($nickname_arg);
-
- if ($nickname_arg != $nickname) {
- $args = array('nickname' => $nickname);
- common_redirect(common_local_url('showgroup', $args), 301);
- }
- if (!$nickname) {
-
- $this->clientError(_('No nickname.'), 404);
- }
- $local = Local_group::getKV('nickname', $nickname);
- if (!$local instanceof Local_group) {
-
- $this->clientError(_('No such group.'), 404);
- }
- $this->group = $local->getGroup();
- $this->target = $this->group->getProfile();
- }
- protected function getNotices()
- {
- $stream = $this->group->getNotices(0, $this->limit);
- return $stream->fetchAll();
- }
- function getChannel()
- {
- $c = array('url' => common_local_url('grouprss',
- array('nickname' =>
- $this->target->getNickname())),
-
- 'title' => sprintf(_('%s timeline'), $this->target->getNickname()),
- 'link' => common_local_url('showgroup', array('nickname' => $this->target->getNickname())),
-
- 'description' => sprintf(_('Updates from members of %1$s on %2$s!'),
- $this->target->getNickname(), common_config('site', 'name')));
- return $c;
- }
- function getImage()
- {
- return $this->group->homepage_logo;
- }
- }
|