SMF Support > Install and Upgrade Help

.gif avatars

<< < (2/2)

Illori:
if the image is larger then the alloted size, it will automatically be resized and that will break the animation, so if you set the size somewhat smaller then normal that could help.

Yoshi:
On line 2591 of Profile-Modify.php in your Sources directory, find this:

--- Code: --- if ($value == 'none')

--- End code ---

add before:

--- Code: ---        // Some checking work. We don't like GIFs!
        if ($value != 'none' && $value != 'server_stored')
        {
            // Two different modes for two different methods!
            if ($value == 'external')
            {
                // If (extension == gif) then ERROR :D
                if (end(explode('.', $_POST['userpicpersonal'])) == 'gif')
                    fatal_lang_error('no_gif_allowed');
            }
            elseif ($value == 'upload')
            {
                if (end(explode('.', $_FILES['attachment']['name'])) == 'gif')
                    fatal_lang_error('no_gif_allowed');
            }
        }

--- End code ---

Then, in your "Themes/default/languages" folder, find "modifications.english.php" or any other language you have installed, and add this:

--- Code: ---$txt['no_gif_allowed'] = 'Animated avatars are not allowed in this forum.';
--- End code ---

This is probably not the most reliable way to do it, but it gets the job done I guess.

Illori:
but that would stop the use of gifs in general as well right?

Yoshi:

--- Quote from: Illori on February 05, 2012, 09:40:12 AM ---but that would stop the use of gifs in general as well right?

--- End quote ---
Yeah. But it's easier then to check if the image has multiple frames.

JimM:
You can disable them in your browser if you are using Firefox, Opera, or IE.  :P

Navigation

[0] Message Index

[*] Previous page

Go to full version