Page 1 of 1

rss feed

Posted: Wed Jul 13, 2011 6:17 pm
by Torniquet
I have followed your steps for the rss feed, and it seems to be working fine in IE, FF and safari, but in Chrome its only showing raw xml.

You can see it here www.tapt-in.net/blog/rss.php

Here is the code
<?php

include("../config_file.php");
header('Content-Type: application/rss+xml');
$posts = b_get_posts();



echo '<?xml version="1.0" encoding="UTF-8" ?>', "\n";
echo '<rss version="2.0">', "\n"; 
echo '	<channel>', "\n"; 
echo '		<title>Tap\'t In Blog</title>', "\n";
echo '		<description>Tap\'t In PBBG social network Blog</description>', "\n";
echo '		<link>http://www.tapt-in.net/blog/</link>', "\n";
echo '		<lastBuildDate>',date("r"),'</lastBuildDate>', "\n";
foreach ($posts as $post)
{
echo '		<item>', "\n";
echo '			<title>',$post['title'],'</title>', "\n";
echo '			<description>',$post['preview'],'</description>', "\n";
echo '			<link>http://www.tapt-in.net/blog/read.php?id=',$post['id'],'</link>', "\n";
echo '			<pubDate>',date("r", $post['timestamp']),'</pubDate>', "\n";
echo '		</item>', "\n";
}
echo '	</channel>', "\n"; 
echo '</rss>'; 
?>

Re: rss feed

Posted: Wed Jul 13, 2011 9:46 pm
by jacek
Can you try adding a strip_tags() on anything that may have html tags in it ? The body may need to be plain text only.

Re: rss feed

Posted: Thu Jul 14, 2011 1:02 am
by Torniquet
nope still same prob :(

Re: rss feed

Posted: Thu Jul 14, 2011 12:06 pm
by jacek
Does Chrome definitely have a feed reader :?

Re: rss feed

Posted: Thu Jul 14, 2011 10:03 pm
by Torniquet
after looking into it, there is no mention of one no lol. plenty of people asking for one to be implemented a few yrs back. But i cant see any evidence of one said to have been put in lol.

oh well nothing wrong with the code then *phew*

Cheers Jacek :)

Re: rss feed

Posted: Thu Jul 14, 2011 11:46 pm
by jacek
Torniquet wrote:oh well nothing wrong with the code then *phew*
Also *phew* because I don't have to make another embarrassing update video ;)