From c7ef806b7210f3c73cf2fcd4c2e1b0a9a0ea322c Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 13 Nov 2011 16:06:36 -0800 Subject: [PATCH] tumblr - add tagging --- tumblr/tumblr.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 25a0287c..b4de0f3c 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -155,6 +155,19 @@ function tumblr_send(&$a,&$b) { require_once('include/bbcode.php'); + $tag_arr = array(); + $tags = ''; + $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER); + + if($x) { + foreach($matches as $mtch) { + $tag_arr[] = $mtch[2]; + } + } + if(count($tag_arr)) + $tags = implode(',',$tag_arr); + + $params = array( 'email' => $tmbl_username, 'password' => $tmbl_password, @@ -162,6 +175,7 @@ function tumblr_send(&$a,&$b) { 'type' => 'regular', 'format' => 'html', 'generator' => 'Friendica', + 'tags' => $tags, 'body' => bbcode($b['body']) );