X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=fromgplus%2Ffromgplus.php;h=1a1ae682cfee3d8d4937a6df98b0d4ebe6c8d36a;hb=3a1b172d08ae404bce268097fcaaede8359c7ca6;hp=0627b026af45fa2a34a2bafdded985f7975d3d22;hpb=fe1710d3d06caa1240b7edb90c2e0dcdba18ca20;p=friendica-addons.git diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 0627b026..1a1ae682 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -11,10 +11,11 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes use Friendica\Core\Config; use Friendica\Core\PConfig; +use Friendica\Object\Photo; -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'); @@ -263,12 +264,12 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) { } if ($cleaned["full"] != "") - $infoFull = get_photo_info($cleaned["full"]); + $infoFull = Photo::getInfoFromURL($cleaned["full"]); else $infoFull = array("0" => 0, "1" => 0); if ($cleaned["preview"] != "") - $infoPreview = get_photo_info($cleaned["preview"]); + $infoPreview = Photo::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 = Photo::storePhoto($a, $uid, "", $attachment->fullImage->url); + } elseif ($attachment->image->url != "") { + $images = Photo::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))) {