Fix bug causing no date in RSS posts

master
Markus Koch 2017-09-30 16:09:46 +02:00
parent 22a71573fb
commit 61b7ba3195
3 changed files with 6 additions and 4 deletions

View File

@ -266,7 +266,7 @@
echo ']]></description>
<link><![CDATA[' . $v->permalink . ']]></link>
<guid isPermaLink="true"><![CDATA[' . $v->permalink . ']]></guid>
<pubDate>' . date($RSS_DATE_FORMAT, $v->ctime) . '</pubDate>
<pubDate>' . date(RSS_DATE_FORMAT, $v->ctime) . '</pubDate>
<dc:creator>' . $v->author . '</dc:creator>
</item>';
} else {

View File

@ -10,7 +10,7 @@
ob_start(function($output) {
global $tagSearch;
global $latestDisplayedPost;
$RSS_DATE_FORMAT = "D, d M Y H:i:s O";
if (!isset($latestDisplayedPost)) {
$latestDisplayedPost = time();
}
@ -26,8 +26,8 @@
<title>' . PAGE_NAME . $tagSearchTitle . '</title>
<description><![CDATA[' . "Blog of " . PAGE_AUTHOR . $tagSearchTitle . ']]></description>
<link>' . getServerUrl() . '</link>
<lastBuildDate>' . date($RSS_DATE_FORMAT, $latestDisplayedPost) . '</lastBuildDate>
<pubDate>' . date($RSS_DATE_FORMAT, $latestDisplayedPost) . '</pubDate>
<lastBuildDate>' . date(RSS_DATE_FORMAT, $latestDisplayedPost) . '</lastBuildDate>
<pubDate>' . date(RSS_DATE_FORMAT, $latestDisplayedPost) . '</pubDate>
<ttl>' . RSS_REFRESH_INTERVAL . '</ttl>
<atom:link href="' . getServerUrl() . "/rss.php" . '" rel="self" type="application/rss+xml" />
' . $output;

View File

@ -17,6 +17,8 @@
define('RSS_REFRESH_INTERVAL', 14400); // Advertised update interval for the RSS feed
define('RSS_SHOW_FULL', false); // Show extended section in RSS feed
define('RSS_DATE_FORMAT', 'D, d M Y H:i:s O');
$menuItems = array(
array("label" => "Page A", "link" => "?p=00-template", "highlight" => "related-subpages,00-template"),
array("label" => "Page B", "link" => "?p=404", "highlight" => "404"),