rss feed

Post here is you are having problems with any of the tutorials.
Post Reply
Torniquet
Posts: 52
Joined: Sun Jun 19, 2011 8:10 am
Contact:

rss feed

Post 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>'; 
?>
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: rss feed

Post 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.
Image
Torniquet
Posts: 52
Joined: Sun Jun 19, 2011 8:10 am
Contact:

Re: rss feed

Post by Torniquet »

nope still same prob :(
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: rss feed

Post by jacek »

Does Chrome definitely have a feed reader :?
Image
Torniquet
Posts: 52
Joined: Sun Jun 19, 2011 8:10 am
Contact:

Re: rss feed

Post 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 :)
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: rss feed

Post 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 ;)
Image
Post Reply