]> git.mxchange.org Git - friendica-addons.git/commitdiff
Facebook: Don't add "story". Convpath now converts only pictures
authorMichael Vogel <icarus@dabo.de>
Tue, 10 Apr 2012 21:09:06 +0000 (23:09 +0200)
committerMichael Vogel <icarus@dabo.de>
Tue, 10 Apr 2012 21:09:06 +0000 (23:09 +0200)
convpath/convpath.php
facebook/facebook.php

index 5ad7fbcb1f4215ff865a880ee8bfadcfc7f97b15..e5dc0b36705eb0eb42354c2c5cc460fe64464b4d 100644 (file)
@@ -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);
 }
index 5990a99e834ab0308d55481be175cf7751730d99..1e961fda309140484ce3e4070defa16d02966d84 100755 (executable)
@@ -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;