import items from feeds in inverse date order

This commit is contained in:
fabrixxm 2011-01-03 10:04:54 +01:00
parent 8805635293
commit c061603746
2 changed files with 7 additions and 4 deletions

View file

@ -921,7 +921,10 @@ function consume_feed($xml,$importer,$contact, &$hub, $datedir = 0) {
// Now process the feed // Now process the feed
if($feed->get_item_quantity()) { if($feed->get_item_quantity()) {
foreach($feed->get_items() as $item) { // in inverse date order
if ($datedir)
$items = array_reverse($feed->get_items());
foreach($items as $item) {
$deleted = false; $deleted = false;

View file

@ -225,11 +225,11 @@
if(! strlen($xml)) if(! strlen($xml))
continue; continue;
consume_feed($xml,$importer,$contact,$hub); consume_feed($xml,$importer,$contact,$hub,1);
// do it twice. Ensures that children of parents which may be later in the stream aren't tossed // do it twice. Ensures that children of parents which may be later in the stream aren't tossed
consume_feed($xml,$importer,$contact,$hub); consume_feed($xml,$importer,$contact,$hub,1);
if((strlen($hub)) && ($hub_update) if((strlen($hub)) && ($hub_update)