[eluser]adamfairholm[/eluser]
Yes, here is the code generating the rss feed:
Code:
<?php
echo '<?xml version="1.0" encoding="utf-8"?>' . "
";
?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:c>
<channel>
<title><?php echo $feed_name; ?></title>
<link><?php echo $feed_url; ?></link>
<description><?php echo $page_description; ?></description>
<pubDate><?php echo rss_date_format($last_date);?></pubDate>
<lastBuildDate><?php echo rss_date_format($last_date);?></lastBuildDate>
<language><?php echo $page_language; ?></language>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<managingEditor><?php echo $creator_email; ?></managingEditor>
<dc:rights>Copyright <?php echo gmdate("Y", time()); ?></dc:rights>
<a>
<?php foreach($posts->result() as $entry): ?>
<item>
<title><?php echo xml_convert($entry->title); ?></title>
<link><?php echo $this->config->item('link_url').$type."/entry/".$entry->id ?></link>
<guid><?php echo $this->config->item('link_url').$type."/entry/".$entry->id ?></guid>
<description><![CDATA[
<?=$entry->body;?>
]]></description>
<pubDate><?=rss_date_format($entry->created_on)?></pubDate>
</item>
<?php endforeach; ?>
</channel></rss>
And here is the code generating the atom feed:
Code:
<?php
echo '<?xml version="1.0" encoding="utf-8"?>' . "
";
?>
<feed >
<title><?=$feed_name;?></title>
<subtitle><?=$page_description;?></subtitle>
<link href="http://www.ceosforcities.org/<?=$type;?>" rel="self"/>
<link href="http://ceosforcities.org/"/>
<updated><?=atom_date($last_date);?></updated>
<a>
<name>CEOs For Cities</name>
<email><?=$creator_email;?></email>
</author>
<id><?php if($type=="blog"){ ?>tag:www-ceosforcities-org,2008:/conversations/blog//1<?php }else{?>tag:www-ceosforcities-org,2008:/<?=$type;?><?php } ?></id>
<?php foreach($posts->result() as $entry): ?>
<entry>
<title><?=$entry->title;?></title>
<link rel="alternate" type="text/html" href="<?php echo $this->config->item('link_url').$type."/entry/".$entry->id ?>" />
<link rel="service.edit" type="application/atom+xml" href="<?php echo $this->config->item('link_url').$type."/entry/".$entry->id ?>" title="<?=$entry->title;?>" />
<id><?php if($entry->entry_atom_id){ echo $entry->entry_atom_id;} else{?>tag:www.ceosforcities.org,<?=dashes($entry->created_on);?>:/<?=$type;?>/entry/<?=$entry->id;?><?php } ?></id>
<published><?=atom_date($entry->created_on);?></published>
<updated><?=atom_date($entry->created_on);?></updated>
<summary><![CDATA[<?=strip_tags(word_limiter($entry->body, 100));?>]]></summary>
<a>
<name>CEOs for Cities</name>
<uri>http://www.ceosforcities.org</uri>
</author>
<content type="html" xml:lang="en" xml:base="http://www.ceosforcities.org/conversations/blog/">
<![CDATA[<?=$entry->body;?>]]>
</content>
</entry>
<?php endforeach; ?>
</feed>
atom_date, rss_date_format, and dashes are just formatting a the date from a datetime stamp. The output validates, and you can see that in the Atom/RSS feed output I linked to above.
The atom feed is also designed to smoothly work with the old one, hence some maneuvering around to keep old atom ids.