]> git.mxchange.org Git - friendica-addons.git/commitdiff
Plaintext was renamed to BBCode
authorAdam Magness <adam.magness@gmail.com>
Sat, 27 Jan 2018 01:04:00 +0000 (20:04 -0500)
committerAdam Magness <adam.magness@gmail.com>
Sat, 27 Jan 2018 01:04:00 +0000 (20:04 -0500)
update class name

buffer/buffer.php
statusnet/statusnet.php
tumblr/tumblr.php
twitter/twitter.php
wppost/wppost.php

index aef9a0fdcaacb370500ebaeaa865367d0875f8b0..a82fd4fc32174e3eefb1d6a55d1b596f43284496 100644 (file)
@@ -8,7 +8,7 @@
 require 'addon/buffer/bufferapp.php';
 
 use Friendica\App;
-use Friendica\Content\Text\Plaintext;
+use Friendica\Content\Text\BBCode;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
@@ -339,7 +339,7 @@ function buffer_send(App $a, &$b)
                                        $item["body"] = preg_replace("(\[s\](.*?)\[\/s\])ism",'-$1-',$item["body"]);
                                }
 
-                               $post = Plaintext::toPlaintext($item, $limit, $includedlinks, $htmlmode);
+                               $post = BBCode::toPlaintext($item, $limit, $includedlinks, $htmlmode);
                                logger("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), LOGGER_DEBUG);
 
                                // The image proxy is used as a sanitizer. Buffer seems to be really picky about pictures
@@ -365,8 +365,8 @@ function buffer_send(App $a, &$b)
                                if (($profile->service == "twitter") && isset($post["url"]) && ($post["type"] != "photo"))
                                        $post["text"] .= " ".$post["url"];
                                elseif (($profile->service == "appdotnet") && isset($post["url"]) && isset($post["title"]) && ($post["type"] != "photo")) {
-                                       $post["title"] = Plaintext::shortenMsg($post["title"], 90);
-                                       $post["text"] = Plaintext::shortenMsg($post["text"], $limit - (24 + strlen($post["title"])));
+                                       $post["title"] = BBCode::shortenMsg($post["title"], 90);
+                                       $post["text"] = BBCode::shortenMsg($post["text"], $limit - (24 + strlen($post["title"])));
                                        $post["text"] .= "\n[".$post["title"]."](".$post["url"].")";
                                } elseif (($profile->service == "appdotnet") && isset($post["url"]) && ($post["type"] != "photo"))
                                        $post["text"] .= " ".$post["url"];
index 3296acbeba017aff7d9db4dd634aba65b0aab0d5..40239af714463922547d7b7e524666192100f9dc 100644 (file)
@@ -47,7 +47,7 @@ require_once 'include/enotify.php';
 
 use Friendica\App;
 use Friendica\Content\OEmbed;
-use Friendica\Content\Text\Plaintext;
+use Friendica\Content\Text\BBCode;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
@@ -641,11 +641,11 @@ function statusnet_post_hook(App $a, &$b)
 
                $tempfile = "";
                require_once "include/network.php";
-               $msgarr = Plaintext::toPlaintext($b, $max_char, true, 7);
+               $msgarr = BBCode::toPlaintext($b, $max_char, true, 7);
                $msg = $msgarr["text"];
 
                if (($msg == "") && isset($msgarr["title"]))
-                       $msg = Plaintext::shortenMsg($msgarr["title"], $max_char - 50);
+                       $msg = BBCode::shortenMsg($msgarr["title"], $max_char - 50);
 
                $image = "";
 
@@ -809,7 +809,7 @@ function statusnet_prepare_body(App $a, &$b)
                        }
                }
 
-               $msgarr = Plaintext::toPlaintext($item, $max_char, true, 7);
+               $msgarr = BBCode::toPlaintext($item, $max_char, true, 7);
                $msg = $msgarr["text"];
 
                if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {
index 4e518e4311ac61445eadd8461d4ba07d6a2879fc..20a27f45586cbd56f495bdd0113e57c1caeede30 100644 (file)
@@ -10,7 +10,7 @@
 require_once 'library/OAuth1.php';
 require_once 'addon/tumblr/tumblroauth/tumblroauth.php';
 
-use Friendica\Content\Text\Plaintext;
+use Friendica\Content\Text\BBCode;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
@@ -360,7 +360,7 @@ function tumblr_send(&$a,&$b) {
 
                $title = trim($b['title']);
 
-               $siteinfo = Plaintext::getAttachedData($b["body"]);
+               $siteinfo = BBCode::getAttachedData($b["body"]);
 
                $params = [
                        'state' => 'published',
index f0ed88cfd97e54d89e285757d1c224d0fca75adf..57a9db2b497686167d2929b2e10dcf801a6a7de4 100644 (file)
@@ -61,7 +61,7 @@
 
 use Friendica\App;
 use Friendica\Content\OEmbed;
-use Friendica\Content\Text\Plaintext;
+use Friendica\Content\Text\BBCode;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
@@ -525,11 +525,11 @@ function twitter_post_hook(App $a, &$b)
                $tweet = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
 
                $max_char = 280;
-               $msgarr = Plaintext::toPlaintext($b, $max_char, true, 8);
+               $msgarr = BBCode::toPlaintext($b, $max_char, true, 8);
                $msg = $msgarr["text"];
 
                if (($msg == "") && isset($msgarr["title"])) {
-                       $msg = Plaintext::shortenMsg($msgarr["title"], $max_char - 50);
+                       $msg = BBCode::shortenMsg($msgarr["title"], $max_char - 50);
                }
 
                $image = "";
@@ -593,11 +593,11 @@ function twitter_post_hook(App $a, &$b)
                if (strlen($msg) && ($image == "")) {
 // -----------------
                        $max_char = 280;
-                       $msgarr = Plaintext::toPlaintext($b, $max_char, true, 8);
+                       $msgarr = BBCode::toPlaintext($b, $max_char, true, 8);
                        $msg = $msgarr["text"];
 
                        if (($msg == "") && isset($msgarr["title"])) {
-                               $msg = Plaintext::shortenMsg($msgarr["title"], $max_char - 50);
+                               $msg = BBCode::shortenMsg($msgarr["title"], $max_char - 50);
                        }
 
                        if (isset($msgarr["url"])) {
@@ -789,7 +789,7 @@ function twitter_prepare_body(App $a, &$b)
                        }
                }
 
-               $msgarr = Plaintext::toPlaintext($item, $max_char, true, 8);
+               $msgarr = BBCode::toPlaintext($item, $max_char, true, 8);
                $msg = $msgarr["text"];
 
                if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {
index a64ffc3db82b93ea3abfb7f841b18ce26bba88a3..f2f9b93574eaa83fc936b79b6e627e4c0bb502d3 100644 (file)
@@ -5,7 +5,7 @@
  * Version: 1.1
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  */
-use Friendica\Content\Text\Plaintext;
+use Friendica\Content\Text\BBCode;
 use Friendica\Core\Addon;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
@@ -228,7 +228,7 @@ function wppost_send(&$a,&$b) {
                if (intval(PConfig::get($b['uid'], 'wppost', 'shortcheck'))) {
                        // Checking, if its a post that is worth a blog post
                        $postentry = false;
-                       $siteinfo = Plaintext::getAttachedData($b["body"]);
+                       $siteinfo = BBCode::getAttachedData($b["body"]);
 
                        // Is it a link to an aricle, a video or a photo?
                        if (isset($siteinfo["type"])) {
@@ -255,7 +255,7 @@ function wppost_send(&$a,&$b) {
                // If the title is empty then try to guess
                if ($wptitle == '') {
                        // Fetch information about the post
-                       $siteinfo = Plaintext::getAttachedData($b["body"]);
+                       $siteinfo = BBCode::getAttachedData($b["body"]);
                        if (isset($siteinfo["title"])) {
                                $wptitle = $siteinfo["title"];
                        }