1
1
Fork 0
friendica_2019-12_sharedHos.../include/bbcode.php

67 lines
1.8 KiB
PHP
Raw Normal View History

2012-06-26 07:01:32 +02:00
<?php
/**
* @file include/bbcode.php
*/
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\Plaintext;
use Friendica\Core\Network;
2017-04-07 05:43:55 +02:00
require_once 'include/event.php';
require_once 'mod/proxy.php';
2015-05-15 20:41:10 +02:00
function bb_remove_share_information($Text, $plaintext = false, $nolink = false) {
return BBCode::removeShareInformation($Text, $plaintext, $nolink);
}
2011-07-19 04:17:16 +02:00
2017-04-07 05:43:55 +02:00
function bb_find_open_close($s, $open, $close, $occurence = 1) {
return Plaintext::getBoundariesPosition($s, $open, $close, $occurence - 1);
}
2017-04-07 05:43:55 +02:00
function get_bb_tag_pos($s, $name, $occurence = 1) {
return BBCode::getTagPosition($s, $name, $occurence - 1);
}
function bb_tag_preg_replace($pattern, $replace, $name, $s) {
return BBCode::pregReplaceInTag($pattern, $replace, $name, $s);
}
function bb_extract_images($body) {
return BBCode::extractImagesFromItemBody($body);
}
function bb_replace_images($body, $images) {
return BBCode::interpolateSavedImagesIntoItemBody($body, $images);
}
function bb_ShareAttributes($share, $simplehtml) {
return BBCode::convertShare($share, $simplehtml);
}
function GetProfileUsername($profile, $username, $compact = false, $getnetwork = false) {
if ($getnetwork) {
return Network::matchByProfileUrl($profile);
} elseif ($compact) {
return Network::getAddrFromProfileUrl($profile);
} else {
return Network::formatMention($profile, $username);
2014-02-22 15:42:34 +01:00
}
}
2014-02-22 15:42:34 +01:00
function bb_CleanPictureLinks($text) {
return BBCode::cleanPictureLinks($text);
}
function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = false, $forplaintext = false)
{
return BBCode::convert($Text, $preserve_nl, $tryoembed, $simplehtml, $forplaintext);
2010-08-20 05:52:49 +02:00
}
function remove_abstract($text) {
return BBCode::removeAbstract($text);
}
function fetch_abstract($text, $addon = "") {
return BBCode::getAbstract($text, $addon);
}