]> git.mxchange.org Git - friendica.git/commitdiff
The intelligent shortening for social media systems like Twitter, GNU Social and...
authorMichael Vogel <icarus@dabo.de>
Fri, 15 May 2015 18:56:05 +0000 (20:56 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 15 May 2015 18:56:05 +0000 (20:56 +0200)
include/plaintext.php
mod/settings.php

index 88febbfff858449fdec687cd35e6ac945e904eb0..c8cdfa57dfecc8c22184138bf2a488ed85fc43d9 100644 (file)
@@ -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);
                }
index 7db196b0308c6dd112f135520ccef519e37c3c26..da987260cadcf9ec42401c8f935d370307af28c0 100644 (file)
@@ -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 = '<span id="settings_general_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_general_expanded\'); openClose(\'settings_general_inflated\');">';
+               $settings_connectors .= '<h3 class="connector">'. t('General Social Media Settings').'</h3>';
+               $settings_connectors .= '</span>';
+               $settings_connectors .= '<div id="settings_general_expanded" class="settings-block" style="display: none;">';
+               $settings_connectors .= '<span class="fakelink" onclick="openClose(\'settings_general_expanded\'); openClose(\'settings_general_inflated\');">';
+               $settings_connectors .= '<h3 class="connector">'. t('General Social Media Settings').'</h3>';
+               $settings_connectors .= '</span>';
+
+               $checked = ((get_pconfig(local_user(), 'system', 'no_intelligent_shortening')) ? ' checked="checked" ' : '');
+
+               $settings_connectors .= '<div id="general-shortening-wrapper">';
+               $settings_connectors .= '<label id="general-shortening-label" for="shortening-checkbox">'. t('Disable intelligent shortening'). '</label>';
+               $settings_connectors .= '<input id="shortening-checkbox" type="checkbox" name="no_intelligent_shortening" value="1" ' . $checked . '/>';
+               $settings_connectors .= '</div>';
+
+               $settings_connectors .= '<div class="settings-submit-wrapper" ><input type="submit" name="general-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div>';
+
+               $settings_connectors .= '</div><div class="clear"></div>';
 
                call_hooks('connector_settings', $settings_connectors);