';
@@ -227,21 +229,44 @@
else {
//echo "
Blog posts
";
if (isset($tagSearch)) {
- echo "";
+ echo "
Archive for '$tagSearch' | ";
+ if (RSS_ENABLED) {
+ echo ' | ';
+ }
+ echo '
';
$pageTitle = "Archive for '$tagSearch'";
}
+ if (isset($CMS_RSS) && RSS_SHOW_FULL) {
+ $CMS_SINGLE_POST = true;
+ }
$i = 0;
$morePosts = false;
foreach($posts as $k=>$v) {
if ($v->isPublic) {
if (!isset($tagSearch) || in_array($tagSearch, $v->tags)) {
if ($i++ >= $postsSkip) {
- //echo "
permalink\">$v->title by $v->author";
- echo '
';
- require $v->includeFile;
- renderFooter();
- echo "
";
- echo '
';
+ if (isset($CMS_RSS)) {
+ if (!isset($latestDisplayedPost)) {
+ $latestDisplayedPost = $v->ctime;
+ }
+ echo '
-
+ ' . $v->title . '
+ includeFile;
+ renderFooter();
+ echo ']]>
+ permalink . ']]>
+ permalink . ']]>
+ ' . date($RSS_DATE_FORMAT, $v->ctime) . '
+ ' . $v->author . '
+
';
+ } else {
+ echo '
';
+ require $v->includeFile;
+ renderFooter();
+ echo "
";
+ echo '
';
+ }
if (($i % POSTS_PAGE_SIZE) == 0) {
$morePosts = true;
break;
@@ -258,6 +283,7 @@
echo '
Newer posts >> | ';
if ($morePosts || $postsSkip > 0)
echo "";
- }
- echo "";
+ }
+ if (!isset($CMS_RSS))
+ echo "";
?>
diff --git a/img/rss.svg b/img/rss.svg
new file mode 100644
index 0000000..18ee398
--- /dev/null
+++ b/img/rss.svg
@@ -0,0 +1,30 @@
+
diff --git a/index.php b/index.php
index 0ddc347..53fb6b3 100644
--- a/index.php
+++ b/index.php
@@ -71,9 +71,14 @@
diff --git a/rss.php b/rss.php
new file mode 100644
index 0000000..c7819d0
--- /dev/null
+++ b/rss.php
@@ -0,0 +1,40 @@
+
+
+
+
+ ' . PAGE_NAME . $tagSearchTitle . '
+
+ ' . getServerUrl() . '
+ ' . date($RSS_DATE_FORMAT, $latestDisplayedPost) . '
+ ' . date($RSS_DATE_FORMAT, $latestDisplayedPost) . '
+ ' . RSS_REFRESH_INTERVAL . '
+
+ ' . $output;
+ return $output;
+ });
+
+ require "blog.php";
+ echo '';
+ }
+?>
diff --git a/shared.php b/shared.php
index 1e7fa56..cf32611 100644
--- a/shared.php
+++ b/shared.php
@@ -11,6 +11,10 @@
define('POSTS_DIR_SEP', "."); // Directory separator (/) in post names
define('POSTS_MAX_FILENAME', 30); // Maximum length of a post name (including suffix)
define('POSTS_TAG_SEARCH', 30); // Maximum length for the tag search argument
+
+ define('RSS_ENABLED', true); // Enable the RSS news feed
+ define('RSS_REFRESH_INTERVAL', 14400); // Advertised update interval for the RSS feed
+ define('RSS_SHOW_FULL', false); // Show extended section in RSS feed
$menuItems = array(
array("label" => "Page A", "link" => "?p=00-template", "highlight" => "related-subpages,00-template"),
@@ -135,4 +139,10 @@
return $counters['sources']++;
}
}
+
+ function getServerUrl() {
+ $temp = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
+ $temp .= $_SERVER['HTTP_HOST'];
+ return $temp;
+ }
?>