From: Tony Baldwin Date: Sat, 17 Mar 2012 21:30:21 +0000 (-0400) Subject: added Cat's tag stuff to ijpost X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=06e04aca2ff0665a90028e70d3f8ba6a8f173eb2;p=friendica-addons.git added Cat's tag stuff to ijpost --- diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 85e808c0..4e4d45e2 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -150,7 +150,7 @@ function dwpost_send(&$a,&$b) { if($b['parent'] != $b['id']) return; - // dreamwidth post in the LJ user's timezone. + // dreamwidth post in the DW user's timezone. // Hopefully the person's Friendica account // will be set to the same thing. diff --git a/ijpost.tar.gz b/ijpost.tar.gz index c274902c..58da8759 100644 Binary files a/ijpost.tar.gz and b/ijpost.tar.gz differ diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 20d4f81d..4eb1d890 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -5,6 +5,8 @@ * Description: Post to insanejournal * Version: 1.0 * Author: Tony Baldwin + * Author: Michael Johnston + * Author: Cat Gray */ function ijpost_install() { @@ -172,6 +174,7 @@ function ijpost_send(&$a,&$b) { $title = $b['title']; $post = bbcode($b['body']); $post = xmlify($post); + $tags = ijpost_get_tags($b['tag']); $date = datetime_convert('UTC',$tz,$b['created'],'Y-m-d H:i:s'); $year = intval(substr($date,0,4)); @@ -199,7 +202,7 @@ function ijpost_send(&$a,&$b) { props useragentFriendica -taglistfriendica +taglist$tags @@ -216,3 +219,9 @@ EOT; } } +function ijpost_get_tags($post) +{ + preg_match_all("/\]([^\[#]+)\[/",$post,$matches); + $tags = implode(', ',$matches[1]); + return $tags; +}