diff options
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index f11293e4a..dbe6493d4 100644 --- a/include/items.php +++ b/include/items.php @@ -66,6 +66,11 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update) { ); } + if($dfrn_id == '' || $dfrn_id == '*') + $sort = 'DESC'; + else + $sort = 'ASC'; + if(! strlen($last_update)) $last_update = 'now - 30 days'; $check_date = datetime_convert('UTC','UTC',$last_update,'Y-m-d H:i:s'); @@ -80,10 +85,11 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update) { AND NOT `item`.`type` IN ( 'remote', 'net-comment' ) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND ( `item`.`edited` > '%s' OR `item`.`changed` > '%s' ) $sql_extra - ORDER BY `parent` ASC, `created` ASC LIMIT 0, 300", + ORDER BY `parent` %s, `created` ASC LIMIT 0, 300", intval($owner_id), dbesc($check_date), - dbesc($check_date) + dbesc($check_date), + dbesc($sort) ); if(! count($r)) killme(); |