From 19661d4c2599c25f8bcf536932e888a27e3663e1 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Fri, 10 Sep 2010 01:45:58 -0700 Subject: [PATCH] reverse sort order for public feeds --- include/items.php | 10 ++++++++-- 1 file 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();