From: Michael Vogel Date: Fri, 6 Apr 2012 12:51:35 +0000 (+0200) Subject: Facebook: The import is now formatted in another way to make it look nicer X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c71fdbf348eb807efb975b1642f3fbcacd08d59b;p=friendica-addons.git Facebook: The import is now formatted in another way to make it look nicer --- diff --git a/facebook/facebook.php b/facebook/facebook.php index 1849cef3..6b433196 100755 --- a/facebook/facebook.php +++ b/facebook/facebook.php @@ -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);