From 6f27beb728c444c908fdfbea818c612b2ae01a74 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 10 Apr 2012 23:09:06 +0200 Subject: [PATCH] Facebook: Don't add "story". Convpath now converts only pictures --- convpath/convpath.php | 7 ++++++- facebook/facebook.php | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/convpath/convpath.php b/convpath/convpath.php index 5ad7fbcb..e5dc0b36 100644 --- a/convpath/convpath.php +++ b/convpath/convpath.php @@ -45,6 +45,11 @@ function convpath_convert($path) { $search = "https://".$a->get_hostname(); $replace = "http://".$a->get_hostname(); } - $path = str_replace($search, $replace, $path); + $searcharr = array("src='".$search, 'src="'.$search); + $replacearr = array("src='".$replace, 'src="'.$replace); + $path = str_replace($searcharr, $replacearr, $path); + + //$path = str_replace($search, $replace, $path); + return($path); } diff --git a/facebook/facebook.php b/facebook/facebook.php index 5990a99e..1e961fda 100755 --- a/facebook/facebook.php +++ b/facebook/facebook.php @@ -1423,10 +1423,19 @@ function fb_consume_stream($uid,$j,$wall = false) { } } + if (($datarray['app'] == "Events") and $entry->actions) + foreach ($entry->actions as $action) + if ($action->name == "View") + $datarray['body'] .= " [url=".$action->link."]".$entry->story."[/url]"; + // Just as a test - to see if these are the missing entries //if(trim($datarray['body']) == '') // $datarray['body'] = $entry->story; + // Adding the "story" text to see if there are useful data in it (testing) + //if (($datarray['app'] != "Events") and $entry->story) + // $datarray['body'] .= "\n".$entry->story; + if(trim($datarray['body']) == '') { logger('facebook: empty body '.$entry->id.' '.print_r($entry, true)); continue; -- 2.39.5