From bc7035408a17437eb46457389d8911512812b8fd Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 8 Mar 2011 01:43:42 -0800 Subject: twitteroauth library path --- addon/twitter/twitter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addon') diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php index b2e5aa7ce..db283e1a9 100644 --- a/addon/twitter/twitter.php +++ b/addon/twitter/twitter.php @@ -138,7 +138,7 @@ function twitter_settings(&$a,&$s) { * which the user can request a PIN to connect the account to a * account at Twitter. */ - require_once('addon/twitter/twitteroauth.php'); + require_once('library/twitteroauth.php'); $connection = new TwitterOAuth($ckey, $csecret); $request_token = $connection->getRequestToken(); $token = $request_token['oauth_token']; -- cgit v1.2.3 From 1c779e20618baf0d348ad52bc877d9a7a7923641 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 9 Mar 2011 14:39:18 -0800 Subject: fb "post by default" implemented, post_by_default logic fixed for other plugins --- addon/facebook/facebook.css | 5 +++++ addon/facebook/facebook.php | 39 +++++++++++++++++++++++++++++++-------- addon/statusnet/statusnet.php | 2 +- addon/twitter/twitter.php | 2 +- 4 files changed, 38 insertions(+), 10 deletions(-) (limited to 'addon') diff --git a/addon/facebook/facebook.css b/addon/facebook/facebook.css index 3df65706f..0c164331e 100644 --- a/addon/facebook/facebook.css +++ b/addon/facebook/facebook.css @@ -6,3 +6,8 @@ #facebook-disable-wrapper { margin-top: 20px; } + +#facebook-post-default-form input { + margin-top: 20px; + margin-right: 20px; +} \ No newline at end of file diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index d4d4cc443..edfc5a374 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -95,6 +95,15 @@ function facebook_init(&$a) { } +function facebook_post(&$a) { + + if(local_user()){ + $value = ((x($_POST,'post_by_default')) ? intval($_POST['post_by_default']) : 0); + set_pconfig(local_user(),'facebook','post_by_default', $value); + } + return; +} + function facebook_content(&$a) { if(! local_user()) { @@ -107,6 +116,8 @@ function facebook_content(&$a) { notice( t('Facebook disabled') . EOL); } + $fb_installed = get_pconfig(local_user(),'facebook','post'); + $appid = get_config('facebook','appid'); if(! $appid) { @@ -119,14 +130,26 @@ function facebook_content(&$a) { $o .= '

' . t('Facebook Connect') . '

'; - $o .= '
'; + if(! $fb_installed) { + $o .= ''; + $o .= '' . t('Install Facebook post connector') . ''; + $o .= '
'; + } + if($fb_installed) { + $o .= ''; + + $o .= '
'; + $o .= '
'; + $post_by_default = get_pconfig(local_user(),'facebook','post_by_default'); + $checked = (($post_by_default) ? ' checked="checked" ' : ''); + $o .= '' . ' ' . t('Post to Facebook by default') . '
'; + $o .= '
'; + } return $o; } @@ -161,7 +184,7 @@ function facebook_jot_nets(&$a,&$b) { $fb_post = get_pconfig(local_user(),'facebook','post'); if(intval($fb_post) == 1) { $fb_defpost = get_pconfig(local_user(),'facebook','post_by_default'); - $selected = ((intval($fb_defpost == 1)) ? ' selected="selected" ' : ''); + $selected = ((intval($fb_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' . t('Post to Facebook') . '
'; } @@ -202,7 +225,7 @@ function facebook_post_hook(&$a,&$b) { // make links readable before we strip the code - $msg = preg_replace("/\[url=(.+?)\](.+?)\[\/url\]/is",'$2 ($1)',$msg); + $msg = preg_replace("/\[url=(.+?)\](.+?)\[\/url\]/is",'$2 [$1]',$msg); $msg = preg_replace("/\[img\](.+?)\[\/img\]/is", t('Image: ') . '$1',$msg); diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 1deb030c1..f763cd0c3 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -73,7 +73,7 @@ function statusnet_jot_nets(&$a,&$b) { $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" ' : ''); + $selected = ((intval($statusnet_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' . t('Post to StatusNet') . '
'; } diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php index db283e1a9..bb424fb65 100644 --- a/addon/twitter/twitter.php +++ b/addon/twitter/twitter.php @@ -59,7 +59,7 @@ function twitter_jot_nets(&$a,&$b) { $tw_post = get_pconfig(local_user(),'twitter','post'); if(intval($tw_post) == 1) { $tw_defpost = get_pconfig(local_user(),'twitter','post_by_default'); - $selected = ((intval($tw_defpost == 1)) ? ' selected="selected" ' : ''); + $selected = ((intval($tw_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' . t('Post to Twitter') . '
'; } -- cgit v1.2.3