X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=ijpost%2Fijpost.php;h=3e57610a3f9454eb1016ee4410bc20c1d69a0a7b;hb=23fe74a97f92f528a153ed24e89906b602ddcabd;hp=a166e319d877c871acb301b9e1335aa0389a6684;hpb=f26c87aaeaf4f6e11034729f6e642104a107cfb9;p=friendica-addons.git diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index a166e319..3e57610a 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -2,7 +2,7 @@ /** * Name: Insanejournal Post Connector - * Description: Post to insanejournal + * Description: Post to Insanejournal * Version: 1.0 * Author: Tony Baldwin * Author: Michael Johnston @@ -36,7 +36,7 @@ function ijpost_jot_nets(&$a,&$b) { $ij_defpost = get_pconfig(local_user(),'ijpost','post_by_default'); $selected = ((intval($ij_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' - . t('Post to insanejournal') . '
'; + . t('Post to Insanejournal') . ''; } } @@ -65,32 +65,37 @@ function ijpost_settings(&$a,&$s) { /* Add some HTML to the existing form */ + $s .= ''; + $s .= '

'. t("InsaneJournal Export").'

'; + $s .= '
'; + $s .= ''; } @@ -162,20 +167,16 @@ function ijpost_send(&$a,&$b) { if($x && strlen($x[0]['timezone'])) $tz = $x[0]['timezone']; - $ij_username = xmlify(get_pconfig($b['uid'],'ijpost','ij_username')); - $ij_password = xmlify(get_pconfig($b['uid'],'ijpost','ij_password')); - $ij_journal = xmlify(get_pconfig($b['uid'],'ijpost','ij_journal')); - - $ij_blog = xmlify(get_pconfig($b['uid'],'ijpost','ij_blog')); - if(! strlen($ij_blog)) - $ij_blog = xmlify('http://www.insanejournal.com/interface/xmlrpc'); + $ij_username = get_pconfig($b['uid'],'ijpost','ij_username'); + $ij_password = get_pconfig($b['uid'],'ijpost','ij_password'); + $ij_blog = 'http://www.insanejournal.com/interface/xmlrpc'; if($ij_username && $ij_password && $ij_blog) { require_once('include/bbcode.php'); require_once('include/datetime.php'); - $title = xmlify($b['title']); + $title = $b['title']; $post = bbcode($b['body']); $post = xmlify($post); $tags = ijpost_get_tags($b['tag']); @@ -189,40 +190,27 @@ function ijpost_send(&$a,&$b) { $xml = <<< EOT - - LJ.XMLRPC.postevent - - - - username$ij_username - password$ij_password - event$post - subject$title - lineendingsunix - year$year - mon$mon - day$day - hour$hour - min$min - usejournal$ij_username - - props - - - - useragent - Friendica - - - taglist - $tags - - - - - - - +LJ.XMLRPC.postevent + + +year$year +mon$mon +day$day +hour$hour +min$min +event$post +username$ij_username +password$ij_password +subject$title +lineendingsunix +ver1 +props + +useragentFriendica +taglist$tags + + + EOT; @@ -230,7 +218,7 @@ EOT; logger('ijpost: data: ' . $xml, LOGGER_DATA); if($ij_blog !== 'test') - $x = post_url($ij_blog,$xml); + $x = post_url($ij_blog,$xml,array("Content-Type: text/xml")); logger('posted to insanejournal: ' . ($x) ? $x : '', LOGGER_DEBUG); }