SimplePortal

Support => English Support => Topic started by: ronnie42 on November 03, 2009, 06:13:10 PM

Title: RSS Feeds
Post by: ronnie42 on November 03, 2009, 06:13:10 PM
Hello Nathaniel,

Here's another little prob where i run in to.

I trie to set up a block on the left site of the index page an RSS block,
i copy the specific RSS link in the field and it says "invalid feed" do you know at could be wrong here?

It seems that the block does it with other feeds to i have tried others and still it tells me "invalid feed"

thanks m8
Title: Re: RSS Feeds
Post by: Nathaniel on November 03, 2009, 06:22:42 PM
Can you post the feed urls that you are trying to use?

The RSS feed block uses the inbuilt SMF rss functions, which aren't very tolerant. Hence some feeds may actually be invalid, but they will still be shown okay by more tolerant RSS viewers (firefox seems to display RSS feeds even if they are quite broken).
Title: Re: RSS Feeds
Post by: ronnie42 on November 03, 2009, 06:27:58 PM
This is the link:

http://www.ttm.nl/nieuws/rss.php

and i tried this one to:

http://www.ttm.nl/nieuws/rss

but they do not work
Title: Re: RSS Feeds
Post by: Nathaniel on November 03, 2009, 06:39:23 PM
The first RSS feed is appears to have an incorrect encoding (validator link (http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.ttm.nl%2Fnieuws%2Frss.php)), while it is a valid feed, encoding issues could be causing the PHP rss functions to fail.

The second link is a webpage, not an RSS feed.
Title: Re: RSS Feeds
Post by: ronnie42 on November 04, 2009, 05:37:03 AM
Hmm  :'(

It seems that all the feeds to be found no matter wich gives the message "invalid feed"

I have tried more then 25 different feeds and they all come up with the same message.

 :'(
Title: Re: RSS Feeds
Post by: Everton on November 14, 2009, 10:26:35 AM
Hi

I'm having the same problem with every feed I try e..g http://www.windows7news.com/feed and http://www.windows8news.com/feed to name a few.  Any ideas how to fix please?

Thanks

EB
Title: Re: RSS Feeds
Post by: leonpadi on November 19, 2009, 06:12:34 AM
Bump! :)
Please, i would like to kindly request the Developers Team to fix this little incompatibility issue, so we can use those rss feeds. We already know this is NOT sm portal's fault...
Title: Re: RSS Feeds
Post by: Chas on November 19, 2009, 11:18:07 AM
I too am having a similar problem but mine is strange in that the feed WORKS when previewed but gives invalid feed when the block is placed anywhere on the site.

Here is the feed.

http://www.calendarofupdates.com/updates/index.php?act=rssout&type=calendar&id=1
Title: Re: RSS Feeds
Post by: KTFO on December 13, 2009, 11:28:09 PM
I too am having trouble with the RSS feed :( This would be so great if it actually worked  :'(
Title: Re: RSS Feeds
Post by: DonMucios on December 14, 2009, 08:28:34 AM
you can create an custom php block and insert any php rss reader free on the net.
Example: use http://www.scriptol.com/rss/rss-reader.php and put content of rsslib.php in block content and call the function to view rss from the example.
Title: Re: RSS Feeds
Post by: KTFO on January 02, 2010, 05:41:56 PM
you can create an custom php block and insert any php rss reader free on the net.
Example: use http://www.scriptol.com/rss/rss-reader.php and put content of rsslib.php in block content and call the function to view rss from the example.

Thanks DonMucios, I will look into this. I appreciate the response.
 8)
Title: Re: RSS Feeds
Post by: [SiNaN] on January 20, 2010, 02:15:32 PM
ronnie42, try this:

./Sources/PortalBlocks.php

Code: (Find) [Select]
$xml_parser = xml_parser_create();
Code: (Replace) [Select]
$xml_array = new xmlArray($xml_data);

if (!$xml_array->exists('rss[0]'))
echo 'error';
$xml_array = $xml_array->path('rss[0]');
$xml_array = $xml_array->path('channel[0]');

$items = array();
$counter = 0;
foreach ($xml_array->set('item') as $item)
{
$items[$counter] = array(
'title' => strip_tags($item->fetch('title')),
'content' => strip_tags($item->fetch('description')),
'href' => strip_tags($item->fetch('link')),
);
$items[$counter]['link'] = '<a href="' . $items[$counter]['href'] . '" target="_blank" class="new_win">' . $items[$counter]['title'] . '</a>';
$counter++;
}
/*
$xml_parser = xml_parser_create();

Code: (Find) [Select]
if (empty($items))
{
echo '
', $txt['error_sp_invalid_feed'];

Code: (Replace) [Select]
*/
if (empty($items))
{
echo '
', $txt['error_sp_invalid_feed'];

This may not work for everyone. If you want a fix too, please ask.

Bump! :)
Please, i would like to kindly request the Developers Team to fix this little incompatibility issue, so we can use those rss feeds. We already know this is NOT sm portal's fault...

Yeah, it isn't very easy since people like ignoring standards and creating their own.
Title: Re: RSS Feeds
Post by: leonpadi on January 20, 2010, 05:53:51 PM
I know what you mean dear Sinan, at least we could try ... :)
Title: Re: RSS Feeds
Post by: [SiNaN] on January 21, 2010, 03:03:59 AM
So do you want to link me to your feed to check it out?
Title: Re: RSS Feeds
Post by: leonpadi on January 21, 2010, 08:32:47 AM
Sadly, i don't have online (at least not yet) my smf forum, all the tests i made, were locally. But i suppose i could share with you a couple of interesting greek rss feeds just to check it out with your time...

http://www.naftemporiki.gr/news/static/rss/news.xml
http://www.in.gr/RSS/feed.asp?FeedSelect=FirstPage

The above feeds i tried to use with the smf's rss reader (locally) with no success :(
According to online rss validators the 1st link complies with most of the rss rules, the second does not, but still remains a good rss source.
I must inform you that i tested valid rss links too, but no luck :(
Title: Re: RSS Feeds
Post by: [SiNaN] on January 21, 2010, 12:16:46 PM
For the first one, the code I suggested for ronnie42 above should work.

For the second one, I'm not sure but again the same code with this minor change should work:

Code: (Find) [Select]
   if (!$xml_array->exists('rss[0]'))
      echo 'error';
   $xml_array = $xml_array->path('rss[0]');

Code: (Replace) [Select]
   if (!$xml_array->exists('rdf:RDF[0]'))
      echo 'error';
   $xml_array = $xml_array->path('rdf:RDF[0]');
Title: Re: RSS Feeds
Post by: leonpadi on January 22, 2010, 03:36:36 AM
I will check it out and reply about dear Sinan, thanks for your time helping us :)
Title: Re: RSS Feeds
Post by: [SiNaN] on January 22, 2010, 08:12:35 AM
Okay, let us know how it goes.
Title: Re: RSS Feeds
Post by: ronnie42 on February 21, 2010, 12:54:08 PM
I have read your post [SINaN]

Iwill try this options later on this week and tell you wat i have find out.

Comming weekend i have some spare time left for this.  ;)

Greetz.
Title: Re: RSS Feeds
Post by: saosangmo on February 22, 2010, 12:01:03 PM
hi everyone,

I want to display RSS from my blog on the blogger.com

http://graphix.huongtinhyeu.net/feeds/posts/default

what I can do?

I configured the above URL, I get this message: "Invalid feed."

thanks
Title: Re: RSS Feeds
Post by: [SiNaN] on February 27, 2010, 05:36:30 AM
Members in this topic, except  ronnie42, please create a new topic for your issues. We can't deal with all RSS issues in a single topic.
Title: Re: RSS Feeds
Post by: ronnie42 on March 20, 2010, 04:19:10 AM
ronnie42, try this:

./Sources/PortalBlocks.php

Code: (Find) [Select]
$xml_parser = xml_parser_create();
Code: (Replace) [Select]
$xml_array = new xmlArray($xml_data);

if (!$xml_array->exists('rss[0]'))
echo 'error';
$xml_array = $xml_array->path('rss[0]');
$xml_array = $xml_array->path('channel[0]');

$items = array();
$counter = 0;
foreach ($xml_array->set('item') as $item)
{
$items[$counter] = array(
'title' => strip_tags($item->fetch('title')),
'content' => strip_tags($item->fetch('description')),
'href' => strip_tags($item->fetch('link')),
);
$items[$counter]['link'] = '<a href="' . $items[$counter]['href'] . '" target="_blank" class="new_win">' . $items[$counter]['title'] . '</a>';
$counter++;
}
/*
$xml_parser = xml_parser_create();

Code: (Find) [Select]
if (empty($items))
{
echo '
', $txt['error_sp_invalid_feed'];

Code: (Replace) [Select]
*/
if (empty($items))
{
echo '
', $txt['error_sp_invalid_feed'];

This may not work for everyone. If you want a fix too, please ask.

Bump! :)
Please, i would like to kindly request the Developers Team to fix this little incompatibility issue, so we can use those rss feeds. We already know this is NOT sm portal's fault...

Yeah, it isn't very easy since people like ignoring standards and creating their own.


It's not working yet  :|

But it does say anymore: Invalid Feed so thats a bit of progress.

It does not give an error anymore but it leaves the field blank so there is no sign of an working block.

Any ideas?
Title: Re: RSS Feeds
Post by: [SiNaN] on March 20, 2010, 11:03:17 AM
Can you link me to the feed your are trying it with?
Title: Re: RSS Feeds
Post by: ronnie42 on March 20, 2010, 01:37:49 PM
This is the feed i wanna use.

http://www.ttm.nl/nieuws/rss.php

It seems to be a valid one altough there are some errors on THIS (http://validator.w3.org/feed/check.cgi?url=http://www.ttm.nl/nieuws/rss.php) check
Title: Re: RSS Feeds
Post by: [SiNaN] on March 30, 2010, 07:24:52 AM
I have tried feed with RSS Feed block on SP 2.3.1 and SMF 2.0 RC3; it works fine for me without any modifications.
Title: Re: RSS Feeds
Post by: ronnie42 on March 30, 2010, 05:24:58 PM
Hmmm that is weird because i have un-installed all my mods and put the forum in the curve theme and did the same with the portal front page.

So i went back to basic and did an other shot and guess wat, no function of the RSS feed.

It drives me mad  :angry-yell:

Title: Re: RSS Feeds
Post by: [SiNaN] on March 31, 2010, 03:18:14 AM
By "without modifications" I meant; without making any edits to RSS Feed block code. What do you mean by "no function of the RSS feed"?
Title: Re: RSS Feeds
Post by: ronnie42 on March 31, 2010, 05:00:08 AM
Sorry for that: I mean it did not shows the feed in the block, and when i un-instaled all the mods i had indeed the portalblocks.php wich you presented me earlyer in this topic.

could it realy be 1 of the mods?

i use the avea mod and the contact form mod

no more.
Title: Re: RSS Feeds
Post by: [SiNaN] on March 31, 2010, 12:24:45 PM
I didn't say it could be related to another mod. I just said the feed you posted (http://www.ttm.nl/nieuws/rss.php) works perfect for me without changing anything in the SimplePortal files. What error do you get when you add that feed (without the edit I provided before)?
Title: Re: RSS Feeds
Post by: ronnie42 on April 05, 2010, 02:39:25 AM
What error do you get when you add that feed (without the edit I provided before)?


when i use your replaced code:

I do net get no error when i place the feed but it just shows an empty block with no feed in it, just a blanco field completley empty.


When i use the original php file as you download SP it says:  error invalid feed

Title: Re: RSS Feeds
Post by: [SiNaN] on April 06, 2010, 04:12:08 AM
Did you update your portal to 2.3.2? If you haven't yet, please do and try again. I have just tested the feed again and it works with the default RSS Feed block.
SimplePortal 2.3.8 © 2008-2024, SimplePortal