Merge pull request #4516 from annando/item-ordering

Items on the network page should now be ordered always like expected
This commit is contained in:
Hypolite Petovan 2018-02-28 15:25:59 -05:00 committed by GitHub
commit 1693633e05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -345,7 +345,7 @@ function networkConversation($a, $items, $mode, $update, $ordering = '')
// Set this so that the conversation function can find out contact info for our wall-wall items // Set this so that the conversation function can find out contact info for our wall-wall items
$a->page_contact = $a->contact; $a->page_contact = $a->contact;
$o = conversation($a, $items, $mode, $update, $ordering); $o = conversation($a, $items, $mode, $update, false, $ordering);
if (!$update) { if (!$update) {
if (PConfig::get(local_user(), 'system', 'infinite_scroll')) { if (PConfig::get(local_user(), 'system', 'infinite_scroll')) {
@ -689,9 +689,6 @@ function networkThreadedView(App $a, $update, $parent)
dbesc(DateTimeFormat::convert($datequery2, 'UTC', date_default_timezone_get())))); dbesc(DateTimeFormat::convert($datequery2, 'UTC', date_default_timezone_get()))));
} }
$sql_order = '';
$order_mode = 'received';
if ($conv) { if ($conv) {
$sql_extra3 .= " AND $sql_table.`mention`"; $sql_extra3 .= " AND $sql_table.`mention`";
} }
@ -699,14 +696,10 @@ function networkThreadedView(App $a, $update, $parent)
// Normal conversation view // Normal conversation view
if ($order === 'post') { if ($order === 'post') {
$ordering = '`created`'; $ordering = '`created`';
if ($sql_order == '') { $order_mode = 'created';
$order_mode = 'created';
}
} else { } else {
$ordering = '`commented`'; $ordering = '`commented`';
if ($sql_order == '') { $order_mode = 'commented';
$order_mode = 'commented';
}
} }
if ($sql_order == '') { if ($sql_order == '') {