]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
Merge pull request #7605 from annando/pending-2
[friendica.git] / mod / network.php
index 87eb4308b41549d20a199463fbb2f39dbc7bed33..fddec60c8dc86457e1273d551adb2d766e63babb 100644 (file)
@@ -643,7 +643,7 @@ function networkThreadedView(App $a, $update, $parent)
                        // NOTREACHED
                }
 
-               $contacts = Group::expand([$gid]);
+               $contacts = Group::expand(local_user(), [$gid]);
 
                if ((is_array($contacts)) && count($contacts)) {
                        $contact_str_self = '';
@@ -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';
@@ -868,10 +868,10 @@ function networkThreadedView(App $a, $update, $parent)
                                (SELECT SUBSTR(`term`, 2) FROM `search` WHERE `uid` = ? AND `term` LIKE '#%') AND `otype` = ? AND `type` = ? AND `uid` = 0) AS `term`
                        ON `item`.`id` = `term`.`oid`
                        STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `item`.`author-id`
-                       WHERE `item`.`uid` = 0 AND `item`.$ordering < ? AND `item`.$ordering > ?
+                       WHERE `item`.`uid` = 0 AND `item`.$ordering < ? AND `item`.$ordering > ? AND `item`.`gravity` = ?
                                AND NOT `author`.`hidden` AND NOT `author`.`blocked`" . $sql_tag_nets,
                        local_user(), TERM_OBJ_POST, TERM_HASHTAG,
-                       $top_limit, $bottom_limit);
+                       $top_limit, $bottom_limit, GRAVITY_PARENT);
 
                $data = DBA::toArray($items);