diff options
author | Robin Millette <millette@controlyourself.ca> | 2009-05-18 18:18:08 -0400 |
---|---|---|
committer | Robin Millette <millette@controlyourself.ca> | 2009-05-18 18:18:08 -0400 |
commit | f5606b6aa3868d777c6c697cf1bbc5348cb2ccc3 (patch) | |
tree | 39dc174a6e535412f21d166ac8e19b0c8dfb9bf5 /actions/userrss.php | |
parent | 57860b4d8a0ae201b32c9eb611ecdcb8e850a13a (diff) |
Added RSS for personal tags
Diffstat (limited to 'actions/userrss.php')
-rw-r--r-- | actions/userrss.php | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/actions/userrss.php b/actions/userrss.php index 5861d9ee3..2280509b2 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,6 +43,25 @@ 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) { |