mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
API: Show shared messages as repeated messages, improvements with nick names
This commit is contained in:
parent
c463fab8b8
commit
fa431e84c2
3 changed files with 196 additions and 13 deletions
|
@ -378,7 +378,7 @@ function GetProfileUsername($profile, $username) {
|
|||
// BBcode 2 HTML was written by WAY2WEB.net
|
||||
// extended to work with Mistpark/Friendica - Mike Macgirvin
|
||||
|
||||
function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = false) {
|
||||
function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = false, $forplaintext = false) {
|
||||
|
||||
$stamp1 = microtime(true);
|
||||
|
||||
|
@ -462,8 +462,11 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
|
|||
|
||||
|
||||
// Perform URL Search
|
||||
|
||||
$Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1<a href="$2" target="external-link">$2</a>', $Text);
|
||||
// if the HTML is used to generate plain text, then don't do this search, but replace all URL of that kind to text
|
||||
if (!$forplaintext)
|
||||
$Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1<a href="$2" target="external-link">$2</a>', $Text);
|
||||
else
|
||||
$Text = preg_replace("(\[url\](.*?)\[\/url\])ism","$1",$Text);
|
||||
|
||||
if ($tryoembed)
|
||||
$Text = preg_replace_callback("/\[bookmark\=([^\]]*)\].*?\[\/bookmark\]/ism",'tryoembed',$Text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue