diff --git a/addon/facebook/facebook.css b/addon/facebook/facebook.css new file mode 100644 index 0000000000..3df65706fa --- /dev/null +++ b/addon/facebook/facebook.css @@ -0,0 +1,8 @@ + +#facebook-enable-wrapper { + margin-top: 20px; +} + +#facebook-disable-wrapper { + margin-top: 20px; +} diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index e989c90ea1..876a9740ba 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -114,14 +114,18 @@ function facebook_content(&$a) { return ''; } + $a->page['htmlhead'] .= '' . "\r\n"; + $o .= '

' . t('Facebook Connect') . '

'; - $o .= '
'; + $o .= '
'; $o .= '' . t('Install Facebook post connector') . '

'; + . $a->get_baseurl() . '/facebook/' . $a->user['nickname'] . '&scope=publish_stream,read_stream,offline_access">' . t('Install Facebook post connector') . ''; + $o .= '
'; - $o .= '' . t('Remove Facebook post connector') . '
'; + $o .= '' . t('Remove Facebook post connector') . '
'; return $o; @@ -143,8 +147,10 @@ function facebook_uninstall() { function facebook_plugin_settings(&$a,&$b) { + $b .= '
'; $b .= '

' . t('Facebook') . '

'; $b .= '' . t('Facebook Connector Settings') . '
'; + $b .= '
'; } diff --git a/addon/randplace/randplace.php b/addon/randplace/randplace.php index d7ea65c9d2..fa38de3776 100644 --- a/addon/randplace/randplace.php +++ b/addon/randplace/randplace.php @@ -167,6 +167,7 @@ function randplace_settings(&$a,&$s) { /* Add some HTML to the existing form */ + $s .= '
'; $s .= '

' . t('Randplace Settings') . '

'; $s .= '
'; $s .= ''; @@ -175,6 +176,6 @@ function randplace_settings(&$a,&$s) { /* provide a submit button */ - $s .= '
'; + $s .= '
'; } \ No newline at end of file diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 7928003bcd..e595ad7b53 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -63,6 +63,22 @@ function statusnet_uninstall() { unregister_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); } +function statusnet_jot_nets(&$a,&$b) { + if(! local_user()) + return; + + $statusnet_post = get_pconfig(local_user(),'statusnet','post'); + if(intval($statusnet_post) == 1) { + $statusnet_defpost = get_pconfig(local_user(),'statusnet','post_by_default'); + $selected = ((intval($statusnet_defpost == 1)) ? ' selected="selected" ' : ''); + $b .= '
' + . t('Post to StatusNet') . '
'; + } +} + + + + function statusnet_settings_post ($a,$post) { if(! local_user()) return; @@ -123,7 +139,8 @@ function statusnet_settings(&$a,&$s) { $osecret = get_pconfig(local_user(), 'statusnet', 'oauthsecret' ); $enabled = get_pconfig(local_user(), 'statusnet', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); - $s .= '

'.t('StatusNet Posting Settings').'

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

'. t('StatusNet Posting Settings').'

'; if ( (!$ckey) && (!$csecret) ) { /*** @@ -185,7 +202,7 @@ function statusnet_settings(&$a,&$s) { $s .= '
'; } } - $s .= '
'; + $s .= '
'; } @@ -210,8 +227,9 @@ function statusnet_post_hook(&$a,&$b) { if($ckey && $csecret && $otoken && $osecret) { $statusnet_post = get_pconfig(local_user(),'statusnet','post'); + $statusnet_enable = (($statusnet_post && x($_POST,'statusnet_enable')) ? intval($_POST['statusnet_enable']) : 0); - if($statusnet_post) { + if($statusnet_enable && $statusnet_post) { require_once('include/bbcode.php'); $dent = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret); $max_char = $dent->get_maxlength(); // max. length for a dent @@ -241,6 +259,6 @@ function statusnet_post_hook(&$a,&$b) { $dent->post('statuses/update', array('status' => $msg)); } } - } + } } diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php index 509297d4ec..0fd891d208 100644 --- a/addon/twitter/twitter.php +++ b/addon/twitter/twitter.php @@ -41,7 +41,6 @@ function twitter_install() { register_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); register_hook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook'); register_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets'); - register_hook('post_local_start', 'addon/twitter/twitter.php', 'twitter_post_start'); logger("installed twitter"); } @@ -51,8 +50,6 @@ function twitter_uninstall() { unregister_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); unregister_hook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook'); unregister_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets'); - unregister_hook('post_local_start', 'addon/twitter/twitter.php', 'twitter_post_start'); - } function twitter_jot_nets(&$a,&$b) { @@ -70,19 +67,6 @@ function twitter_jot_nets(&$a,&$b) { } -function twitter_post_start(&$a,&$b) { - if(! local_user()) - return; - - if((x($b,'twitter_enable')) && (intval($b['twitter_enable']))) - set_pconfig(local_user(),'twitter','enable','1'); - else - del_pconfig(local_user(),'twitter','enable'); - - -} - - function twitter_settings_post ($a,$post) { if(! local_user()) return; @@ -134,6 +118,7 @@ function twitter_settings(&$a,&$s) { $osecret = get_pconfig(local_user(), 'twitter', 'oauthsecret' ); $enabled = get_pconfig(local_user(), 'twitter', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); + $s .= '
'; $s .= '

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

'; if ( (!$ckey) && (!$csecret) ) { @@ -167,8 +152,8 @@ function twitter_settings(&$a,&$s) { $s .= ''; $s .= ''; $s .= ''; - $s .= '
'; - $s .= '
'; + $s .= '
'; + $s .= '
'; } else { /*** * we have an OAuth key / secret pair for the user @@ -190,7 +175,7 @@ function twitter_settings(&$a,&$s) { $s .= '
'; } } - $s .= '
'; + $s .= '
'; } @@ -213,11 +198,11 @@ function twitter_post_hook(&$a,&$b) { if($ckey && $csecret && $otoken && $osecret) { - $twitter_post = get_pconfig(local_user(),'twitter','post'); - $twitter_enable = intval(get_pconfig(local_user(),'twitter','enable')); + $twitter_post = intval(get_pconfig(local_user(),'twitter','post')); + $twitter_enable = (($twitter_post && x($_POST,'twitter_enable')) ? intval($_POST['twitter_enable']) : 0); if($twitter_post && $twitter_enable) { - require_once('addon/twitter/twitteroauth.php'); + require_once('library/twitteroauth.php'); require_once('include/bbcode.php'); $tweet = new TwitterOAuth($ckey,$csecret,$otoken,$osecret); $max_char = 140; // max. length for a tweet diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index a820c381cf..9b18b5c41c 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2025,3 +2025,9 @@ a.mail-list-link { .today { color: #FF0000; } + +.settings-block { + border: 1px solid #AAA; + margin: 10px; + padding: 10px; +} diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 145123aaf6..256c98d8e7 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -2073,3 +2073,10 @@ a.mail-list-link { .today { color: #FF0000; } + + +.settings-block { + border: 1px solid #AAA; + margin: 10px; + padding: 10px; +}