Problems incoporating an RSS feed

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
PePiPoo

Problems incoporating an RSS feed

Post by PePiPoo »

I've been trying to put an RSS feed from my Invision PowerBoard (IPB) forum into the pages of my main website, which I'm building using CMSMS. I've tried using both pirss and the RSS module bundled with CMSMS, but neither produce any output from the IPB feed. However, both work fine with some other RSS feeds.

From this I might say the IPB feed is broken - but it works fine with a couple of feed readers I've tried - Google and Thunderbird!

HELP!

Heres a CMSMS test page with both feeds: http://pepipoo.com/cmsms/index.php?page=Test

Code: Select all

<h3>RSS feeds</h3>
<h4>BBC Sport feed (pirss)</h4>
<p>{pirss url="http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/latest_published_stories/rss.xml"}</p>
<h4>IPB forum feed (pirss)<br /></h4>
<p>{pirss url="http://forums.pepipoo.com/index.php?act=rssout&id=2"}</p>
<h4>BBC Sport feed (CMSMS RSS module)</h4>
<p>{cms_module module="rss" url="http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/latest_published_stories/rss.xml"}</p>
<h4>IPB forum feed (CMSMS RSS module)</h4>
<p>{cms_module module="rss" url="http://forums.pepipoo.com/index.php?act=rssout&id=2"}</p>
I'd really appreciate it if anyone could point to where the problem lies!
PePiPoo

Re: Problems incoporating an RSS feed

Post by PePiPoo »

OK, I've worked out what the problem is at least - neither pirss nor the CMS RSS module can cope with an RSS URL containing an ampersand (&). My IPB feed URL was being converted to http://forums.pepipoo.com/index.php?act ... ]&[/b]id=1. I don't know if there's a more elegant solution, but I added this after line 4 of function.pirss.php and all is now well!

Code: Select all

$url=html_entity_decode($url);
I would guess the RSS module has the same issue.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Problems incoporating an RSS feed

Post by Ted »

Makes sense.  Though, to be fair, most browsers will choke on & if you put it directly into the url line too.  Technically, it's not a correct url.  It's only correct when embedded in HTML.
PePiPoo

Re: Problems incoporating an RSS feed

Post by PePiPoo »

Sure, I wouldn't expect a browser to cope with & in a URL. The problem I had was that the RSS URL has a & character in it, which is being HTML encoded before being presented to the pirss function or the RSS module. Pirss (and presumably the RSS module) then tries to do a file() read using the HTML encoded URL - which isn't (as you point out) a valid URL.
mager
Forum Members
Forum Members
Posts: 44
Joined: Wed Apr 04, 2007 2:25 pm
Location: Bremen

Re: Problems incoporating an RSS feed

Post by mager »

PePiPoo wrote: OK, I've worked out what the problem is at least - neither pirss nor the CMS RSS module can cope with an RSS URL containing an ampersand (&). My IPB feed URL was being converted to &[/b]id=1]http://forums.pepipoo.com/index.php?act=rssout&id=1. I don't know if there's a more elegant solution, but I added this after line 4 of function.pirss.php and all is now well!

Code: Select all

$url=html_entity_decode($url);
I would guess the RSS module has the same issue.
Hmm... no one incorportated your fix into this plugin.
Why?

(Could I just do it?)

Martin
ctp6360

Re: Problems incoporating an RSS feed

Post by ctp6360 »

For people using the CMS Made Simple RSS Plugin the fix for this issue is to:

Line 79 of RSS.module.php

$url=html_entity_decode($url);

This will solve the problem of RSS URLs not working when they contain ampersands (&).

Thanks PePiPoo for this solution.

Is there a way to contribute code fixes such as these back to the main tree?
Locked

Return to “Modules/Add-Ons”