MyBB Community Forums

Full Version: I deleted the GIF attachment type from ACP but . .
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
. . . but it did not prevent my members from uploading animated (GIF) avatars. How can I prevent members from uploading them for their avatars?
Actually you've deleted the "attachment type" and not the avatar image type. For this you've to edit core file, ./inc/functions_upload.php and find;
if(!preg_match("#^(gif|jpg|jpeg|jpe|bmp|png)$#i", $ext))
and Change it into;
if(!preg_match("#^(jpg|jpeg|jpe|bmp|png)$#i", $ext))

Now open ./inc/languages/english/usercp_lang.php and find;
$l['error_avatartype'] = "Invalid file type. An uploaded avatar must be in GIF, JPEG, or PNG format.";
and remove the GIF, from the text.
I did this and double checked but I still see those jumping monkey avatars grrrr lol. You are a wizard at this coding stuff Yaldaram. What else should I try? Thanks.
Unfortunately those who have already uploaded .gif avatars will not be effected with this modification.
Okay Yaldaram thanks again for sharing your knowledge. I will just delete the avatars from the ACP there are not many members yet that have GIF avatars thankfully.
Yaldaram, check your code. You missed the g on jpeg, which would cause issues.
^ No he hasn't, jpe is a valid extension. JPG and JPEG is also present in his code.
Oh... I guess I learned something new.