Browse Source

Improved handling of photos

pull/3010/head
Michael Vogel 4 years ago
committed by Roland Haeder
parent
commit
0b121a6ffe
No known key found for this signature in database GPG Key ID: B72F8185C6C7BD78
2 changed files with 7 additions and 3 deletions
  1. +6
    -2
      include/bbcode.php
  2. +1
    -1
      include/plaintext.php

+ 6
- 2
include/bbcode.php View File

@ -73,9 +73,13 @@ function bb_attachment($Text, $simplehtml = false, $tryoembed = true) {
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"]);
$text .= $oembed;
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
$text .= $oembed;
$text .= sprintf('<blockquote>%s</blockquote></span>', trim($data["description"]));
if (trim($data["description"]) != "")
$text .= sprintf('<blockquote>%s</blockquote></span>', trim($data["description"]));
}
}
return $data["text"].$text.$data["after"];


+ 1
- 1
include/plaintext.php View File

@ -85,7 +85,7 @@ function get_attachment_data($body) {
if ($type == "")
return(array());
if (!in_array($type, array("link", "audio", "video")))
if (!in_array($type, array("link", "audio", "photo", "video")))
return(array());
if ($type != "")


Loading…
Cancel
Save