Unify rss template
Unify rss template

--- a/include/display.git_rss.php
+++ b/include/display.git_rss.php
@@ -24,8 +24,8 @@
 	$tpl->clear_all_assign();
 	$tpl->assign("self",script_url());
 	$tpl->assign("project",$project);
-	$tpl->display("rss_header.tpl");
 
+	$commitlines = array();
 	for ($i = 0; $i <= count($revlist); $i++) {
 		$commit = $revlist[$i];
 		$co = git_read_commit($projectroot . $project, $commit);
@@ -40,24 +40,21 @@
 				$difftree[] = $regs[7];
 			$tok = strtok("\n");
 		}
-		$tpl->clear_all_assign();
-		$tpl->assign("cdmday",$cd['mday']);
-		$tpl->assign("cdmonth",$cd['month']);
-		$tpl->assign("cdhour",$cd['hour']);
-		$tpl->assign("cdminute",$cd['minute']);
-		$tpl->assign("title",htmlentities($co['title']));
-		$tpl->assign("author",htmlentities($co['author']));
-		$tpl->assign("cdrfc2822",$cd['rfc2822']);
-		$tpl->assign("self",script_url());
-		$tpl->assign("project",$project);
-		$tpl->assign("commit",$commit);
-		$tpl->assign("comment",$co['comment']);
-		$tpl->assign("difftree",$difftree);
-		$tpl->display("rss_item.tpl");
+		$commitline = array();
+		$commitline["cdmday"] = $cd['mday'];
+		$commitline["cdmonth"] = $cd['month'];
+		$commitline["cdhour"] = $cd['hour'];
+		$commitline["cdminute"] = $cd['minute'];
+		$commitline["title"] = $co['title'];
+		$commitline["author"] = $co['author'];
+		$commitline["cdrfc2822"] = $cd['rfc2822'];
+		$commitline["commit"] = $commit;
+		$commitline["comment"] = $co['comment'];
+		$commitline["difftree"] = $difftree;
+		$commitlines[] = $commitline;
 	}
-
-	$tpl->clear_all_assign();
-	$tpl->display("rss_footer.tpl");
+	$tpl->assign("commitlines",$commitlines);
+	$tpl->display("rss.tpl");
 }
 
 ?>

file:b/templates/rss.tpl (new)
--- /dev/null
+++ b/templates/rss.tpl
@@ -1,1 +1,39 @@
+{*
+ *  rss.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: RSS header template
+ *
+ *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
+ *}
+<?xml version="1.0" encoding="utf-8"?>
+<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
+  <channel>
+    <title>{$project}</title>
+    <link>{$self}?p={$project}&amp;a=summary</link>
+    <description>{$project} log</description>
+    <language>en</language>
 
+    {section name=rssitem loop=$commitlines}
+      <item>
+        <title>{$commitlines[rssitem].cdmday} {$commitlines[rssitem].cdmonth} {$commitlines[rssitem].cdhour}:{$commitlines[rssitem].cdminute} - {$commitlines[rssitem].title|escape:'htmlall'}</title>
+        <author>{$commitlines[rssitem].author|escape:'htmlall'}</author>
+        <pubDate>{$commitlines[rssitem].cdrfc2822}</pubDate>
+        <guid isPermaLink="true">{$self}?p={$project}&amp;a=commit&amp;h={$commitlines[rssitem].commit}</guid>
+        <link>{$self}?p={$project}&amp;a=commit&amp;h={$commitlines[rssitem].commit}</link>
+        <description>{$commitlines[rssitem].title|escape:'htmlall'}</description>
+        <content:encoded>
+          <![CDATA[
+          {foreach from=$commitlines[rssitem].comment item=line}
+            {$line}<br />
+          {/foreach}
+          {foreach from=$commitlines[rssitem].difftree item=line}
+            {$line}<br />
+          {/foreach}
+          ]]>
+        </content:encoded>
+      </item>
+    {/section}
+
+  </channel>
+</rss>
+

--- a/templates/rss_footer.tpl
+++ /dev/null
@@ -1,10 +1,1 @@
-{*
- *  rss_footer.tpl
- *  gitphp: A PHP git repository browser
- *  Component: RSS footer template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-</channel>
-</rss>
 

--- a/templates/rss_header.tpl
+++ /dev/null
@@ -1,15 +1,1 @@
-{*
- *  rss_header.tpl
- *  gitphp: A PHP git repository browser
- *  Component: RSS header template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-<?xml version="1.0" encoding="utf-8"?>
-<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
-<channel>
-<title>{$project}</title>
-<link>{$self}?p={$project}&amp;a=summary</link>
-<description>{$project} log</description>
-<language>en</language>
 

file:a/templates/rss_item.tpl (deleted)
--- a/templates/rss_item.tpl
+++ /dev/null
@@ -1,26 +1,1 @@
-{*
- *  rss_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: RSS item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-<item>
-<title>{$cdmday} {$cdmonth} {$cdhour}:{$cdminute} - {$title}</title>
-<author>{$author}</author>
-<pubDate>{$cdrfc2822}</pubDate>
-<guid isPermaLink="true">{$self}?p={$project}&amp;a=commit&amp;h={$commit}</guid>
-<link>{$self}?p={$project}&amp;a=commit&amp;h={$commit}</link>
-<description>{$title}</description>
-<content:encoded>
-<![CDATA[
-{foreach from=$comment item=line}
-{$line}<br />
-{/foreach}
-{foreach from=$difftree item=line}
-{$line}<br />
-{/foreach}
-]]>
-</content:encoded>
-</item>
 

comments