]> git.mxchange.org Git - friendica.git/blobdiff - mod/photos.php
Fix incorrect Temporal reference after Item function move rebase
[friendica.git] / mod / photos.php
index a9e77c7c39089590f8c00ee179e29d853d4014ac..8b3dbdc759ae4294fda0bbeab81438e99d210cd4 100644 (file)
@@ -2,13 +2,14 @@
 /**
  * @file mod/photos.php
  */
+
 use Friendica\App;
 use Friendica\Content\Feature;
 use Friendica\Content\Nav;
 use Friendica\Core\Addon;
+use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\System;
-use Friendica\Core\Config;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
 use Friendica\Model\Contact;
@@ -19,6 +20,8 @@ use Friendica\Model\Profile;
 use Friendica\Network\Probe;
 use Friendica\Object\Image;
 use Friendica\Protocol\DFRN;
+use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Map;
 
 require_once 'include/items.php';
 require_once 'include/acl_selectors.php';
@@ -288,7 +291,7 @@ function photos_post(App $a)
                        if (DBM::is_result($r)) {
                                foreach ($r as $rr) {
                                        q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
-                                               dbesc(datetime_convert()),
+                                               dbesc(DateTimeFormat::utcNow()),
                                                dbesc($rr['parent-uri']),
                                                intval($page_owner_uid)
                                        );
@@ -361,8 +364,8 @@ function photos_post(App $a)
                        );
                        if (DBM::is_result($i)) {
                                q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
-                                       dbesc(datetime_convert()),
-                                       dbesc(datetime_convert()),
+                                       dbesc(DateTimeFormat::utcNow()),
+                                       dbesc(DateTimeFormat::utcNow()),
                                        dbesc($i[0]['uri']),
                                        intval($page_owner_uid)
                                );
@@ -399,7 +402,7 @@ function photos_post(App $a)
                $resource_id = $a->argv[2];
 
                if (!strlen($albname)) {
-                       $albname = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y');
+                       $albname = DateTimeFormat::localNow('Y');
                }
 
                if (x($_POST,'rotate') !== false &&
@@ -646,8 +649,8 @@ function photos_post(App $a)
                        $r = q("UPDATE `item` SET `tag` = '%s', `inform` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d",
                                dbesc($newtag),
                                dbesc($newinform),
-                               dbesc(datetime_convert()),
-                               dbesc(datetime_convert()),
+                               dbesc(DateTimeFormat::utcNow()),
+                               dbesc(DateTimeFormat::utcNow()),
                                intval($item_id),
                                intval($page_owner_uid)
                        );
@@ -735,7 +738,7 @@ function photos_post(App $a)
                if (strlen($newalbum)) {
                        $album = $newalbum;
                } else {
-                       $album = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y');
+                       $album = DateTimeFormat::localNow('Y');
                }
        }
 
@@ -1358,7 +1361,7 @@ function photos_content(App $a)
                $photo = [
                        'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
                        'title'=> L10n::t('View Full Size'),
-                       'src'  => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis'),
+                       'src'  => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . DateTimeFormat::utcNow('ymdhis'),
                        'height' => $hires['height'],
                        'width' => $hires['width'],
                        'album' => $hires['album'],