123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- require_once INSTALLDIR.'/lib/rssaction.php';
- class BookmarksrssAction 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 = new BookmarksNoticeStream($this->user->id, true);
- $notice = $notice->getNotices(0, NOTICES_PER_PAGE);
- $notices = array();
- while ($notice->fetch()) {
- $notices[] = clone($notice);
- }
- return $notices;
- }
-
- function getChannel()
- {
- $user = $this->user;
- $c = array('url' => common_local_url('bookmarksrss',
- array('nickname' =>
- $user->nickname)),
-
-
- 'title' => sprintf(_("%s's bookmarks"), $user->nickname),
- 'link' => common_local_url('bookmarks',
- array('nickname' =>
- $user->nickname)),
-
-
- 'description' => sprintf(_('Bookmarks posted by %1$s on %2$s!'),
- $user->nickname, common_config('site', 'name')));
- return $c;
- }
-
- function getImage()
- {
- return null;
- }
- }
|