Use "received" instead of "created" when displaying posts in creation order

This commit is contained in:
Michael 2019-07-07 21:30:33 +00:00
parent 9b8b2b36cd
commit 6bb418c5a7
12 changed files with 51 additions and 59 deletions

View file

@ -704,11 +704,11 @@ function networkThreadedView(App $a, $update, $parent)
}
if ($datequery) {
$sql_extra3 .= Strings::protectSprintf(sprintf(" AND $sql_table.created <= '%s' ",
$sql_extra3 .= Strings::protectSprintf(sprintf(" AND $sql_table.received <= '%s' ",
DBA::escape(DateTimeFormat::convert($datequery, 'UTC', date_default_timezone_get()))));
}
if ($datequery2) {
$sql_extra3 .= Strings::protectSprintf(sprintf(" AND $sql_table.created >= '%s' ",
$sql_extra3 .= Strings::protectSprintf(sprintf(" AND $sql_table.received >= '%s' ",
DBA::escape(DateTimeFormat::convert($datequery2, 'UTC', date_default_timezone_get()))));
}
@ -718,8 +718,8 @@ function networkThreadedView(App $a, $update, $parent)
// Normal conversation view
if ($order === 'post') {
$ordering = '`created`';
$order_mode = 'created';
$ordering = '`received`';
$order_mode = 'received';
} else {
$ordering = '`commented`';
$order_mode = 'commented';

View file

@ -123,7 +123,7 @@ function ping_init(App $a)
$condition = ["`unseen` AND `uid` = ? AND `contact-id` != ?", local_user(), local_user()];
$fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar',
'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid', 'wall'];
$params = ['order' => ['created' => true]];
$params = ['order' => ['received' => true]];
$items = Item::selectForUser(local_user(), $fields, $condition, $params);
if (DBA::isResult($items)) {

View file

@ -186,7 +186,7 @@ function search_content(App $a) {
$condition = ["(`uid` = 0 OR (`uid` = ? AND NOT `global`))
AND `otype` = ? AND `type` = ? AND `term` = ?",
local_user(), TERM_OBJ_POST, TERM_HASHTAG, $search];
$params = ['order' => ['created' => true],
$params = ['order' => ['received' => true],
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
$terms = DBA::select('term', ['oid'], $condition, $params);