Keyword

Feed Not coming in right order

  • bluefive
  • bluefive's Avatar Topic Author
  • Offline
  • New Member
More
17 years 2 months ago #6824 by bluefive
Feed Not coming in right order was created by bluefive
Hi,

I've set this up in a site I'm working on, and it works great, except that any feed I pull in does not display in the right order.

For instance, if I pull in CNN's top stories, it diplays the news stories out of order by time. It should be latest story at the top and oldest story on the bottom. It doesn't do that.

Same thing for Top 5 Box Office Movies, it displays the #1 movie in the middle instead of the top.

Any suggestions?

Thanks in advance

Peter

Please Log in or Create an account to join the conversation.

More
17 years 1 month ago #6825 by geolaw
Replied by geolaw on topic Re: Feed Not coming in right order
Having the same problem here.

What I had to end up doing is writing a intermediate script to pull my rss, I pass it the feed to pull it pulls apart the feed, stores the <item>..</item> blocks in an array based on the unix timestamp of pubDate, sorts the array, then prints the first 3 entries.

not pretty but it at least lets you see the next 3 events/items in time order, although this module still insists on reversing the order and putting the next item in time order at the very bottom....

what a PITA

Please Log in or Create an account to join the conversation.

More
16 years 11 months ago #6826 by Vero44
Replied by Vero44 on topic Re: Feed Not coming in right order
Just posted about this before reading your comments here.  Getting the same fault too, think it may be related to Simplepie's handling of feeds as another Joomla rss module does the same thing.

Any clues Joomlaworks?

Please Log in or Create an account to join the conversation.

More
16 years 11 months ago #6827 by mistavitto
Replied by mistavitto on topic Re: Feed Not coming in right order
in modules/mod_jw_srfr/simplepie.inc

change line 456
var $order_by_date = true;

to
var $order_by_date = false;


in modules/mod_jw_srfr.php

change line 115
function sort_items($a, $b) {return SimplePie::sort_items($a, $b);}

to
function sort_items($a, $b) {return SimplePie::sort_items($b, $a);}

probably not the best solution, but it worked for me.
now i can display the next Upcoming Shows from Myspace on my website, in the right order.
please let me know your experiences.

Please Log in or Create an account to join the conversation.

More
16 years 9 months ago - 16 years 9 months ago #6828 by palebluedot
Replied by palebluedot on topic Re: Feed Not coming in right order
This change doesn't seem to apply to v1.4.

My live site is:  music.svfan.com/

I have many module instances and most have #'d RSS feeds that appear fine when you look directly at the feed, but do not when the module imports them.

Here is an actual feed link from my site

This is how it looks when imported:
music.svfan.com/index.php/iTunes/Top-100-Rock-Roll-Music-Albums.html

There doesn't seem to be any rhyme or reason to the sort order.  Its not by date, alphabetical, or otherwise.

Please Log in or Create an account to join the conversation.

More
16 years 9 months ago #6829 by portugaonline
Replied by portugaonline on topic Re: Feed Not coming in right order
Hi,,

I have the same problem, but i comment lines 115 to 117 in mod_jw_srfr.php, and for me results.

//if(!function_exists("sort_items")){
// function sort_items($a, $b) {return SimplePie::sort_items($a, $b);}
//}


Sergio

Please Log in or Create an account to join the conversation.

More
16 years 9 months ago #6830 by palebluedot
Replied by palebluedot on topic Re: Feed Not coming in right order

Hi,,

I have the same problem, but i comment lines 115 to 117 in mod_jw_srfr.php, and for me results.

//if(!function_exists("sort_items")){
// function sort_items($a, $b) {return SimplePie::sort_items($a, $b);}
//}


Sergio


Not working for me.  What version are you using?

Please Log in or Create an account to join the conversation.

More
16 years 6 months ago #6831 by Rick Magers
Replied by Rick Magers on topic Re: Feed Not coming in right order
With all respect, none of these solutions work for correcting sort order. Can anyone (JoomlaWorks?) tell us, is this a module issue, SimplePie, or something else?

I can dink around with the code but my skills are limited.

Please Log in or Create an account to join the conversation.

More
16 years 6 months ago #6832 by PhattyMcGee
Replied by PhattyMcGee on topic Re: Feed Not coming in right order

With all respect, none of these solutions work for correcting sort order. Can anyone (JoomlaWorks?) tell us, is this a module issue, SimplePie, or something else?

I can dink around with the code but my skills are limited.


I am also in the same boat, I tried all of the suggestions with no luck.  I got the feed to display in the OPPOSITE order, of which isn't exactly what i'm looking for.

Please Log in or Create an account to join the conversation.

More
15 years 8 months ago - 15 years 8 months ago #6833 by therealkw15
Replied by therealkw15 on topic Re: Feed Not coming in right order
I seem to have a fix for my version of this problem, the fix being very simple and a variation on reply #5.

My situation is that I have created feeds by screen scraping, and the feed items have no (or equivalently, exactly the same) datestamp. So sorting by date gives unpredictable results when applied to this.

Now my reading of this is that sorting by date is only a big deal if you are reading multiple feeds in the same module, which I am not. So I comment out the function call to the sorter, rather than a function itself as shown for reply #5. Commenting out the function will give an error, so the line I comment out is line 124 (this is in version 1.4) which becomes

//usort($first_items,"sort_items");

Works for me! Tell me how you get on if you try it.

Now it would be perfect if JoomlaWorks could put a radio button in the module settings to switch the sort on or off...

Cheers
Steven

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum