From: friendica Date: Mon, 5 Dec 2011 01:33:08 +0000 (-0800) Subject: more FB link improvements X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=28405bfeb694515f2a569dae2c08dcbe2250d76e;p=friendica-addons.git more FB link improvements --- diff --git a/facebook.tgz b/facebook.tgz index 174a2890..0e6623f9 100644 Binary files a/facebook.tgz and b/facebook.tgz differ diff --git a/facebook/facebook.php b/facebook/facebook.php index db3382fc..a103f2e8 100644 --- a/facebook/facebook.php +++ b/facebook/facebook.php @@ -928,10 +928,16 @@ function fb_consume_stream($uid,$j,$wall = false) { $datarray['plink'] = $datarray['author-link'] . '&v=wall&story_fbid=' . substr($entry->id,strpos($entry->id,'_') + 1); $datarray['body'] = $entry->message; - if($entry->picture) - $datarray['body'] .= "\n\n" . '[img]' . $entry->picture . '[/img]'; - if($entry->link) - $datarray['body'] .= "\n" . '[url=' . $entry->link . ']' . t('link') . '[/url]'; + + if($entry->picture && $entry->link) { + $datarray['body'] .= "\n\n" . '[url=' . $entry->link . '][img]' . $entry->picture . '[/img][/url]'; + } + else { + if($entry->picture) + $datarray['body'] .= "\n\n" . '[img]' . $entry->picture . '[/img]'; + if($entry->link) + $datarray['body'] .= "\n" . '[url=' . $entry->link . ']' . t('link') . '[/url]'; + } if($entry->name) $datarray['body'] .= "\n" . $entry->name; if($entry->caption)