/**
* 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>
*/
$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)
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
if($wp_blog !== 'test')
$x = post_url($wp_blog,$xml);
- logger('posted to wordpress');
+ logger('posted to wordpress: ' . ($x) ? $x : '');
}
}