]> git.mxchange.org Git - friendica-addons.git/commitdiff
tumblr - add tagging
authorfriendica <info@friendica.com>
Mon, 14 Nov 2011 00:06:36 +0000 (16:06 -0800)
committerfriendica <info@friendica.com>
Mon, 14 Nov 2011 00:06:36 +0000 (16:06 -0800)
tumblr/tumblr.php

index 25a0287cd6d7631a404cd11f54f0b6043cd140ba..b4de0f3c1a5ca38a74508e80943e7d96d110381d 100644 (file)
@@ -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'])
                );