1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
- require_once(INSTALLDIR.'/lib/rssaction.php');
- class RepliesrssAction extends Rss10Action
- {
- var $user = null;
- function prepare($args)
- {
- parent::prepare($args);
- $nickname = $this->trimmed('nickname');
- $this->user = User::getKV('nickname', $nickname);
- if (!$this->user) {
-
- $this->clientError(_('No such user.'));
- } else {
- $this->notices = $this->getNotices($this->limit);
- return true;
- }
- }
- function getNotices($limit=0)
- {
- $user = $this->user;
- $notice = $user->getReplies(0, ($limit == 0) ? 48 : $limit);
- $notices = array();
- while ($notice->fetch()) {
- $notices[] = clone($notice);
- }
- return $notices;
- }
- function getChannel()
- {
- $user = $this->user;
- $c = array('url' => common_local_url('repliesrss',
- array('nickname' =>
- $user->nickname)),
-
- 'title' => sprintf(_("Replies to %s"), $user->nickname),
- 'link' => common_local_url('replies',
- array('nickname' =>
- $user->nickname)),
-
-
- 'description' => sprintf(_('Replies to %1$s on %2$s.'),
- $user->nickname, common_config('site', 'name')));
- return $c;
- }
- function getImage()
- {
- $profile = $this->user->getProfile();
- return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
- }
- function isReadOnly($args)
- {
- return true;
- }
- }
|