]> git.mxchange.org Git - friendica-addons.git/commitdiff
Facebook: The import is now formatted in another way to make it look nicer
authorMichael Vogel <icarus@dabo.de>
Fri, 6 Apr 2012 12:51:35 +0000 (14:51 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 6 Apr 2012 12:51:35 +0000 (14:51 +0200)
facebook/facebook.php

index 1849cef33485b0fe6136ab1d78f3d953fadda24f..6b433196c975e02a5603916a234ce27aa752a843 100755 (executable)
@@ -1333,22 +1333,35 @@ function fb_consume_stream($uid,$j,$wall = false) {
 
                        $datarray['body'] = escape_tags($entry->message);
 
+                       if($entry->name and $entry->link)
+                               $datarray['body'] .= "\n\n[bookmark=".$entry->link."]".$entry->name."[/bookmark]";
+                       elseif ($entry->name)
+                               $datarray['body'] .= "\n\n[b]" . $entry->name."[/b]";
+
+                       if($entry->caption) {
+                               if(!$entry->name and $entry->link)
+                                       $datarray['body'] .= "\n\n[bookmark=".$entry->link."]".$entry->caption."[/bookmark]";
+                               else
+                                       $datarray['body'] .= "[i]" . $entry->caption."[/i]\n";
+                       }
+
+                       if(!$entry->caption and !$entry->name)
+                               $datarray['body'] .= "\n";
+
+                       if($entry->description)
+                               $datarray['body'] .= "\n[quote]" . $entry->description."[/quote]";
+
                        if($entry->picture && $entry->link) {
-                               $datarray['body'] .= "\n\n" . '[url=' . $entry->link . '][img]' . $entry->picture . '[/img][/url]';
+                               $datarray['body'] .= "\n" . '[url=' . $entry->link . '][img]' . $entry->picture . '[/img][/url]';
                        }
                        else {
                                if($entry->picture)
-                                       $datarray['body'] .= "\n\n" . '[img]' . $entry->picture . '[/img]';
+                                       $datarray['body'] .= "\n" . '[img]' . $entry->picture . '[/img]';
                                // if just a link, it may be a wall photo - check
                                if($entry->link)
                                        $datarray['body'] .= fb_get_photo($uid,$entry->link);
                        }
-                       if($entry->name)
-                               $datarray['body'] .= "\n" . $entry->name;
-                       if($entry->caption)
-                               $datarray['body'] .= "\n" . $entry->caption;
-                       if($entry->description)
-                               $datarray['body'] .= "\n" . $entry->description;
+
                        $datarray['created'] = datetime_convert('UTC','UTC',$entry->created_time);
                        $datarray['edited'] = datetime_convert('UTC','UTC',$entry->updated_time);