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 | |
parent | 57860b4d8a0ae201b32c9eb611ecdcb8e850a13a (diff) |
Added RSS for personal tags
Diffstat (limited to 'actions')
-rw-r--r-- | actions/showstream.php | 9 | ||||
-rw-r--r-- | actions/userrss.php | 24 |
2 files changed, 31 insertions, 2 deletions
diff --git a/actions/showstream.php b/actions/showstream.php index 1654f589c..678a3174c 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -113,6 +113,15 @@ class ShowstreamAction extends ProfileAction function getFeeds() { + if (!empty($this->tag)) { + return array(new Feed(Feed::RSS1, + common_local_url('userrss', + array('nickname' => $this->user->nickname, + 'tag' => $this->tag)), + sprintf(_('Notice feed for %s tagged %s (RSS 1.0)'), + $this->user->nickname, $this->tag))); + } + return array(new Feed(Feed::RSS1, common_local_url('userrss', array('nickname' => $this->user->nickname)), 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) { |