[pLog-svn] r2535 - in plog/branches/plog-1.0.2: class/locale
templates/rss
oscar at devel.plogworld.net
oscar at devel.plogworld.net
Thu Oct 27 22:06:39 GMT 2005
Author: oscar
Date: 2005-10-27 22:06:38 +0000 (Thu, 27 Oct 2005)
New Revision: 2535
Modified:
plog/branches/plog-1.0.2/class/locale/locale.class.php
plog/branches/plog-1.0.2/templates/rss/rss20.template
Log:
fixed mantis 722 (http://bugs.plogworld.net/view.php?id=722)
Modified: plog/branches/plog-1.0.2/class/locale/locale.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/locale/locale.class.php 2005-10-23 15:40:29 UTC (rev 2534)
+++ plog/branches/plog-1.0.2/class/locale/locale.class.php 2005-10-27 22:06:38 UTC (rev 2535)
@@ -695,6 +695,20 @@
return $text;
}
+
+ /**
+ * Formats a date as an RFC 822 date timestamp.
+ * @see formatDate
+ */
+ function formatDateAsRFC822( $timestamp, $blog = null )
+ {
+ $locale = $this->getLocaleCode();
+ $this->setLocale( "en_UK" );
+ $rfc822Date = $this->formatDate( $timestamp, "%a, %d %b %Y %H:%M:%S %O", $blog );
+ $this->setLocale( $locale );
+
+ return( $rfc822Date );
+ }
/**
* merges two locales
Modified: plog/branches/plog-1.0.2/templates/rss/rss20.template
===================================================================
--- plog/branches/plog-1.0.2/templates/rss/rss20.template 2005-10-23 15:40:29 UTC (rev 2534)
+++ plog/branches/plog-1.0.2/templates/rss/rss20.template 2005-10-27 22:06:38 UTC (rev 2535)
@@ -4,12 +4,11 @@
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
-{$locale->setLocale("en_UK")}
<channel>
<title>{$blog->getBlog()|escape}</title>
<link>{$url->blogLink()}</link>
<description>{$blog->getAbout()|escape}</description>
- <pubDate>{$locale->formatDate($now, "%a, %d %b %Y %H:%M:%S %O")}</pubDate>
+ <pubDate>{$locale->formatDateAsRFC822($now)}</pubDate>
<generator>http://www.plogworld.net</generator>
{foreach from=$posts item=post}
<item>
@@ -26,7 +25,7 @@
<category>{$category->getName()|escape}</category>
{/foreach}
{assign var="postDate" value=$post->getDateObject()}
- <pubDate>{$locale->formatDate($postDate, "%a, %d %b %Y %H:%M:%S %O", $blog)}</pubDate>
+ <pubDate>{$locale->formatDateAsRFC822($postDate, $blog)}</pubDate>
<source url="{$url->rssLink("rss20")}">{$blog->getBlog()|escape}</source>
{foreach from=$post->getArticleResources() item=resource}
{** please uncomment the line below if you'd like to server everything but images, instead of
@@ -39,5 +38,4 @@
</item>
{/foreach}
</channel>
-</rss>
-
+</rss>
\ No newline at end of file
More information about the pLog-svn
mailing list