[pLog-svn] r4727 - in plog/trunk/templates: rss summary/rss
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Tue Feb 13 07:34:34 EST 2007
Author: oscar
Date: 2007-02-13 07:34:34 -0500 (Tue, 13 Feb 2007)
New Revision: 4727
Modified:
plog/trunk/templates/rss/atom.template
plog/trunk/templates/rss/rss10.template
plog/trunk/templates/rss/rss20.template
plog/trunk/templates/summary/rss/atom.template
plog/trunk/templates/summary/rss/blogs_atom.template
plog/trunk/templates/summary/rss/blogs_rss10.template
plog/trunk/templates/summary/rss/blogs_rss20.template
plog/trunk/templates/summary/rss/rss10.template
plog/trunk/templates/summary/rss/rss20.template
Log:
Added support for GeoRSS (simplified version -- http://www.georss.org/simple.html) so that we can list location data in RSS and Atom feeds, which is really cool if you ask me :)
Modified: plog/trunk/templates/rss/atom.template
===================================================================
--- plog/trunk/templates/rss/atom.template 2007-02-13 11:53:39 UTC (rev 4726)
+++ plog/trunk/templates/rss/atom.template 2007-02-13 12:34:34 UTC (rev 4727)
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="{$locale->getCharset()}"?>
-<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="{$locale->getLanguageId()|lower}">
+<feed version="0.3" xmlns="http://purl.org/atom/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xml:lang="{$locale->getLanguageId()|lower}"
+ xmlns:georss="http://www.georss.org/georss"
+>
<title>{$blog->getBlog()|escape}</title>
<link rel="alternate" type="text/html" href="{$url->blogLink()}" />
{if $posts}
@@ -7,12 +11,12 @@
<modified>{$locale->formatDate($newestDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</modified>
{/if}
<tagline>{$blog->getAbout()|escape}</tagline>
-<generator url="http://www.lifetype.net/" version="1.0.2">LifeType</generator>
+<generator url="http://www.lifetype.net/" version="1.2">LifeType</generator>
{assign var="blogOwner" value=$blog->getOwnerInfo()}
<copyright>Copyright (c) {$blogOwner->getUsername()|escape}</copyright>
- {foreach from=$posts item=post}
- <entry>
- <id>{$url->getAtomUniqueId($post)}</id>
+{foreach from=$posts item=post}
+<entry>
+<id>{$url->getAtomUniqueId($post)}</id>
<title>{$post->getTopic()|escape}</title>
<link rel="alternate" type="text/html" href="{$url->postPermalink($post)}" />
{assign var="postDate" value=$post->getDateObject()}
@@ -21,19 +25,25 @@
<created>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</created>
<summary type="text/plain">{$post->getText()|strip_tags|truncate:200:" ..."|escape:"html"}</summary>
<author>
- {assign var="postOwner" value=$post->getUserInfo()}
- <name>{$postOwner->getUsername()|escape}</name>
- <url>{$url->blogLink()}</url>
- <email>{$postOwner->getEmail()}</email>
-</author>
-<dc:subject>
-{foreach from=$post->getCategories() item=category}
-{$category->getName()|escape}
-{/foreach}
-</dc:subject>
+ {assign var="postOwner" value=$post->getUserInfo()}
+ <name>{$postOwner->getUsername()|escape}</name>
+ <url>{$url->blogLink()}</url>
+ <email>{$postOwner->getEmail()}</email>
+ </author>
+ <dc:subject>
+ {foreach from=$post->getCategories() item=category}
+ {$category->getName()|escape}
+ {/foreach}
+ </dc:subject>
<content type="text/html" mode="escaped" xml:lang="{$locale->getLanguageId()|lower}" xml:base="{$url->blogLink()}">
- {$post->getText()|escape}
-</content>
+ {$post->getText()|escape}
+ </content>
+ {if $post->hasLocationData()}
+ {** article location **}
+ {assign var=postLocation value=$post->getLocation()}
+ <georss:point>{$postLocation->getLatitude()} {$postLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$postLocation->getDescription()}</georss:featurename>
+ {/if}
</entry>
{/foreach}
</feed>
Modified: plog/trunk/templates/rss/rss10.template
===================================================================
--- plog/trunk/templates/rss/rss10.template 2007-02-13 11:53:39 UTC (rev 4726)
+++ plog/trunk/templates/rss/rss10.template 2007-02-13 12:34:34 UTC (rev 4727)
@@ -6,6 +6,7 @@
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns="http://purl.org/rss/1.0/"
+ xmlns:georss="http://www.georss.org/georss"
>
<channel rdf:about="{$url->rssLink("rss10")}">
<title>{$blog->getBlog()|escape}</title>
@@ -22,6 +23,12 @@
{/foreach}
</rdf:Seq>
</items>
+ {if $blog->hasLocationData()}
+ {** blog location **}
+ {assign var=blogLocation value=$blog->getLocation()}
+ <georss:point>{$blogLocation->getLatitude()} {$blogLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$blogLocation->getDescription()}</georss:featurename>
+ {/if}
</channel>
{foreach from=$posts item=post}
<item rdf:about="{$url->postPermalink($post)}">
@@ -35,6 +42,12 @@
<dc:date>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S")}Z</dc:date>
{assign var="postOwner" value=$post->getUserInfo()}
<dc:creator>{$postOwner->getUsername()}</dc:creator>
+ {if $post->hasLocationData()}
+ {** article location **}
+ {assign var=postLocation value=$post->getLocation()}
+ <georss:point>{$postLocation->getLatitude()} {$postLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$postLocation->getDescription()}</georss:featurename>
+ {/if}
</item>
{/foreach}
</rdf:RDF>
Modified: plog/trunk/templates/rss/rss20.template
===================================================================
--- plog/trunk/templates/rss/rss20.template 2007-02-13 11:53:39 UTC (rev 4726)
+++ plog/trunk/templates/rss/rss20.template 2007-02-13 12:34:34 UTC (rev 4727)
@@ -3,6 +3,7 @@
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:georss="http://www.georss.org/georss"
>
<channel>
<title>{$blog->getBlog()|escape}</title>
@@ -10,6 +11,12 @@
<description>{$blog->getAbout()|escape}</description>
<pubDate>{$locale->formatDateAsRFC822($now)}</pubDate>
<generator>http://www.lifetype.net</generator>
+ {if $blog->hasLocationData()}
+ {** blog location **}
+ {assign var=blogLocation value=$blog->getLocation()}
+ <georss:point>{$blogLocation->getLatitude()} {$blogLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$blogLocation->getDescription()}</georss:featurename>
+ {/if}
{foreach from=$posts item=post}
<item>
<title>{$post->getTopic()|escape}</title>
@@ -27,6 +34,12 @@
{assign var="postDate" value=$post->getDateObject()}
<pubDate>{$locale->formatDateAsRFC822($postDate, $blog)}</pubDate>
<source url="{$url->rssLink("rss20")}">{$blog->getBlog()|escape}</source>
+ {if $post->hasLocationData()}
+ {** article location **}
+ {assign var=postLocation value=$post->getLocation()}
+ <georss:point>{$postLocation->getLatitude()} {$postLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$postLocation->getDescription()}</georss:featurename>
+ {/if}
{foreach from=$post->getArticleResources() item=resource}
{** please uncomment the line below if you'd like to server everything but images, instead of
only audio and video **}
Modified: plog/trunk/templates/summary/rss/atom.template
===================================================================
--- plog/trunk/templates/summary/rss/atom.template 2007-02-13 11:53:39 UTC (rev 4726)
+++ plog/trunk/templates/summary/rss/atom.template 2007-02-13 12:34:34 UTC (rev 4727)
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="{$locale->getCharset()}"?>
-<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="{$locale->getLanguageId()|lower}">
+<feed version="0.3" xmlns="http://purl.org/atom/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xml:lang="{$locale->getLanguageId()|lower}"
+ xmlns:georss="http://www.georss.org/georss"
+>
<title>{$serviceName}</title>
<link rel="alternate" type="text/html" href="{$url->blogLink()}" />
{assign var="newestDate" value=$posts[0]->getDateObject()}
@@ -32,6 +36,12 @@
<content type="text/html" mode="escaped" xml:lang="{$locale->getLanguageId()|lower}" xml:base="{$url->blogLink()}">
{$post->getText()|escape}
</content>
+{if $post->hasLocationData()}
+ {** article location **}
+ {assign var=postLocation value=$post->getLocation()}
+ <georss:point>{$postLocation->getLatitude()} {$postLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$postLocation->getDescription()}</georss:featurename>
+{/if}
</entry>
{/foreach}
</feed>
\ No newline at end of file
Modified: plog/trunk/templates/summary/rss/blogs_atom.template
===================================================================
--- plog/trunk/templates/summary/rss/blogs_atom.template 2007-02-13 11:53:39 UTC (rev 4726)
+++ plog/trunk/templates/summary/rss/blogs_atom.template 2007-02-13 12:34:34 UTC (rev 4727)
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="{$locale->getCharset()}"?>
-<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="{$locale->getLanguageId()|lower}">
+<feed version="0.3" xmlns="http://purl.org/atom/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xml:lang="{$locale->getLanguageId()|lower}"
+ xmlns:georss="http://www.georss.org/georss"
+>
<title>{$serviceName}</title>
<generator url="http://www.lifetype.net/" version="1.0.2">LifeType</generator>
<copyright>Copyright (c) Your copyright notice</copyright>
@@ -25,6 +29,12 @@
<content type="text/html" mode="escaped" xml:lang="{$blogLocale->getLanguageId()|lower}" xml:base="{$url->blogLink()}">
{$blog->getAbout()|escape}
</content>
+{if $blog->hasLocationData()}
+ {** blog location **}
+ {assign var=blogLocation value=$blog->getLocation()}
+ <georss:point>{$blogLocation->getLatitude()} {$blogLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$blogLocation->getDescription()}</georss:featurename>
+ {/if}
</entry>
{/foreach}
</feed>
\ No newline at end of file
Modified: plog/trunk/templates/summary/rss/blogs_rss10.template
===================================================================
--- plog/trunk/templates/summary/rss/blogs_rss10.template 2007-02-13 11:53:39 UTC (rev 4726)
+++ plog/trunk/templates/summary/rss/blogs_rss10.template 2007-02-13 12:34:34 UTC (rev 4727)
@@ -4,6 +4,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:georss="http://www.georss.org/georss"
>
<channel rdf:about="{$url->getRssUrl()}?summary=1&profile=rss10&type={$type}">
<title>{$serviceName}</title>
@@ -21,6 +22,12 @@
<dc:date>{$locale->formatDate($blogDate, "%Y-%m-%d %H:%M:%S")}</dc:date>
{assign var="blogOwner" value=$blog->getOwnerInfo()}
<dc:creator>{$blogOwner->getUsername()}</dc:creator>
+ {if $blog->hasLocationData()}
+ {** blog location **}
+ {assign var=blogLocation value=$blog->getLocation()}
+ <georss:point>{$blogLocation->getLatitude()} {$blogLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$blogLocation->getDescription()}</georss:featurename>
+ {/if}
</item>
{/foreach}
</rdf:RDF>
Modified: plog/trunk/templates/summary/rss/blogs_rss20.template
===================================================================
--- plog/trunk/templates/summary/rss/blogs_rss20.template 2007-02-13 11:53:39 UTC (rev 4726)
+++ plog/trunk/templates/summary/rss/blogs_rss20.template 2007-02-13 12:34:34 UTC (rev 4727)
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="{$locale->getCharset()}"?>
<?xml-stylesheet href="{$url->getUrl("/styles/rss.css")}" type="text/css"?>
-<rss version="2.0">
+<rss version="2.0"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:georss="http://www.georss.org/georss"
+>
<channel>
<title>{$serviceName}</title>
<description>Your service description</description>
@@ -16,6 +20,12 @@
{assign var="blogOwner" value=$blog->getOwnerInfo()}
<author>{$blogOwner->getUsername()}</author>
<source url="{$url->rssLink("rss20")}">{$blog->getBlog()|escape}</source>
+ {if $blog->hasLocationData()}
+ {** bog location **}
+ {assign var=blogLocation value=$blog->getLocation()}
+ <georss:point>{$blogLocation->getLatitude()} {$blogLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$blogLocation->getDescription()}</georss:featurename>
+ {/if}
</item>
{/foreach}
</channel>
Modified: plog/trunk/templates/summary/rss/rss10.template
===================================================================
--- plog/trunk/templates/summary/rss/rss10.template 2007-02-13 11:53:39 UTC (rev 4726)
+++ plog/trunk/templates/summary/rss/rss10.template 2007-02-13 12:34:34 UTC (rev 4727)
@@ -4,6 +4,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:georss="http://www.georss.org/georss"
>
<channel rdf:about="{$url->getRssUrl()}?summary=1&profile=rss10">
<title>{$serviceName}</title>
@@ -22,6 +23,12 @@
<dc:date>{$locale->formatDate($postDate, "%Y-%m-%d %H:%M:%S")}</dc:date>
{assign var="postOwner" value=$post->getUserInfo()}
<dc:creator>{$postOwner->getUsername()}</dc:creator>
+ {if $post->hasLocationData()}
+ {** article location **}
+ {assign var=postLocation value=$post->getLocation()}
+ <georss:point>{$postLocation->getLatitude()} {$postLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$postLocation->getDescription()}</georss:featurename>
+ {/if}
</item>
{/foreach}
</rdf:RDF>
Modified: plog/trunk/templates/summary/rss/rss20.template
===================================================================
--- plog/trunk/templates/summary/rss/rss20.template 2007-02-13 11:53:39 UTC (rev 4726)
+++ plog/trunk/templates/summary/rss/rss20.template 2007-02-13 12:34:34 UTC (rev 4727)
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="{$locale->getCharset()}"?>
<?xml-stylesheet href="{$url->getUrl("/styles/rss.css")}" type="text/css"?>
-<rss version="2.0">
+<rss version="2.0"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:georss="http://www.georss.org/georss"
+>
<channel>
<title>{$serviceName}</title>
<description>Your service description</description>
@@ -23,6 +27,12 @@
{/foreach}
</category>
<source url="{$url->rssLink("rss20")}">{$blog->getBlog()|escape}</source>
+ {if $post->hasLocationData()}
+ {** article location **}
+ {assign var=postLocation value=$post->getLocation()}
+ <georss:point>{$postLocation->getLatitude()} {$postLocation->getLongitude()}</georss:point>
+ <georss:featurename>{$postLocation->getDescription()}</georss:featurename>
+ {/if}
</item>
{/foreach}
</channel>
More information about the pLog-svn
mailing list