]> git.mxchange.org Git - friendica-addons.git/blobdiff - fromgplus/fromgplus.php
Fix typo in translation string in twitter
[friendica-addons.git] / fromgplus / fromgplus.php
index 984ab4b4677d9393e637b157eba4551280e35c6f..0699f75bbf178d3d6a64191c5b830d26e29128c2 100644 (file)
@@ -11,10 +11,11 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
 
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
+use Friendica\Object\Image;
 
-require_once('mod/share.php');
-require_once('mod/parse_url.php');
-require_once('include/text.php');
+require_once 'mod/share.php';
+require_once 'mod/parse_url.php';
+require_once 'include/text.php';
 
 function fromgplus_install() {
        register_hook('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
@@ -86,7 +87,7 @@ function fromgplus_addon_settings_post(&$a,&$b) {
                PConfig::set(local_user(),'fromgplus', 'keywords', $keywords);
 
                if (!$enable)
-                       del_pconfig(local_user(),'fromgplus','lastdate');
+                       PConfig::delete(local_user(),'fromgplus','lastdate');
 
                info( t('Google+ Import Settings saved.') . EOL);
        }
@@ -263,12 +264,12 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) {
        }
 
        if ($cleaned["full"] != "")
-               $infoFull = get_photo_info($cleaned["full"]);
+               $infoFull = Image::getInfoFromURL($cleaned["full"]);
        else
                $infoFull = array("0" => 0, "1" => 0);
 
        if ($cleaned["preview"] != "")
-               $infoPreview = get_photo_info($cleaned["preview"]);
+               $infoPreview = Image::getInfoFromURL($cleaned["preview"]);
        else
                $infoFull = array("0" => 0, "1" => 0);
 
@@ -308,7 +309,6 @@ function fromgplus_cleantext($text) {
 }
 
 function fromgplus_handleattachments($a, $uid, $item, $displaytext, $shared) {
-       require_once("include/Photo.php");
        require_once("include/items.php");
        require_once("include/network.php");
 
@@ -348,13 +348,14 @@ function fromgplus_handleattachments($a, $uid, $item, $displaytext, $shared) {
 
                        case "photo":
                                // Don't store shared pictures in your wall photos (to prevent a possible violating of licenses)
-                               if ($shared)
+                               if ($shared) {
                                        $images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
-                               else {
-                                       if ($attachment->fullImage->url != "")
-                                               $images = store_photo($a, $uid, "", $attachment->fullImage->url);
-                                       elseif ($attachment->image->url != "")
-                                               $images = store_photo($a, $uid, "", $attachment->image->url);
+                               } else {
+                                       if ($attachment->fullImage->url != "") {
+                                               $images = Image::storePhoto($a, $uid, "", $attachment->fullImage->url);
+                                       } elseif ($attachment->image->url != "") {
+                                               $images = Image::storePhoto($a, $uid, "", $attachment->image->url);
+                                       }
                                }
 
                                if ($images["preview"] != "") {
@@ -365,8 +366,9 @@ function fromgplus_handleattachments($a, $uid, $item, $displaytext, $shared) {
                                        $post .= "\n[img]".$images["full"]."[/img]\n";
                                        $pagedata["images"][0]["src"] = $images["full"];
 
-                                       if ($images["preview"] != "")
+                                       if ($images["preview"] != "") {
                                                $pagedata["images"][1]["src"] = $images["preview"];
+                                       }
                                }
 
                                if (($attachment->displayName != "") && (fromgplus_cleantext($attachment->displayName) != fromgplus_cleantext($displaytext))) {