X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fparse_url.php;h=e0b378f685448a2ac95142bf25649e733e267319;hb=6797485f6eea4700d5801afdf7ed7567e4e3fdf1;hp=2df9de4763c77afe1bc55932b87284c8343f995a;hpb=8aa25523721303b6883e1a793f20997f8a33ec0a;p=friendica.git diff --git a/mod/parse_url.php b/mod/parse_url.php index 2df9de4763..e0b378f685 100755 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -12,6 +12,13 @@ function parse_url_content(&$a) { $text = null; $str_tags = ''; + $textmode = false; + if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) + $textmode = true; + + if($textmode) + $br = (($textmode) ? "\n" : '
'; + $str_tags = $br . implode(' ',$arr_tags) . $br; } } logger('parse_url: ' . $url); - $template = "
%s%s
"; + if($textmode) + $template = $br . '[bookmark=%s]%s[/bookmark]%s' . $br; + else + $template = "
%s%s
"; $arr = array('url' => $url, 'text' => ''); @@ -49,7 +59,11 @@ function parse_url_content(&$a) { if($url && $title && $text) { - $text = '

' . $text . '

'; + if($textmode) + $text = $br . $br . '[quote]' . $text . '[/quote]' . $br; + else + $text = '

' . $text . '

'; + $title = str_replace(array("\r","\n"),array('',''),$title); $result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags; @@ -208,10 +222,17 @@ function parse_url_content(&$a) { $ph->scaleImage(300); $new_width = $ph->getWidth(); $new_height = $ph->getHeight(); - $image = '

photo'; + if($textmode) + $image = $br . $br . '[img=' . $new_width . 'x' . $new_height . ']' . $image . '[/img]'; + else + $image = '

photo'; + } + else { + if($textmode) + $image = $br . $br . '[img]' . $image . '[/img]'; + else + $image = '

photo'; } - else - $image = '

photo'; } else $image = ''; @@ -223,11 +244,14 @@ function parse_url_content(&$a) { } if(strlen($text)) { - $text = '

' . $text . '

'; + if($textmode) + $text = $br .$br . '[quote]' . $text . '[/quote]' . $br ; + else + $text = '

' . $text . '

'; } if($image) { - $text = $image . '
' . $text; + $text = $image . $br . $text; } $title = str_replace(array("\r","\n"),array('',''),$title);