]> git.mxchange.org Git - friendica-addons.git/commitdiff
SN/T: forgot the title of a posting in the last change
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Tue, 1 May 2012 11:49:05 +0000 (13:49 +0200)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Tue, 1 May 2012 11:49:05 +0000 (13:49 +0200)
statusnet/statusnet.php
twitter/twitter.php

index fe5e7ad3a2497696b9ceae41a28d2e40f6f40207..5f9800672ff3955a453a66b24697bde375ba51d5 100755 (executable)
@@ -433,14 +433,14 @@ function statusnet_post_hook(&$a,&$b) {
                 // we can later send to StatusNet. This way we can "gain" some 
                 // information during shortening of potential links but do not 
                 // shorten all the links in a 200000 character long essay.
-//                if (! $b['title']=='') {
-//                    $tmp = $b['title'] . ' : '. $b['body'];
+                if (! $b['title']=='') {
+                    $tmp = $b['title'] . ' : '. $b['body'];
 //                    $tmp = substr($tmp, 0, 4*$max_char);
-//                } else {
-//                    $tmp = substr($b['body'], 0, 3*$max_char);
-//                }
+                } else {
+                    $tmp = $b['body'] // substr($b['body'], 0, 3*$max_char);
+                }
                 // if [url=bla][img]blub.png[/img][/url] get blub.png
-                $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\]\[img\](\\w+.*?)\\[\\/img\]\\[\\/url\]/i', '$2', $b['body']);
+                $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\]\[img\](\\w+.*?)\\[\\/img\]\\[\\/url\]/i', '$2', $tmp);
                 // preserve links to images, videos and audios
                 $tmp = preg_replace( '/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism', '$3', $tmp);
                 $tmp = preg_replace( '/\[\\/?img(\\s+.*?\]|\])/i', '', $tmp);
index b6d1c4efac9f96b33a42e489ea92df098eea670f..1aed0148f2f736c759de6216d14449986ea8d478 100755 (executable)
@@ -299,14 +299,14 @@ function twitter_post_hook(&$a,&$b) {
                 // we can later send to Twitter. This way we can "gain" some 
                 // information during shortening of potential links but do not 
                 // shorten all the links in a 200000 character long essay.
-//                if (! $b['title']=='') {
-//                    $tmp = $b['title'] . ' : '. $b['body'];
+                if (! $b['title']=='') {
+                    $tmp = $b['title'] . ' : '. $b['body'];
 //                    $tmp = substr($tmp, 0, 4*$max_char);
-//                } else {
-//                    $tmp = substr($b['body'], 0, 3*$max_char);
-//                }
+                } else {
+                    $tmp = $b['body'] // substr($b['body'], 0, 3*$max_char);
+                }
                 // if [url=bla][img]blub.png[/img][/url] get blub.png
-                $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\]\[img\](\\w+.*?)\\[\\/img\]\\[\\/url\]/i', '$2', $b['body']);
+                $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\]\[img\](\\w+.*?)\\[\\/img\]\\[\\/url\]/i', '$2', $tmp);
                 // preserve links to images, videos and audios
                 $tmp = preg_replace( '/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism', '$3', $tmp);
                 $tmp = preg_replace( '/\[\\/?img(\\s+.*?\]|\])/i', '', $tmp);