X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbbcode.php;h=be59c180726860a0292f2e10ef0b9e574afbd56f;hb=0305aa2d8218a0919526a08910ffaebfdc5bb2c5;hp=867c9fe2bf56cf9fcb4ed9a103d7ac2fbafd390a;hpb=f602ec30ccde5700726bc51be1096b0a2c55b1ec;p=friendica.git diff --git a/include/bbcode.php b/include/bbcode.php index 867c9fe2bf..be59c18072 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1,13 +1,16 @@ ' . generate_map(str_replace('/', ' ', $match[1])) . '', $match[0]); + return str_replace($match[0], '
' . Map::byCoordinates(str_replace('/', ' ', $match[1])) . '
', $match[0]); } function bb_map_location($match) { // the extra space in the following line is intentional - return str_replace($match[0], '
' . generate_named_map($match[1]) . '
', $match[0]); + return str_replace($match[0], '
' . Map::byLocation($match[1]) . '
', $match[0]); } function bb_attachment($Text, $simplehtml = false, $tryoembed = true) { @@ -49,17 +52,24 @@ function bb_attachment($Text, $simplehtml = false, $tryoembed = true) { $data["title"] = str_replace(array("http://", "https://"), "", $data["title"]); } - if (((strpos($data["text"], "[img=") !== false) OR (strpos($data["text"], "[img]") !== false)) AND ($data["image"] != "")) { + if (((strpos($data["text"], "[img=") !== false) + || (strpos($data["text"], "[img]") !== false) + || Config::get('system', 'always_show_preview')) + && ($data["image"] != "")) { $data["preview"] = $data["image"]; $data["image"] = ""; } if ($simplehtml == 7) { $text = style_url_for_mastodon($data["url"]); - } elseif (($simplehtml != 4) AND ($simplehtml != 0)) { + } elseif (($simplehtml != 4) && ($simplehtml != 0)) { $text = sprintf('%s
', $data["url"], $data["title"]); } else { - $text = sprintf('', $data["type"]); + if ($simplehtml != 4) { + $text = sprintf('', $data["type"]); + } else { + $span_end = ''; + } $bookmark = array(sprintf('[bookmark=%s]%s[/bookmark]', $data["url"], $data["title"]), $data["url"], $data["title"]); if ($tryoembed) { @@ -71,22 +81,26 @@ function bb_attachment($Text, $simplehtml = false, $tryoembed = true) { if (strstr(strtolower($oembed), "