Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Uploaded pictures does not display in forum BB Code

Asked Modified Viewed 1,974 times
J
janco1983
J
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Newbie

Hi there,
I am not able to upload a picture to forum post.
Please find error message below.

s13.postimg.org/v3jsmy8wn/brak_zdjec.jpg


My img_bbcode_include.php is as follows:
if (!defined("IN_FUSION")) { die("Access Denied"); }

if (!function_exists("img_bbcode_callback")) {
 function img_bbcode_callback($matches)
 {
 if (substr($matches[3], -1, 1) != "/")
 {
 $avdata = @getimagesize("$matches[1]$matches[3]$matches[4]");
 if (isset($avdata["mime"]))
 {
 return "<span style='display: block; max-width: 300px; max-height: 300px; overflow: auto;' class='forum-img-wrapper'><img src='".$matches[1].str_replace(array("?","&","&","="), "", $matches[3]).$matches[4]."' alt='".$matches[3].$matches[4]."' style='border:0px' class='forum-img' /></span>";
 }
 else
 {
 return "[img]$matches[1]$matches[3]$matches[4][/img] is not a valid Image.";
 }
 }
 else
 {
 return "[img]$matches[1]$matches[3]$matches[4][/img] is not a valid Image.";
 }
 // End of BBCode IMG tag patch by Euforia33
 }

}
 
$text = preg_replace_callback("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#si", "img_bbcode_callback", $text);
?>
Edited by Falk on 09-01-2021 12:34,
0 replies

1 post

F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Try this one

if (!defined("IN_FUSION")) { die("Access Denied"); }

if (!function_exists("img_bbcode_callback")) {
   function img_bbcode_callback($matches) {
      if (substr($matches[3], -1, 1) != "/") {
         return "<span style='display: block; width: 300px; max-height: 300px; overflow: auto;' class='forum-img-wrapper'><img src='".$matches[1].str_replace(array("?","&amp;","&","="), "", $matches[3]).$matches[4]."' alt='".$matches[3].$matches[4]."' style='border:0px' class='forum-img' /></span>";
      } else {
         return $matches[0];
      }
   }
}

$text = preg_replace_callback("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#si", "img_bbcode_callback", $text);
0 replies

Category Forum

BB Codes - 8

Labels

None yet

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 2 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet