- Posts: 1
COMMUNITY FORUM
Feed Not coming in right order
- bluefive
- Topic Author
- Offline
- New Member
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.
- geolaw
- Offline
- New Member
- Posts: 3
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.
- Vero44
- Offline
- New Member
- Posts: 2
Any clues Joomlaworks?
Please Log in or Create an account to join the conversation.
- mistavitto
- Offline
- New Member
- Posts: 1
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.
- palebluedot
- Offline
- New Member
- Posts: 3
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.
- portugaonline
- Offline
- New Member
- Posts: 4
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.
- palebluedot
- Offline
- New Member
- Posts: 3
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.
- Rick Magers
- Offline
- New Member
- Posts: 1
I can dink around with the code but my skills are limited.
Please Log in or Create an account to join the conversation.
- PhattyMcGee
- Offline
- New Member
- Posts: 2
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.
- therealkw15
- Offline
- New Member
- Posts: 3
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.