forked from GNUsocial/gnu-social
trac #1142 fix tag rss
This commit is contained in:
parent
7ea136ee1b
commit
9febe8ce39
@ -25,12 +25,12 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
|
|||||||
|
|
||||||
class TagrssAction extends Rss10Action
|
class TagrssAction extends Rss10Action
|
||||||
{
|
{
|
||||||
|
var $tag;
|
||||||
|
|
||||||
function init()
|
function prepare($args) {
|
||||||
{
|
parent::prepare($args);
|
||||||
$tag = $this->trimmed('tag');
|
$tag = common_canonical_tag($this->trimmed('tag'));
|
||||||
$this->tag = Notice_tag::staticGet('tag', $tag);
|
$this->tag = Notice_tag::staticGet('tag', $tag);
|
||||||
|
|
||||||
if (!$this->tag) {
|
if (!$this->tag) {
|
||||||
$this->clientError(_('No such tag.'));
|
$this->clientError(_('No such tag.'));
|
||||||
return false;
|
return false;
|
||||||
@ -39,7 +39,7 @@ class TagrssAction extends Rss10Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_notices($limit=0)
|
function getNotices($limit=0)
|
||||||
{
|
{
|
||||||
$tag = $this->tag;
|
$tag = $this->tag;
|
||||||
|
|
||||||
@ -48,7 +48,6 @@ class TagrssAction extends Rss10Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
$notice = Notice_tag::getStream($tag->tag, 0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
|
$notice = Notice_tag::getStream($tag->tag, 0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
|
||||||
|
|
||||||
while ($notice->fetch()) {
|
while ($notice->fetch()) {
|
||||||
$notices[] = clone($notice);
|
$notices[] = clone($notice);
|
||||||
}
|
}
|
||||||
@ -56,10 +55,9 @@ class TagrssAction extends Rss10Action
|
|||||||
return $notices;
|
return $notices;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_channel()
|
function getChannel()
|
||||||
{
|
{
|
||||||
$tag = $this->tag->tag;
|
$tagname = $this->tag->tag;
|
||||||
|
|
||||||
$c = array('url' => common_local_url('tagrss', array('tag' => $tagname)),
|
$c = array('url' => common_local_url('tagrss', array('tag' => $tagname)),
|
||||||
'title' => $tagname,
|
'title' => $tagname,
|
||||||
'link' => common_local_url('tagrss', array('tag' => $tagname)),
|
'link' => common_local_url('tagrss', array('tag' => $tagname)),
|
||||||
|
@ -736,6 +736,8 @@ function common_fancy_url($action, $args=null)
|
|||||||
return common_path("api/statuses/public_timeline.atom");
|
return common_path("api/statuses/public_timeline.atom");
|
||||||
case 'publicxrds':
|
case 'publicxrds':
|
||||||
return common_path('xrds');
|
return common_path('xrds');
|
||||||
|
case 'tagrss':
|
||||||
|
return common_path('tag/' . $args['tag'] . '/rss');
|
||||||
case 'featuredrss':
|
case 'featuredrss':
|
||||||
return common_path('featuredrss');
|
return common_path('featuredrss');
|
||||||
case 'favoritedrss':
|
case 'favoritedrss':
|
||||||
|
Loading…
Reference in New Issue
Block a user