// If the link description is similar to the text above then don't add the link description
if (($data["title"] != "") AND ((strpos($test1,$test2) !== false) OR
- (similar_text($test1,$test2) / strlen($data["title"])) > 0.9))
+ (similar_text($test1,$test2) / strlen($data["title"])) > 0.9)) {
$title2 = $data["url"];
- $text = sprintf('<a href="%s" title="%s" class="attachment thumbnail" rel="nofollow external">%s</a><br />',
+ }
+ $text = sprintf('<a href="%s" title="%s" class="attachment" rel="nofollow external">%s</a><br />',
$data["url"], $data["title"], $title2);
} elseif (($simplehtml != 4) AND ($simplehtml != 0)) {
$text = sprintf('<a href="%s" target="_blank">%s</a><br>', $data["url"], $data["title"]);
$text = sprintf('<span class="type-%s">', $data["type"]);
$bookmark = array(sprintf('[bookmark=%s]%s[/bookmark]', $data["url"], $data["title"]), $data["url"], $data["title"]);
- if ($tryoembed)
+ if ($tryoembed) {
$oembed = tryoembed($bookmark);
- else
+ } else {
$oembed = $bookmark[0];
+ }
- if (strstr(strtolower($oembed), "<iframe "))
+ if (strstr(strtolower($oembed), "<iframe ")) {
$text = $oembed;
- else {
- if (($data["image"] != "") AND !strstr(strtolower($oembed), "<img "))
+ } else {
+ if (($data["image"] != "") AND !strstr(strtolower($oembed), "<img ")) {
$text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-image" /></a><br />', $data["url"], proxy_url($data["image"]), $data["title"]);
- elseif (($data["preview"] != "") AND !strstr(strtolower($oembed), "<img "))
+ } elseif (($data["preview"] != "") AND !strstr(strtolower($oembed), "<img ")) {
$text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-preview" /></a><br />', $data["url"], proxy_url($data["preview"]), $data["title"]);
+ }
- if (($data["type"] == "photo") AND ($data["url"] != "") AND ($data["image"] != ""))
+ if (($data["type"] == "photo") AND ($data["url"] != "") AND ($data["image"] != "")) {
$text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-image" /></a>', $data["url"], proxy_url($data["image"]), $data["title"]);
- else
+ } else {
$text .= $oembed;
+ }
- if (trim($data["description"]) != "")
+ if (trim($data["description"]) != "") {
$text .= sprintf('<blockquote>%s</blockquote></span>', trim(bbcode($data["description"])));
+ }
}
}
- return $data["text"] . $text . $data["after"];
+ return trim($data["text"].' '.$text.' '.$data["after"]);
}
function bb_remove_share_information($Text, $plaintext = false, $nolink = false) {