X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tumblr%2Ftumblr.php;h=03a67949b3ec299f439c95166a13b0d235317f7a;hb=bf2d3a835690697eafc5f6ec8fda9a0dcb34a42f;hp=42518c050085045b182b8cc9992d83d48d215137;hpb=64c68ac97815a516d36fa0f6c0b4734adf0f621c;p=friendica-addons.git diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 42518c05..03a67949 100755 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -32,7 +32,7 @@ function tumblr_jot_nets(&$a,&$b) { if(intval($tmbl_post) == 1) { $tmbl_defpost = get_pconfig(local_user(),'tumblr','post_by_default'); $selected = ((intval($tmbl_defpost) == 1) ? ' checked="checked" ' : ''); - $b .= '
' + $b .= '
' . t('Post to Tumblr') . '
'; } } @@ -170,12 +170,13 @@ function tumblr_send(&$a,&$b) { $link = ""; $video = false; + $title = trim($b['title']); // Checking for a bookmark if(preg_match("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/is",$b['body'],$matches)) { $link = $matches[1]; - if ($b['title'] == '') - $b['title'] = html_entity_decode($matches[2],ENT_QUOTES,'UTF-8'); + if ($title == '') + $title = html_entity_decode($matches[2],ENT_QUOTES,'UTF-8'); $body = $b['body']; // splitting the text in two parts: @@ -201,15 +202,20 @@ function tumblr_send(&$a,&$b) { if (($link != '') and $video) { $params['type'] = "video"; $params['embed'] = $link; - $params['caption'] = bbcode($body); + if ($title != '') + $params['caption'] = '

'.$title. + "

".bbcode($body)."

"; + else + $params['caption'] = bbcode($body); } else if (($link != '') and !$video) { $params['type'] = "link"; - $params['name'] = $b['title']; + $params['name'] = $title; $params['url'] = $link; - $params['description'] = bbcode($body); + //$params['description'] = bbcode($body); + $params['description'] = bbcode($b["body"]); } else { $params['type'] = "regular"; - $params['title'] = $b['title']; + $params['title'] = $title; $params['body'] = bbcode($b['body']); }