I'm having some troubles properly displaying the rss feed on my site. I've
installed PHP-Wrapper and installed the rss-template that was suggested in the
manual (adapted to my site).
Using Firefox, some details show up. Using IE nothing shows up at all. I've seen
some Campsite-sites with the same problem, but some others do have it working
properly. Can anyone help me?
Basicly, RSS in Campsite is still in domain of hacking it... Its not too
hard to implement but there are some issues with it. Im pasting You Pauls
and mine addon "solutions" for RSS. Below You will find Pauls solution for
it, mine is only simple tweaks if You like to use XSLT transformations
(which btw dont work in IE 7Beta, looks like IE is ignoring XML with XSLT
style in it, unlike Firefox which apply transformation...) This is basicly
solution for shorturls since in longurls you will have to use custom parser
to translate those & in urls which RSS dont like... And maby just adding
.htaccess with AddType directive for tpl files to be parsed as xml (AddType
text/xml .tpl) should do the trick also. But then again You should move RSS
templates to separate directory because that directive apply on whole
directory where .htaccess is created... I think You should get to it by
reading below answers...
Boban
Hi Paul,
had same problems with rss on our instances especialy because "pseudo
rss"(created only from tpl files) how i like to call it cannot be read in
Firefox feed reader(integrated). Looks like Firefox expect rss to be served
as XML file only. So, I came upto this... basicly, as for template there are
no big differences, only part where file header is set.
"); ?>
href=\
"); ?>
basicly the same, except you dont need to escape from wrapper, but You will
need to escape quotes as usualy in php, though I like the way You stripped
html tags, i had ugly solution with external php script called from cron via
lynx... You can wrap it in CDATA for description in RSS, but then XSL in
firefox will not return it correctly if I recall it right...
last, third line, is for XSL template (check out www.mediaonweb.org and
click on RSS link). So, as You can see, drawback is that we cannot get
RFC-822 date needed for RSS 2.0(yes you can hack it with adding not acurate
time and timezone).
----- Original Message -----
From: "Paul Baranowski"
To:
Sent: Wednesday, April 05, 2006 2:47 PM
Subject: [campsite-dev] Re: My hack to get RSS working
(this one is for mugur)
By the way, I didnt see a way to get the time for the publish date -
is there a way to do that? ( look in the code below for what I did for
the publish date)
On 4/5/06, Paul Baranowski wrote:
> I recently discovered the magic of RSS aggregators (tried out
> kaggregator on KDE), and realized that Campsite's RSS feed didnt work
> with it. Ok, no problem, i thought, cant be that hard to get it
> working...ahem.
>
> After several attempts, the following is the simplest I've been able
> to make it. Maybe someone knows a less hackier way to do this. If
> you know, please tell me, because I want to post some intructions in
> the manual.
>
> Summary:
> This hack is the result of trying to overcome three problems:
>
> 1) There doesnt seem like there is a way in campsite to display a
> specific template, except by creating an empty section and assigning
> the template to it.
> 2) There isnt a way in the template language to set the HTTP headers
> of a page. In this case we need to tell the browser that the
> "Content-type" is "text/xml".
> 3) PHP wrapper annoyances
>
> Step 1) Create your RSS feed. Create a template named "rss.tpl" that
> looks something like what written below. Notice that there is no
> at the top. This is on purpose, if you put it
> in there the PHP wrapper will think this is PHP code and try to
> execute it (point #3 above). When it tries to do this, it will crash.
> I've tested the RSS below using a web-based feed validator and it
> says it still checks out even without the XML tag. The PHP code at
> the beginning and end of the sample below is to overcome point #2
> above and also to strip out HTML from the new stories.
> -----------------------------------------------------------------------------------------------
>
> ob_start();
> ?>
>
> xmlns="http://purl.org/rss/1.0/"
> xmlns:dc="http://purl.org/dc/elements/1.1/">
>
>
> Campware News
> http://www.campware.org
> Free Software for a Free Press
> en-us
>
>
>
>
>
>
>
>
> desc>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> http://www.campware.org
>
> body>
>
> "%Y-%m-%d">T00:00:00+00:00
>
>
>
>
>
> header("Content-type: text/xml");
>
> $content = ob_get_clean();
>
> // Optional: remove mixed content to insure 100% compatible RSS.
> // Comment out the next 2 lines if you dont want this.
> $allowedTags="";
> $content = strip_tags($content, $allowedTags);
>
> echo $content;
> ?>
> ---------------------------------------------------------------------------------------------
>
> Step 2) Because of problem #1 above, we need to assign this template
> to a section. So create a new section (doesnt matter where), and call
> it "rss". Configure the section so that its templates are "rss.tpl",
> and give the section the URL name of "rss". The URL to this section
> will be the URL to your RSS feed.
>
>
> - Paul
>
----- Original Message -----
From:
To:
Sent: Sunday, September 03, 2006 12:00 AM
Subject: [campsite-support] RSS Feed
> Good afternoon,
>
> I'm having some troubles properly displaying the rss feed on my site. I've
> installed PHP-Wrapper and installed the rss-template that was suggested in
> the
> manual (adapted to my site).
>
> Using Firefox, some details show up. Using IE nothing shows up at all.
> I've seen
> some Campsite-sites with the same problem, but some others do have it
> working
> properly. Can anyone help me?
>
> The url is http://www.nieuwsbedrijf.nl
>
> Thanks in advance!
Thanks a lot for your answer. I've tried Paul's code first and it seems to
have done the trick! This code might be usefull for others as well!
Regards,
>From: "Slobodan Gogic"
>Reply-To: campsite-support@campware.org
>To:
>Subject: Re: [campsite-support] RSS Feed
>Date: Sun, 3 Sep 2006 03:42:26 +0200
>
>Hello,
>
>Basicly, RSS in Campsite is still in domain of hacking it... Its not too
>hard to implement but there are some issues with it. Im pasting You Pauls
>and mine addon "solutions" for RSS. Below You will find Pauls solution for
>it, mine is only simple tweaks if You like to use XSLT transformations
>(which btw dont work in IE 7Beta, looks like IE is ignoring XML with XSLT
>style in it, unlike Firefox which apply transformation...) This is basicly
>solution for shorturls since in longurls you will have to use custom parser
>to translate those & in urls which RSS dont like... And maby just adding
>.htaccess with AddType directive for tpl files to be parsed as xml (AddType
>text/xml .tpl) should do the trick also. But then again You should move RSS
>templates to separate directory because that directive apply on whole
>directory where .htaccess is created... I think You should get to it by
>reading below answers...
>
>Boban
>
>Hi Paul,
>had same problems with rss on our instances especialy because "pseudo
>rss"(created only from tpl files) how i like to call it cannot be read in
>Firefox feed reader(integrated). Looks like Firefox expect rss to be served
>as XML file only. So, I came upto this... basicly, as for template there
>are
>no big differences, only part where file header is set.
>
>
>
>"); ?>
>
>href=\
>"); ?>
>
>basicly the same, except you dont need to escape from wrapper, but You will
>need to escape quotes as usualy in php, though I like the way You stripped
>html tags, i had ugly solution with external php script called from cron
>via
>lynx... You can wrap it in CDATA for description in RSS, but then XSL in
>firefox will not return it correctly if I recall it right...
>last, third line, is for XSL template (check out www.mediaonweb.org and
>click on RSS link). So, as You can see, drawback is that we cannot get
>RFC-822 date needed for RSS 2.0(yes you can hack it with adding not acurate
>time and timezone).
>
>----- Original Message ----- From: "Paul Baranowski"
>
>To:
>Sent: Wednesday, April 05, 2006 2:47 PM
>Subject: [campsite-dev] Re: My hack to get RSS working
>
>
>(this one is for mugur)
>By the way, I didnt see a way to get the time for the publish date -
>is there a way to do that? ( look in the code below for what I did for
>the publish date)
>
>
>On 4/5/06, Paul Baranowski wrote:
>>I recently discovered the magic of RSS aggregators (tried out
>>kaggregator on KDE), and realized that Campsite's RSS feed didnt work
>>with it. Ok, no problem, i thought, cant be that hard to get it
>>working...ahem.
>>
>>After several attempts, the following is the simplest I've been able
>>to make it. Maybe someone knows a less hackier way to do this. If
>>you know, please tell me, because I want to post some intructions in
>>the manual.
>>
>>Summary:
>>This hack is the result of trying to overcome three problems:
>>
>>1) There doesnt seem like there is a way in campsite to display a
>>specific template, except by creating an empty section and assigning
>>the template to it.
>>2) There isnt a way in the template language to set the HTTP headers
>>of a page. In this case we need to tell the browser that the
>>"Content-type" is "text/xml".
>>3) PHP wrapper annoyances
>>
>>Step 1) Create your RSS feed. Create a template named "rss.tpl" that
>>looks something like what written below. Notice that there is no
>> at the top. This is on purpose, if you put it
>>in there the PHP wrapper will think this is PHP code and try to
>>execute it (point #3 above). When it tries to do this, it will crash.
>> I've tested the RSS below using a web-based feed validator and it
>>says it still checks out even without the XML tag. The PHP code at
>>the beginning and end of the sample below is to overcome point #2
>>above and also to strip out HTML from the new stories.
>>-----------------------------------------------------------------------------------------------
>>
>>ob_start();
>>?>
>>
>>xmlns="http://purl.org/rss/1.0/"
>>xmlns:dc="http://purl.org/dc/elements/1.1/">
>>
>>
>> Campware News
>> http://www.campware.org
>> Free Software for a Free Press
>> en-us
>>
>>
>>
>>
>>
>>
>>
>>
>>desc>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> http://www.campware.org
>>
>>body>
>>
>>"%Y-%m-%d">T00:00:00+00:00
>>
>>
>>
>>
>>
>>header("Content-type: text/xml");
>>
>>$content = ob_get_clean();
>>
>>// Optional: remove mixed content to insure 100% compatible RSS.
>>// Comment out the next 2 lines if you dont want this.
>>$allowedTags="";
>>$content = strip_tags($content, $allowedTags);
>>
>>echo $content;
>>?>
>>---------------------------------------------------------------------------------------------
>>
>>Step 2) Because of problem #1 above, we need to assign this template
>>to a section. So create a new section (doesnt matter where), and call
>>it "rss". Configure the section so that its templates are "rss.tpl",
>>and give the section the URL name of "rss". The URL to this section
>>will be the URL to your RSS feed.
>>
>>
>>- Paul
>>
>
>
>
>
>----- Original Message ----- From:
>To:
>Sent: Sunday, September 03, 2006 12:00 AM
>Subject: [campsite-support] RSS Feed
>
>
>>Good afternoon,
>>
>>I'm having some troubles properly displaying the rss feed on my site. I've
>>installed PHP-Wrapper and installed the rss-template that was suggested in
>>the
>>manual (adapted to my site).
>>
>>Using Firefox, some details show up. Using IE nothing shows up at all.
>>I've seen
>>some Campsite-sites with the same problem, but some others do have it
>>working
>>properly. Can anyone help me?
>>
>>The url is http://www.nieuwsbedrijf.nl
>>
>>Thanks in advance!
>