From f9e9d0dbbee9a625b958a7f5ee4ba9c2dcf08a21 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sun, 7 Apr 2013 13:04:19 +0200 Subject: [PATCH] fix & optim autoblogs: broken RSS feed :-> working ATOM feed index: index added to sitemap --- 0.3/autoblog.php | 50 ++++++++++++++++++++++++----------------------- 0.3/functions.php | 4 ++-- 0.3/index.php | 25 +++++++++++++----------- 3 files changed, 42 insertions(+), 37 deletions(-) diff --git a/0.3/autoblog.php b/0.3/autoblog.php index b8b35ed..c7e67db 100755 --- a/0.3/autoblog.php +++ b/0.3/autoblog.php @@ -557,36 +557,38 @@ $site_type = escape($config->site_type); if (isset($_GET['feed'])) // FEED { - header('Content-Type: application/xhtml+xml; charset=utf-8'); + header('Content-Type: application/atom+xml; charset=UTF-8'); echo ' - - - '.escape($config->site_title).' - '.escape($config->site_url).' - '.escape(html_entity_decode(strip_tags($config->site_description), ENT_COMPAT, 'UTF-8')).' - - '; + + '.escape($config->site_title).' + '.escape(html_entity_decode(strip_tags($config->site_description), ENT_COMPAT, 'UTF-8')).' + '.date(DATE_ATOM, filemtime(ARTICLES_DB_FILE)).' + + '.LOCAL_URL.' + + Projet Autoblog'; foreach($vvb->listLastArticles() as $art) { echo ' - - '.escape($art['title']).' - '.escape($art['feed_id']).' - '.$vvb->getLocalURL($art).' - '.date(DATE_RSS, $art['date']).' - - - - - - - '; + + + '.escape($config->site_title).' + '.escape($config->site_url).' + + <![CDATA['.escape($art['title']).']]> + + '.str_replace('?feed', '?', LOCAL_URL).urlencode(str_replace('./?', '', $vvb->getLocalURL($art))).' + '.date(DATE_ATOM, $art['date']).' + + + source)
'.escape_content($art['content']).']]> +
+
'; } echo ' -
-
'; + '; exit; } @@ -713,7 +715,7 @@ echo ' '.escape($config->site_title).' - + @@ -826,7 +828,7 @@ else echo '