I managed to get 100% valid RSS with Pritlog!
There was an issue when using 'åäö' in <title> of RSS item.
Also was lacking <atom:link> and <guid></guid>.
Validator: http://feedvalidator.org/
This is my working fixed RSS function:
function createRSS() {
global $config, $separator, $entries, $optionValue, $lang;
$base = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'],0,-3);
echo header('Content-type: text/xml').'<?xml version="1.0" encoding="ISO-8859-1"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">';
echo '<channel><title>'.$config['blogTitle'].'</title><description>'.$config['metaDescription'].'</description>';
echo '<link>http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'],0,strlen($_SERVER['REQUEST_URI'])-7).'</link>';
echo '<atom:link href="'.$base.'RSS" rel="self" type="application/rss+xml" />';
$result = sqlite_query($config['db'], "select count(postid) AS view from posts WHERE type = 'post';");
while ($row = sqlite_fetch_array($result, SQLITE_ASSOC)) {
$totalEntries = $row['view'];
}
if($config['entriesOnRSS'] == 0)
{
$limit = $totalEntries;
}
else
{
$limit = $config['entriesOnRSS'];
}
$limit = ($limit > 200) ? 200 : $limit;
$result = sqlite_query($config['db'], "select * from posts ORDER BY postid DESC LIMIT $limit;");
while ($row = sqlite_fetch_array($result, SQLITE_ASSOC)) {
$rssTitle = $row['title'];
$rssTitleModified=titleModify($rssTitle);
$rssContent = explode("*readmore*",$row['content']);
if (trim($rssContent[1]) !== "") $readmore = '
'.$lang['pageViewFullPost'].'';
else $readmore = "";
$date1 = $row['date'];
$rssEntry = $row['postid'];
$rssCategory = $row['category'];
$postType = $row['type'];
$allowComments = $row['allowcomments'];
$visits = $row['visits'];
$link = $base.htmlspecialchars('posts/'.$rssEntry."/".$rssTitleModified);
if (trim($visits) == "") { $visits=0; }
if ($optionValue === $rssCategory || trim($optionValue) == "") {
echo '<item><link>'.$link.'</link>';
echo '<title>'.html_entity_decode($rssTitle).'</title><category>'.$rssCategory.'</category>';
echo '<description>'.htmlspecialchars(html_entity_decode($rssContent[0].$readmore)).'</description><guid>'.$link.'</guid></item>';
//echo '<description>'.htmlspecialchars($rssContent[0]).'
'.$lang['pageViewFullPost'].'</description></item>';
}
}
echo '</channel></rss>';
}