From: brettp Date: Sat, 12 Feb 2011 23:14:42 +0000 (+0000) Subject: Updated a few recent calls to elgg_get_annotations() to use 'reverse_order_by' =... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=4dd7d2be5352ac20d3eb2693d78954718c704cbc;p=lorea%2Felgg.git Updated a few recent calls to elgg_get_annotations() to use 'reverse_order_by' => true. git-svn-id: http://code.elgg.org/elgg/trunk@8186 36083f99-b078-4883-b0ff-0f9b5a30f544 --- diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index 1154fd89a..7bed1af7c 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -533,8 +533,8 @@ abstract class ElggEntity extends ElggData implements 'offset' => $offset, ); - if ($order == 'desc') { - $options['order_by'] = 'n_table.time_created desc'; + if ($order != 'asc') { + $options['reverse_order_by'] = true; } return elgg_get_annotations($options); diff --git a/engine/lib/views.php b/engine/lib/views.php index d1782acc2..39ba64a77 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1091,7 +1091,7 @@ function elgg_view_latest_comments($owner_guid, $type = 'object', $subtype = '', $options = array( 'annotation_name' => 'generic_comment', 'owner_guid' => $owner_guid, - 'order_by' => 'n_table.time_created desc', + 'reverse_order_by' => true, 'limit' => $number ); diff --git a/mod/messageboard/history.php b/mod/messageboard/history.php index 3134165a8..2275ab9da 100644 --- a/mod/messageboard/history.php +++ b/mod/messageboard/history.php @@ -25,7 +25,7 @@ $options = array( 'owner_guids' => $users_array, 'limit' => 10, 'offset' => 0, - 'order_by' => 'n_table.time_created desc' + 'reverse_order_by' => true ); $contents = elgg_get_annotations($options);