summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-07-17 23:08:19 -0400
committerCraig Andrews <candrews@integralblue.com>2009-07-17 23:08:19 -0400
commit8e7a8450d3e51533d6057b3110e4372cd13153fe (patch)
tree62105008267903b94c3ae5eada838465a1c5d9f9
parent441c276859ff5d969d9b3a09b550f682b41088ac (diff)
Make RSS 1.0 more efficient when the same hashtag is used in multiple notices.
Thanks tobyink
-rw-r--r--lib/rssaction.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/rssaction.php b/lib/rssaction.php
index 76d0db224..901558943 100644
--- a/lib/rssaction.php
+++ b/lib/rssaction.php
@@ -39,6 +39,7 @@ class Rss10Action extends Action
var $creators = array();
var $limit = DEFAULT_RSS_LIMIT;
var $notices = null;
+ var $tags_already_output = array();
/**
* Constructor
@@ -273,6 +274,12 @@ class Rss10Action extends Action
foreach ($tags as $tag)
{
$tagpage = common_local_url('tag', array('tag' => $tag));
+
+ if ( in_array($tag, $this->tags_already_output) ) {
+ $this->element('ctag:tagged', array('rdf:resource'=>$tagpage.'#concept'));
+ continue;
+ }
+
$tagrss = common_local_url('tagrss', array('tag' => $tag));
$this->elementStart('ctag:tagged');
$this->elementStart('ctag:Tag', array('rdf:about'=>$tagpage.'#concept', 'ctag:label'=>$tag));
@@ -280,6 +287,8 @@ class Rss10Action extends Action
$this->element('rdfs:seeAlso', array('rdf:resource'=>$tagrss));
$this->elementEnd('ctag:Tag');
$this->elementEnd('ctag:tagged');
+
+ $this->tags_already_output[] = $tag;
}
}
$this->elementEnd('item');