*/
use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
$public = true;
if ($public && !stristr($post->generator->displayName, $application_name)) {
- require_once('include/html2bbcode.php');
-
$_SESSION["authenticated"] = true;
$_SESSION["uid"] = $uid;
}
if ($post->object->displayName != "")
- $_REQUEST["title"] = html2bbcode($post->object->displayName);
+ $_REQUEST["title"] = HTML::toBBCode($post->object->displayName);
else
$_REQUEST["title"] = "";
- $_REQUEST["body"] = html2bbcode($post->object->content);
+ $_REQUEST["body"] = HTML::toBBCode($post->object->content);
// To-Do: Picture has to be cached and stored locally
if ($post->object->fullImage->url != "") {
function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcompletion = true) {
require_once('include/items.php');
- require_once('include/html2bbcode.php');
if (($post->verb == "like") || ($post->verb == "favorite"))
return pumpio_dolike($a, $uid, $self, $post, $own_id);
$postarray['author-avatar'] = $post->actor->image->url;
$postarray['plink'] = $post->object->url;
$postarray['app'] = $post->generator->displayName;
- $postarray['body'] = html2bbcode($post->object->content);
+ $postarray['body'] = HTML::toBBCode($post->object->content);
$postarray['object'] = json_encode($post);
if ($post->object->fullImage->url != "")
require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'statusnetoauth.php';
require_once 'include/enotify.php';
-use Codebird\Codebird;
use CodebirdSN\CodebirdSN;
use Friendica\App;
use Friendica\Content\OEmbed;
use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
use Friendica\Content\Text\Plaintext;
use Friendica\Core\Addon;
use Friendica\Core\Config;
// New code that is able to post pictures
require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'codebirdsn.php';
- $cb = \CodebirdSN\CodebirdSN::getInstance();
+ $cb = CodebirdSN::getInstance();
$cb->setAPIEndpoint($api);
$cb->setConsumerKey($ckey, $csecret);
$cb->setToken($otoken, $osecret);
require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'codebirdsn.php';
- $cb = \CodebirdSN\CodebirdSN::getInstance();
+ $cb = CodebirdSN::getInstance();
$cb->setConsumerKey($ckey, $csecret);
$cb->setToken($otoken, $osecret);
function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_existing_contact)
{
- require_once "include/html2bbcode.php";
-
logger("statusnet_createpost: start", LOGGER_DEBUG);
$api = PConfig::get($uid, 'statusnet', 'baseapi');
$postarray['allow_cid'] = '<' . $self['id'] . '>';
}
- $postarray['body'] = html2bbcode($content->statusnet_html);
+ $postarray['body'] = HTML::toBBCode($content->statusnet_html);
$converted = statusnet_convertmsg($a, $postarray['body'], false);
$postarray['body'] = $converted["body"];
use Friendica\App;
use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
if (substr($body, 0, 4) == "[url") {
$body = "URL/Image ...";
} else {
- require_once("include/html2plain.php");
-
$body = BBCode::convert($body, false, 2, true);
- $body = html2plain($body, 0);
+ $body = HTML::toPlaintext($body, 0);
$body = ((strlen($body) > 137) ? substr($body, 0, 137) . "..." : $body);
}
} else {
* Version: 1.1
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
*/
+
use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
PConfig::set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck']));
$wp_backlink_text = notags(trim($_POST['wp_backlink_text']));
$wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8);
- $wp_backlink_text = html2plain($wp_backlink_text, 0, true);
+ $wp_backlink_text = HTML::toPlaintext($wp_backlink_text, 0, true);
PConfig::set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text);
}
}
if ($wp_username && $wp_password && $wp_blog) {
- require_once 'include/html2plain.php';
-
$wptitle = trim($b['title']);
if (intval(PConfig::get($b['uid'], 'wppost', 'shortcheck'))) {
// Remove the share element before fetching the first line
$title = trim(preg_replace("/\[share.*?\](.*?)\[\/share\]/ism","\n$1\n",$b['body']));
- $title = html2plain(BBCode::convert($title, false), 0, true)."\n";
+ $title = HTML::toPlaintext(BBCode::convert($title, false), 0, true)."\n";
$pos = strpos($title, "\n");
$trailer = "";
if (($pos == 0) || ($pos > 100)) {