* Version: 1.0
* Author: Tony Baldwin <http://tonybaldwin.me/friendica/profile/tony>
* Author: Michael Johnston
+ * Author: Cat Gray <https://free-haven.org/profile/catness>
*/
function dwpost_install() {
$title = $b['title'];
$post = bbcode($b['body']);
$post = xmlify($post);
+ $tags = dwpost_get_tags($b['tag']);
$date = datetime_convert('UTC',$tz,$b['created'],'Y-m-d H:i:s');
$year = intval(substr($date,0,4));
<member><name>props</name>
<value><struct>
<member><name>useragent</name><value><string>Friendica</string></value></member>
-<member><name>taglist</name><value><string>friendica</string></value></member>
+<member><name>taglist</name><value><string>$tags</string></value></member>
</struct></value></member>
</struct></value>
</param></params>
}
}
+function dwpost_get_tags($post)
+{
+ preg_match_all("/\]([^\[#]+)\[/",$post,$matches);
+ $tags = implode(', ',$matches[1]);
+ return $tags;
+}
* Version: 1.0
* Author: Tony Baldwin <http://tonybaldwin.me/friendica/profile/tony>
* Author: Michael Johnston
+ * Author: Cat Gray <https://free-haven.org/profile/catness>
*/
function ljpost_install() {
$title = xmlify($b['title']);
$post = bbcode($b['body']);
$post = xmlify($post);
+ $tags = ljpost_get_tags($b['tag']);
$date = datetime_convert('UTC',$tz,$b['created'],'Y-m-d H:i:s');
$year = intval(substr($date,0,4));
<name>useragent</name>
<value><string>Friendica</string></value>
</member>
+ <member>
+ <name>taglist</name>
+ <value><string>$tags</string></value>
+ </member>
</struct>
</value>
</member>
}
}
+function ljpost_get_tags($post)
+{
+ preg_match_all("/\]([^\[#]+)\[/",$post,$matches);
+ $tags = implode(', ',$matches[1]);
+ return $tags;
+}