X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fuserrss.php;h=2280509b22942c372be42745684cfbbe9b292c4b;hb=b4e649fe906a793cd5e62d6390065ea5d41c40db;hp=04855cccaded30a05ac67a0789647aae8b7e882f;hpb=d06a929d703e0ad776230234b3d821a83f22d492;p=quix0rs-gnu-social.git diff --git a/actions/userrss.php b/actions/userrss.php index 04855cccad..2280509b22 100644 --- a/actions/userrss.php +++ b/actions/userrss.php @@ -25,14 +25,15 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); class UserrssAction extends Rss10Action { - var $user = null; + var $tag = null; function prepare($args) { parent::prepare($args); - $nickname = $this->trimmed('nickname'); + $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); + $this->tag = $this->trimmed('tag'); if (!$this->user) { $this->clientError(_('No such user.')); @@ -42,17 +43,37 @@ class UserrssAction extends Rss10Action } } + function getTaggedNotices($tag = null, $limit=0) + { + $user = $this->user; + + if (is_null($user)) { + return null; + } + + $notice = $user->getTaggedNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit, 0, 0, null, $tag); + + $notices = array(); + while ($notice->fetch()) { + $notices[] = clone($notice); + } + + return $notices; + } + + function getNotices($limit=0) { $user = $this->user; - + if (is_null($user)) { return null; } - + $notice = $user->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit); - + + $notices = array(); while ($notice->fetch()) { $notices[] = clone($notice); } @@ -87,17 +108,16 @@ class UserrssAction extends Rss10Action } # override parent to add X-SUP-ID URL - + function initRss($limit=0) { - $url = common_local_url('sup', null, $this->user->id); + $url = common_local_url('sup', null, null, $this->user->id); header('X-SUP-ID: '.$url); parent::initRss($limit); } - function isReadOnly() + function isReadOnly($args) { return true; } } -