reverse sort order for public feeds

This commit is contained in:
Mike Macgirvin 2010-09-10 01:45:58 -07:00
parent 7d5ace644e
commit 19661d4c25

View file

@ -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)) if(! strlen($last_update))
$last_update = 'now - 30 days'; $last_update = 'now - 30 days';
$check_date = datetime_convert('UTC','UTC',$last_update,'Y-m-d H:i:s'); $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 NOT `item`.`type` IN ( 'remote', 'net-comment' ) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND ( `item`.`edited` > '%s' OR `item`.`changed` > '%s' ) AND ( `item`.`edited` > '%s' OR `item`.`changed` > '%s' )
$sql_extra $sql_extra
ORDER BY `parent` ASC, `created` ASC LIMIT 0, 300", ORDER BY `parent` %s, `created` ASC LIMIT 0, 300",
intval($owner_id), intval($owner_id),
dbesc($check_date), dbesc($check_date),
dbesc($check_date) dbesc($check_date),
dbesc($sort)
); );
if(! count($r)) if(! count($r))
killme(); killme();