]> git.mxchange.org Git - friendica.git/commitdiff
import items from feeds in inverse date order
authorfabrixxm <fabrix.xm@gmail.com>
Mon, 3 Jan 2011 09:04:54 +0000 (10:04 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Mon, 3 Jan 2011 09:04:54 +0000 (10:04 +0100)
include/items.php
include/poller.php

index 6f73984e2bfb4fce8f645bd915c385ef0ad91079..0c055f5711a432d142fc58a233c7012d78eb4f19 100644 (file)
@@ -921,7 +921,10 @@ function consume_feed($xml,$importer,$contact, &$hub, $datedir = 0) {
 
        // Now process the feed
        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;
 
@@ -1307,4 +1310,4 @@ function atom_entry($item,$type,$author,$owner,$comment = false) {
        
        return $o;
 }
-       
\ No newline at end of file
+       
index dda0cb0ce8ff7419871cc5c91b197f7232f0e9e4..3d13a54808d161b8c96ab26fabb790941ff9a701 100644 (file)
                if(! strlen($xml))
                        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
 
-               consume_feed($xml,$importer,$contact,$hub);
+               consume_feed($xml,$importer,$contact,$hub,1);
 
 
                if((strlen($hub)) && ($hub_update)