$s .= '<div id="wppost-bydefault-wrapper">';
$s .= '<label id="wppost-bydefault-label" for="wppost-bydefault">' . t('Post to WordPress by default') . '</label>';
$s .= '<input id="wppost-bydefault" type="checkbox" name="wp_bydefault" value="1" ' . $def_checked . '/>';
+
+ $s .= '<div id="wppost-backlink-wrapper">';
+ $s .= '<label id="wppost-backlink-label" for="wppost-backlink">' . t('Provide a backlink to the Friendica post') . '</label>';
+ $s .= '<input id="wppost-backlink" type="checkbox" name="wp_backlink" value="1" ' . $def_checked . '/>';
+
$s .= '</div><div class="clear"></div>';
/* provide a submit button */
set_pconfig(local_user(),'wppost','wp_username',trim($_POST['wp_username']));
set_pconfig(local_user(),'wppost','wp_password',trim($_POST['wp_password']));
set_pconfig(local_user(),'wppost','wp_blog',trim($_POST['wp_blog']));
+ set_pconfig(local_user(),'wppost','backlink',trim($_POST['wp_backlink']));
}
$title = '<title>' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . '</title>';
$post = $title . bbcode($b['body']);
+
+ $wp_backlink = intval(get_pconfig($b['uid'],'wppost','backlink'));
+ if($wp_backlink && $b['plink'])
+ $post .= EOL . EOL . '<a href="' . $b['plink'] . '">'
+ . t('Read the original post and comment stream on Friendica') . '</a>' . EOL . EOL;
+
$post = xmlify($post);
+
$xml = <<< EOT
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<methodCall>