From: Tony Baldwin Date: Sat, 17 Mar 2012 21:53:53 +0000 (-0400) Subject: minor alterations, mostly to ijpost X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f26c87aaeaf4f6e11034729f6e642104a107cfb9;p=friendica-addons.git minor alterations, mostly to ijpost --- diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 4e4d45e2..1717be11 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -166,6 +166,10 @@ function dwpost_send(&$a,&$b) { $dw_password = get_pconfig($b['uid'],'dwpost','dw_password'); $dw_blog = 'http://www.dreamwidth.org/interface/xmlrpc'; + $dw_blog = xmlify(get_pconfig($b['uid'],'dwpost','dw_blog')); + if(! strlen($dw_blog)) + $dw_blog = xmlify('http://www.dreamwidth.org/interface/xmlrpc'); + if($dw_username && $dw_password && $dw_blog) { require_once('include/bbcode.php'); @@ -185,27 +189,40 @@ function dwpost_send(&$a,&$b) { $xml = <<< EOT -LJ.XMLRPC.postevent - - -year$year -mon$mon -day$day -hour$hour -min$min -event$post -username$dw_username -password$dw_password -subject$title -lineendingsunix -ver1 -props - -useragentFriendica -taglist$tags - - - + + LJ.XMLRPC.postevent + + + + username$dw_username + password$dw_password + event$post + subject$title + lineendingsunix + year$year + mon$mon + day$day + hour$hour + min$min + usejournal$lj_username + + props + + + + useragent + Friendica + + + taglist + $tags + + + + + + + EOT; diff --git a/ijpost.tar.gz b/ijpost.tar.gz index 58da8759..635eee21 100644 Binary files a/ijpost.tar.gz and b/ijpost.tar.gz differ diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 4eb1d890..a166e319 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -1,8 +1,8 @@ * 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') . ''; } } @@ -67,9 +67,9 @@ function ijpost_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . t('InsaneJournal Post Settings') . '

'; + $s .= '

' . t('insanejournal Post Settings') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; @@ -84,7 +84,7 @@ function ijpost_settings(&$a,&$s) { $s .= '
'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; @@ -150,7 +150,7 @@ function ijpost_send(&$a,&$b) { if($b['parent'] != $b['id']) return; - // InsaneJournal post in the IJ user's timezone. + // insanejournal post in the LJ user's timezone. // Hopefully the person's Friendica account // will be set to the same thing. @@ -162,16 +162,20 @@ function ijpost_send(&$a,&$b) { if($x && strlen($x[0]['timezone'])) $tz = $x[0]['timezone']; - $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'; + $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'); if($ij_username && $ij_password && $ij_blog) { require_once('include/bbcode.php'); require_once('include/datetime.php'); - $title = $b['title']; + $title = xmlify($b['title']); $post = bbcode($b['body']); $post = xmlify($post); $tags = ijpost_get_tags($b['tag']); @@ -185,27 +189,40 @@ function ijpost_send(&$a,&$b) { $xml = <<< EOT -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 - - - + + 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 + + + + + + + EOT; diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index ddcd2890..717b77c1 100755 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -165,8 +165,6 @@ function ljpost_send(&$a,&$b) { $lj_username = xmlify(get_pconfig($b['uid'],'ljpost','lj_username')); $lj_password = xmlify(get_pconfig($b['uid'],'ljpost','lj_password')); $lj_journal = xmlify(get_pconfig($b['uid'],'ljpost','lj_journal')); -// if(! $lj_journal) -// $lj_journal = $lj_username; $lj_blog = xmlify(get_pconfig($b['uid'],'ljpost','lj_blog')); if(! strlen($lj_blog))