]> git.mxchange.org Git - friendica-addons.git/blobdiff - wppost/wppost.php
updated some descriptions
[friendica-addons.git] / wppost / wppost.php
old mode 100644 (file)
new mode 100755 (executable)
index b987778..6db0d94
@@ -2,6 +2,7 @@
 
 /**
  * Name: WordPress Post Connector
+ * Description: Post to WordPress (or anything else which uses blogger XMLRPC API)
  * Version: 1.0
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  */
@@ -132,9 +133,9 @@ function wppost_post_local(&$a,&$b) {
 
     $wp_post   = intval(get_pconfig(local_user(),'wppost','post'));
 
-       $wp_enable = (($wp_post && x($_POST,'wppost_enable')) ? intval($_POST['wppost_enable']) : 0);
+       $wp_enable = (($wp_post && x($_REQUEST,'wppost_enable')) ? intval($_REQUEST['wppost_enable']) : 0);
 
-       if($_POST['api_source'] && intval(get_pconfig(local_user(),'wppost','post_by_default')))
+       if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'wppost','post_by_default')))
                $wp_enable = 1;
 
     if(! $wp_enable)
@@ -168,9 +169,9 @@ function wppost_send(&$a,&$b) {
 
                require_once('include/bbcode.php');
 
-               $post = (($b['title']) ? '<title>' . $b['title'] . '</title>' : '');
-               $post .= bbcode($b['body']);
-                       $post = xmlify($post);
+               $title = '<title>' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . '</title>';
+               $post = $title . bbcode($b['body']);
+               $post = xmlify($post);
 
                $xml = <<< EOT
 
@@ -193,7 +194,7 @@ EOT;
 
                if($wp_blog !== 'test')
                        $x = post_url($wp_blog,$xml);
-               logger('posted to wordpress');
+               logger('posted to wordpress: ' . ($x) ? $x : '');
 
        }
 }