From 690b4a175a44519476d08d0b0c8caf8ef66c7b74 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 13 Jan 2013 12:24:17 +0100 Subject: [PATCH] Twitter: added App name config to admin panel --- twitter/README | 7 ++----- twitter/twitter.php | 5 ++++- twitter/view/admin.tpl | 1 + twitter/view/smarty3/admin.tpl | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/twitter/README b/twitter/README index ff08976c..8041f317 100755 --- a/twitter/README +++ b/twitter/README @@ -3,17 +3,14 @@ By Tobias Diekershoff http://diekershoff.homeunix.net/friendika/profile/tobias tobias.diekershoff(at)gmx.net -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! This addon is currently under development. If you have any problem !! -!! with it, please contact the Author. !! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - With this addon to Friendica you can give your user the possibility to post their *public* messages to Twitter. The messages will be strapped their rich context and shortened to 140 characters length if necessary. If shortening of the message was performed a link will be added to the Tweet pointing to the original message on your server. +The addon can also mirror a users Tweets into the ~friendica wall. + There is a similar addon for forwarding public messages to "StatusNet":http://status.net [[StatusNet Plugin]]. diff --git a/twitter/twitter.php b/twitter/twitter.php index 88cf3858..7bf01eff 100755 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -543,8 +543,10 @@ function twitter_post_hook(&$a,&$b) { function twitter_plugin_admin_post(&$a){ $consumerkey = ((x($_POST,'consumerkey')) ? notags(trim($_POST['consumerkey'])) : ''); $consumersecret = ((x($_POST,'consumersecret')) ? notags(trim($_POST['consumersecret'])): ''); + $applicationname = ((x($_POST, 'application-name')) ? notags(trin($_POST['applicationname'])):''); set_config('twitter','consumerkey',$consumerkey); set_config('twitter','consumersecret',$consumersecret); + set_config('twitter','application_name',$applicationname); info( t('Settings updated.'). EOL ); } function twitter_plugin_admin(&$a, &$o){ @@ -554,7 +556,8 @@ function twitter_plugin_admin(&$a, &$o){ '$submit' => t('Submit'), // name, label, value, help, [extra values] '$consumerkey' => array('consumerkey', t('Consumer key'), get_config('twitter', 'consumerkey' ), ''), - '$consumersecret' => array('consumersecret', t('Consumer secret'), get_config('twitter', 'consumersecret' ), '') + '$consumersecret' => array('consumersecret', t('Consumer secret'), get_config('twitter', 'consumersecret' ), ''), + '$applicationname' => array('applicationname', t('Name of the Twitter Application'), get_config('twitter','applicationname'),t('set this to avoid mirroring postings from ~friendica back to ~friendica')) )); } diff --git a/twitter/view/admin.tpl b/twitter/view/admin.tpl index a83eb07a..b89f51b6 100644 --- a/twitter/view/admin.tpl +++ b/twitter/view/admin.tpl @@ -1,3 +1,4 @@ {{ inc field_input.tpl with $field=$consumerkey }}{{ endinc }} {{ inc field_input.tpl with $field=$consumersecret }}{{ endinc }} +{{ inc field_input.tpl with $field=$applicationname }}{{ endinc }}
diff --git a/twitter/view/smarty3/admin.tpl b/twitter/view/smarty3/admin.tpl index 9efcb065..554ed5a0 100644 --- a/twitter/view/smarty3/admin.tpl +++ b/twitter/view/smarty3/admin.tpl @@ -1,3 +1,4 @@ {{include file="field_input.tpl" field=$consumerkey}} {{include file="field_input.tpl" field=$consumersecret}} +{{include file="field_input.tpl" field=$applicationname}}