0

I'm running a Vanilla Forum with a FileUpload plugin, allowing users to upload images and insert the corresponding code directly into the body of their post. These images work with FancyBox when clicked, linking together nicely within the page. However, should a user use a third-party image hosting site (i.e. Imagevenue, Imageshack, Postimage.org) and copy and paste the resulting image code, it deactivates the FancyBox feature associated with all images previously on the page, so when you click on an image uploaded via FileUpload it opens in a new window now instead of in a FancyBox.

My question is one of two things:

a) Is it possible to fix this formatting issue so that if a user does choose to use a third-party image hosting service then it will not affect the fancybox of my previous images.

or

b) Is it possible to block this type of image code from being inputted in the body of a post to prevent this from ever happening.

Thank you and please reply if you would like more information!

1 Answers1

0

Most likely the generated code from those third-party hosting sites has not an image extension (JPG, PNG, GIF) so fancybox doesn't know what type of content needs to handle.

If you are binding fancybox like

$(".fancybox").fancybox();

... you could force the type of content to image like

$(".fancybox").fancybox({
   type : "image"
});

I don't really see how pasting the code of a new image will disable the code for existing ones if you want to elaborate.

JFK
  • 40,963
  • 31
  • 133
  • 306