]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
Move Temporal::convert() to DateTimeFormat::convert()
[friendica.git] / mod / network.php
index 1d64fcbde5ddb6cbf243ac099a28ae2f45f0fedd..c2f05fd8e7e22a14a17a4b9b06c306eb28dc4fa8 100644 (file)
@@ -3,14 +3,15 @@
 /**
  * @file mod/network.php
  */
+
 use Friendica\App;
 use Friendica\Content\Feature;
 use Friendica\Content\ForumManager;
 use Friendica\Content\Nav;
 use Friendica\Content\Widget;
 use Friendica\Core\Addon;
-use Friendica\Core\L10n;
 use Friendica\Core\Config;
+use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\System;
 use Friendica\Database\DBM;
@@ -18,6 +19,7 @@ use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Model\Profile;
 use Friendica\Module\Login;
+use Friendica\Util\DateTimeFormat;
 
 require_once 'include/conversation.php';
 require_once 'include/items.php';
@@ -679,11 +681,11 @@ function networkThreadedView(App $a, $update = 0)
 
        if ($datequery) {
                $sql_extra3 .= protect_sprintf(sprintf(" AND $sql_table.created <= '%s' ",
-                               dbesc(datetime_convert(date_default_timezone_get(), '', $datequery))));
+                               dbesc(DateTimeFormat::convert($datequery, 'UTC', date_default_timezone_get()))));
        }
        if ($datequery2) {
                $sql_extra3 .= protect_sprintf(sprintf(" AND $sql_table.created >= '%s' ",
-                               dbesc(datetime_convert(date_default_timezone_get(), '', $datequery2))));
+                               dbesc(DateTimeFormat::convert($datequery2, 'UTC', date_default_timezone_get()))));
        }
 
        $sql_order = '';
@@ -783,13 +785,13 @@ function networkThreadedView(App $a, $update = 0)
        }
 
        // Only show it when unfiltered (no groups, no networks, ...)
-       if (Config::get('system', 'comment_public') && in_array($nets, ['', NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && (strlen($sql_extra . $sql_extra2 . $sql_extra3) == 0)) {
+       if (in_array($nets, ['', NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && (strlen($sql_extra . $sql_extra2 . $sql_extra3) == 0)) {
                if (DBM::is_result($r)) {
                        $top_limit = current($r)['order_date'];
                        $bottom_limit = end($r)['order_date'];
                } else {
-                       $top_limit = datetime_convert();
-                       $bottom_limit = datetime_convert();
+                       $top_limit = DateTimeFormat::utcNow();
+                       $bottom_limit = DateTimeFormat::utcNow();
                }
 
                // When checking for updates we need to fetch from the newest date to the newest date before
@@ -802,7 +804,7 @@ function networkThreadedView(App $a, $update = 0)
                        $top_limit = $last_date;
                } elseif ($a->pager['page'] == 1) {
                        // Highest possible top limit when we are on the first page
-                       $top_limit = datetime_convert();
+                       $top_limit = DateTimeFormat::utcNow();
                }
 
                $items = dba::p("SELECT `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid` FROM `item`