From: friendica Date: Mon, 14 May 2012 23:30:18 +0000 (-0700) Subject: wppost: add optional backlink to Friendica permalink X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4618f2d23d9cf15217e144ffc48eeb9b86fff971;p=friendica-addons.git wppost: add optional backlink to Friendica permalink --- diff --git a/wppost.tgz b/wppost.tgz index b07bf6e0..bf238ba9 100755 Binary files a/wppost.tgz and b/wppost.tgz differ diff --git a/wppost/wppost.css b/wppost/wppost.css index de876958..4ecd81aa 100755 --- a/wppost/wppost.css +++ b/wppost/wppost.css @@ -1,11 +1,13 @@ -#wppost-enable-label, #wppost-username-label, #wppost-password-label, #wppost-blog-label, #wppost-bydefault-label { +#wppost-enable-label, #wppost-username-label, #wppost-password-label, +#wppost-blog-label, #wppost-bydefault-label, #wppost-backlink-label { float: left; width: 200px; margin-top: 10px; } -#wppost-checkbox, #wppost-username, #wppost-password, #wppost-blog, #wppost-bydefault { +#wppost-checkbox, #wppost-username, #wppost-password, +#wppost-blog, #wppost-bydefault, #wppost-backlink { float: left; margin-top: 10px; } diff --git a/wppost/wppost.php b/wppost/wppost.php index 28e4e369..ed39bb38 100755 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -95,6 +95,11 @@ function wppost_settings(&$a,&$s) { $s .= '
'; $s .= ''; $s .= ''; + + $s .= '
'; /* provide a submit button */ @@ -113,6 +118,7 @@ function wppost_settings_post(&$a,&$b) { 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'])); } @@ -189,8 +195,15 @@ function wppost_send(&$a,&$b) { $title = '' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . ''; $post = $title . bbcode($b['body']); + + $wp_backlink = intval(get_pconfig($b['uid'],'wppost','backlink')); + if($wp_backlink && $b['plink']) + $post .= EOL . EOL . '' + . t('Read the original post and comment stream on Friendica') . '' . EOL . EOL; + $post = xmlify($post); + $xml = <<< EOT