]> git.mxchange.org Git - friendica-addons.git/commitdiff
Add Temporal::utc() shorthand to Temporal::convert()
authorHypolite Petovan <mrpetovan@gmail.com>
Fri, 26 Jan 2018 12:30:06 +0000 (07:30 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Sat, 3 Feb 2018 16:40:39 +0000 (11:40 -0500)
fromgplus/fromgplus.php
public_server/public_server.php
pumpio/pumpio.php
statusnet/statusnet.php
twitter/twitter.php

index fa6c0e39a1acc4f199b230427f1136ef5c8f9a68..a65be28678d294dfdb9a184f73c71dfb2f4f556a 100644 (file)
@@ -520,12 +520,12 @@ function fromgplus_fetch($a, $uid) {
                                                if (function_exists("share_header"))
                                                        $post .= share_header($item->object->actor->displayName, $item->object->actor->url,
                                                                                $item->object->actor->image->url, "",
-                                                                               Temporal::convert($item->object->published),$item->object->url);
+                                                                               Temporal::utc($item->object->published),$item->object->url);
                                                else
                                                        $post .= "[share author='".str_replace("'", "&#039;",$item->object->actor->displayName).
                                                                        "' profile='".$item->object->actor->url.
                                                                        "' avatar='".$item->object->actor->image->url.
-                                                                       "' posted='".Temporal::convert($item->object->published).
+                                                                       "' posted='".Temporal::utc($item->object->published).
                                                                        "' link='".$item->object->url."']";
 
                                                $post .= fromgplus_html2bbcode($item->object->content);
index 23777654b0362644328857d5e2bd1b921775e0c6..29cf0f60f2fd4b557e051f11e35eae1253f5e39a 100644 (file)
@@ -39,7 +39,7 @@ function public_server_register_account($a,$b) {
                return;
 
        $r = q("UPDATE user set account_expires_on = '%s', expire = %d where uid = %d",
-               dbesc(Temporal::convert('now +' . $days . ' days')),
+               dbesc(Temporal::utc('now +' . $days . ' days')),
                intval($days_posts),
                intval($uid)
        );
@@ -87,7 +87,7 @@ function public_server_cron($a,$b) {
                if(count($r)) {
                        foreach($r as $rr)
                                q("update user set account_expires_on = '%s' where uid = %d",
-                                       dbesc(Temporal::convert('now +' . '6 days')),
+                                       dbesc(Temporal::utc('now +' . '6 days')),
                                        intval($rr['uid'])
                        );
                }
@@ -100,7 +100,7 @@ function public_server_cron($a,$b) {
                if(count($r)) {
                        foreach($r as $rr)
                                q("update user set account_expires_on = '%s' where uid = %d",
-                                       dbesc(Temporal::convert('now +' . '6 days')),
+                                       dbesc(Temporal::utc('now +' . '6 days')),
                                        intval($rr['uid'])
                                );
                }
@@ -138,7 +138,7 @@ function public_server_login($a,$b) {
        if(! $days)
                return;
        $r = q("UPDATE user set account_expires_on = '%s' where uid = %d and account_expires_on > '0000-00-00 00:00:00'",
-       dbesc(Temporal::convert('now +' . $days . ' days')),
+       dbesc(Temporal::utc('now +' . $days . ' days')),
        local_user()
        );
 }
index afdd3455c95f2e74d5a4ea214f00c60c9a35f4ac..45dd57499de7a5f21dffba9a4baee0cd9bedef2e 100644 (file)
@@ -1211,11 +1211,11 @@ function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcomplet
        if ($post->object->displayName != "")
                $postarray['title'] = $post->object->displayName;
 
-       $postarray['created'] = Temporal::convert($post->published);
+       $postarray['created'] = Temporal::utc($post->published);
        if (isset($post->updated))
-               $postarray['edited'] = Temporal::convert($post->updated);
+               $postarray['edited'] = Temporal::utc($post->updated);
        elseif (isset($post->received))
-               $postarray['edited'] = Temporal::convert($post->received);
+               $postarray['edited'] = Temporal::utc($post->received);
        else
                $postarray['edited'] = $postarray['created'];
 
@@ -1230,7 +1230,7 @@ function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcomplet
 
                        $postarray['body'] = share_header($share_author, $post->object->author->url,
                                                        $post->object->author->image->url, "",
-                                                       Temporal::convert($post->object->created),
+                                                       Temporal::utc($post->object->created),
                                                        $post->links->self->href).
                                                $postarray['body']."[/share]";
 
index ee0a6dab7803abcf0b21d952c75042fb3fc45c07..ae54e2fd11f593d652b76290ef5afbb9b98b8ed9 100644 (file)
@@ -983,7 +983,7 @@ function statusnet_fetch_contact($uid, $contact, $create_user)
        } else {
                // update profile photos once every two weeks as we have no notification of when they change.
                //$update_photo = (($r[0]['avatar-date'] < Temporal::convert('now -2 days', '', '', )) ? true : false);
-               $update_photo = ($r[0]['avatar-date'] < Temporal::convert('now -12 hours'));
+               $update_photo = ($r[0]['avatar-date'] < Temporal::utc('now -12 hours'));
 
                // check that we have all the photos, this has been known to fail on occasion
                if ((!$r[0]['photo']) || (!$r[0]['thumb']) || (!$r[0]['micro']) || ($update_photo)) {
@@ -1197,8 +1197,8 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex
        $postarray['body'] = $converted["body"];
        $postarray['tag'] = $converted["tags"];
 
-       $postarray['created'] = Temporal::convert($content->created_at);
-       $postarray['edited'] = Temporal::convert($content->created_at);
+       $postarray['created'] = Temporal::utc($content->created_at);
+       $postarray['edited'] = Temporal::utc($content->created_at);
 
        if (is_string($content->place->name)) {
                $postarray["location"] = $content->place->name;
index cc12e8de8448dad7a223358b27fde337e35e6400..0bffa4eb11ab895487c40a3ba005789a35a5da11 100644 (file)
@@ -1070,7 +1070,7 @@ function twitter_fetch_contact($uid, $contact, $create_user)
        } else {
                // update profile photos once every two weeks as we have no notification of when they change.
                //$update_photo = (($r[0]['avatar-date'] < Temporal::convert('now -2 days', '', '', )) ? true : false);
-               $update_photo = ($r[0]['avatar-date'] < Temporal::convert('now -12 hours'));
+               $update_photo = ($r[0]['avatar-date'] < Temporal::utc('now -12 hours'));
 
                // check that we have all the photos, this has been known to fail on occasion
                if ((!$r[0]['photo']) || (!$r[0]['thumb']) || (!$r[0]['micro']) || ($update_photo)) {
@@ -1490,8 +1490,8 @@ function twitter_createpost(App $a, $uid, $post, $self, $create_user, $only_exis
        $converted = twitter_expand_entities($a, $postarray['body'], $post, false, $picture);
        $postarray['body'] = $converted["body"];
        $postarray['tag'] = $converted["tags"];
-       $postarray['created'] = Temporal::convert($post->created_at);
-       $postarray['edited'] = Temporal::convert($post->created_at);
+       $postarray['created'] = Temporal::utc($post->created_at);
+       $postarray['edited'] = Temporal::utc($post->created_at);
 
        $statustext = $converted["plain"];