From d995fc3994a065d068679edb09afd03483079f10 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 15 May 2015 20:56:05 +0200 Subject: [PATCH 1/2] The intelligent shortening for social media systems like Twitter, GNU Social and App.net can now be disabled. --- include/plaintext.php | 2 ++ mod/settings.php | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/plaintext.php b/include/plaintext.php index 88febbfff..c8cdfa57d 100644 --- a/include/plaintext.php +++ b/include/plaintext.php @@ -182,6 +182,8 @@ function plaintext($a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2) { $post["url"] = $b["plink"]; } elseif (strpos($b["body"], "[share") !== false) $post["url"] = $b["plink"]; + elseif (get_pconfig($b["uid"], "system", "no_intelligent_shortening")) + $post["url"] = $b["plink"]; $msg = shortenmsg($msg, $limit); } diff --git a/mod/settings.php b/mod/settings.php index 7db196b03..da987260c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -177,7 +177,9 @@ function settings_post(&$a) { check_form_security_token_redirectOnErr('/settings/connectors', 'settings_connectors'); - if(x($_POST, 'imap-submit')) { + if(x($_POST, 'general-submit')) { + set_pconfig(local_user(), 'system', 'no_intelligent_shortening', $_POST['no_intelligent_shortening']); + } elseif(x($_POST, 'imap-submit')) { $mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : ''); $mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : ''); @@ -733,7 +735,24 @@ function settings_content(&$a) { if(($a->argc > 1) && ($a->argv[1] === 'connectors')) { - $settings_connectors = ""; + $settings_connectors = ''; + $settings_connectors .= '

'. t('General Social Media Settings').'

'; + $settings_connectors .= '
'; + $settings_connectors .= '
'; call_hooks('connector_settings', $settings_connectors); From 472a6f138040bde03eff98a8a2e20d114451ce0e Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 15 May 2015 21:09:00 +0200 Subject: [PATCH 2/2] Added explanation for shortening. --- mod/settings.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/settings.php b/mod/settings.php index da987260c..a003401df 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -745,9 +745,10 @@ function settings_content(&$a) { $checked = ((get_pconfig(local_user(), 'system', 'no_intelligent_shortening')) ? ' checked="checked" ' : ''); - $settings_connectors .= '
'; - $settings_connectors .= ''; + $settings_connectors .= '
'; + $settings_connectors .= ''; $settings_connectors .= ''; + $settings_connectors .= ''.t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.').''; $settings_connectors .= '
'; $settings_connectors .= '
';