Jump to content

Disabling the Upload of GIFs


Tripp★

Recommended Posts

How do I go about disabling GIF Uploads to my gallery from members on my forums? I'm guessing it'll have to be a file modification which is absolutely fine with me. 

I once saw this question asked somewhere on the forums but no one answered it and some were even asking "Why would you want to?" I can't find the topic anymore, so I have no idea if this was even answered. I'm only looking for an answer.

Thanks in advance. 

Link to comment
Share on other sites

15 hours ago, Jim M said:

You can specify which file extensions you want to allow by going to ACP > System > Posting. 

Thanks, but I think there has been some kind of confusion. I'm not asking about post attachments, I'm asking specifically about the gallery. No one can upload and attach things to posts like that, only upload to the gallery and then use the insert media button. 

When I edited the settings; it still allows me to upload GIFs to the gallery, but I don't know if that's because I'm an administrator or not, in fairness. 

Link to comment
Share on other sites

Do you want gifs to be available elsewhere images are expected?

If not, then you can create a plugin to override \IPS\Image and adjust this class property:

public static $imageExtensions = array( 'gif', 'jpeg', 'jpe', 'jpg', 'png' );

(This would be an extremely simple but effective plugin)

If you want gifs to be allowed elsewhere but not in Gallery uploads, it becomes a bit trickier. You would need a plugin to override the chooseImagesForm() method in \IPS\gallery\modules\front\gallery\submit. Specifically, it would need to set 'image' in the $options array to NULL and explicitly define which extensions are allowed (as we do when movies are allowed with these lines)

			$options['image'] = NULL;
			$options['allowedFileTypes'] = array_merge( \IPS\Image::$imageExtensions, array( 'flv', 'f4v', 'wmv', 'mpg', 'mpeg', 'mp4', 'mkv', 'm4a', 'm4v', '3gp', 'mov', 'avi', 'webm', 'ogg', 'ogv' ) );

 

Link to comment
Share on other sites

  • 3 months later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...