Removed some stuff from another branch

This commit is contained in:
Michael Vogel 2014-10-19 00:26:06 +02:00
parent 39cc0fe4cb
commit 8c5ee7e062
2 changed files with 2 additions and 23 deletions

View file

@ -967,21 +967,8 @@ function fbpost_cron($a,$b) {
set_config('facebook','last_poll', time()); set_config('facebook','last_poll', time());
} }
function fbpost_cleanpicture($url) {
require_once("include/Photo.php");
$urldata = parse_url($url);
if (isset($urldata["query"])) {
parse_str($urldata["query"], $querydata);
if (isset($querydata["url"]) AND (get_photo_info($querydata["url"])))
return($querydata["url"]);
}
return($url);
}
function fbpost_fetchwall($a, $uid) { function fbpost_fetchwall($a, $uid) {
require_once("include/oembed.php"); require_once("include/oembed.php");
require_once("include/network.php");
require_once('mod/item.php'); require_once('mod/item.php');
$access_token = get_pconfig($uid,'facebook','access_token'); $access_token = get_pconfig($uid,'facebook','access_token');
@ -1042,7 +1029,6 @@ function fbpost_fetchwall($a, $uid) {
$type = ""; $type = "";
if(isset($item->name) and isset($item->link)) { if(isset($item->name) and isset($item->link)) {
$item->link = original_url($item->link);
$oembed_data = oembed_fetch_url($item->link); $oembed_data = oembed_fetch_url($item->link);
$type = $oembed_data->type; $type = $oembed_data->type;
$content = "[bookmark=".$item->link."]".$item->name."[/bookmark]"; $content = "[bookmark=".$item->link."]".$item->name."[/bookmark]";
@ -1085,12 +1071,9 @@ function fbpost_fetchwall($a, $uid) {
} }
} }
$picture = fbpost_cleanpicture($picture); if(($picture != "") && isset($item->link))
if(($picture != "") && isset($item->link)) {
$item->link = original_url($item->link);
$content .= "\n".'[url='.$item->link.'][img]'.$picture.'[/img][/url]'; $content .= "\n".'[url='.$item->link.'][img]'.$picture.'[/img][/url]';
} else { else {
if ($picture != "") if ($picture != "")
$content .= "\n".'[img]'.$picture.'[/img]'; $content .= "\n".'[img]'.$picture.'[/img]';
// if just a link, it may be a wall photo - check // if just a link, it may be a wall photo - check

View file

@ -216,7 +216,6 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr
$access_token = get_pconfig($uid,'facebook','access_token'); $access_token = get_pconfig($uid,'facebook','access_token');
require_once("include/oembed.php"); require_once("include/oembed.php");
require_once("include/network.php");
// check if it was already imported // check if it was already imported
$r = q("SELECT * FROM `item` WHERE `uid` = %d AND `uri` = '%s' LIMIT 1", $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `uri` = '%s' LIMIT 1",
@ -340,7 +339,6 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr
$type = ""; $type = "";
if (isset($post->attachment->name) and isset($post->attachment->href)) { if (isset($post->attachment->name) and isset($post->attachment->href)) {
$post->attachment->href = original_url($post->attachment->href);
$oembed_data = oembed_fetch_url($post->attachment->href); $oembed_data = oembed_fetch_url($post->attachment->href);
$type = $oembed_data->type; $type = $oembed_data->type;
if ($type == "rich") if ($type == "rich")
@ -393,8 +391,6 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr
} }
} }
$preview = fbpost_cleanpicture($preview);
if (isset($media->href) AND ($preview != "") AND ($media->href != "")) if (isset($media->href) AND ($preview != "") AND ($media->href != ""))
$content .= "\n".'[url='.$media->href.'][img]'.$preview.'[/img][/url]'; $content .= "\n".'[url='.$media->href.'][img]'.$preview.'[/img][/url]';
else { else {