diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 062884b967..bf6cbfbc71 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -1,7 +1,7 @@ */ @@ -276,7 +276,7 @@ function statusnet_settings(&$a,&$s) { $connection = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret); $details = $connection->get('account/verify_credentials'); $s .= '

'. t('Currently connected to: ') .''.$details->screen_name.'
'.$details->description.'

'; - $s .= '

'. t('If enabled all your public postings will be posted to the associated StatusNet account.') .'

'; + $s .= '

'. t('If enabled all your public postings can be posted to the associated StatusNet account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') .'

'; $s .= '
'; $s .= ''; $s .= ''; diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php index 26b324acaa..1c5fe4e4ad 100644 --- a/addon/twitter/twitter.php +++ b/addon/twitter/twitter.php @@ -1,7 +1,7 @@ */ @@ -87,7 +87,8 @@ function twitter_settings_post ($a,$post) { */ del_pconfig( local_user(), 'twitter', 'consumerkey' ); del_pconfig( local_user(), 'twitter', 'consumersecret' ); - del_pconfig( local_user(), 'twitter', 'post' ); + del_pconfig( local_user(), 'twitter', 'post' ); + del_pconfig( local_user(), 'twitter', 'post_by_default' ); } else { if (isset($_POST['twitter-pin'])) { // if the user supplied us with a PIN from Twitter, let the magic of OAuth happen @@ -105,11 +106,13 @@ function twitter_settings_post ($a,$post) { set_pconfig(local_user(),'twitter', 'oauthsecret', $token['oauth_token_secret']); set_pconfig(local_user(),'twitter', 'post', 1); // reload the Addon Settings page, if we don't do it see Bug #42 - header('Location: '.$a->get_baseurl().'/settings/addon'); + goaway($a->get_baseurl().'/settings/addon'); } else { // if no PIN is supplied in the POST variables, the user has changed the setting // to post a tweet for every new __public__ posting to the wall set_pconfig(local_user(),'twitter','post',intval($_POST['twitter-enable'])); + set_pconfig(local_user(),'twitter','post_by_default',intval($_POST['twitter-default'])); + info( t('Twitter settings updated.') . EOL); }} } function twitter_settings(&$a,&$s) { @@ -127,6 +130,9 @@ function twitter_settings(&$a,&$s) { $osecret = get_pconfig(local_user(), 'twitter', 'oauthsecret' ); $enabled = get_pconfig(local_user(), 'twitter', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); + $defenabled = get_pconfig(local_user(),'twitter','post_by_default'); + $defchecked = (($defenabled) ? ' checked="checked" ' : ''); + $s .= '
'; $s .= '

'. t('Twitter Posting Settings') .'

'; @@ -172,11 +178,14 @@ function twitter_settings(&$a,&$s) { $connection = new TwitterOAuth($ckey,$csecret,$otoken,$osecret); $details = $connection->get('account/verify_credentials'); $s .= '

'. t('Currently connected to: ') .''.$details->screen_name.'
'.$details->description.'

'; - $s .= '

'. t('If enabled all your public postings will be posted to the associated Twitter account as well.') .'

'; + $s .= '

'. t('If enabled all your public postings can be posted to the associated Twitter account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') .'

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; - $s .= '
'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; $s .= ''; $s .= '';