Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Install and Upgrade Help => Topic started by: Belford on February 05, 2012, 07:54:50 AM

Title: .gif avatars
Post by: Belford on February 05, 2012, 07:54:50 AM
Hello!

Is there any way to disable animated avatars?
Title: Re: .gif avatars
Post by: kat on February 05, 2012, 08:42:48 AM
Sorry, Belford.

I don't believe there is. :(

I believe it'd be quite difficult for the software to differentiate between animated and static files, really. (I could be wrong).

There could be a mod, to do this. But, I somehow doubt it. I'll go and have a search. ;)

In the meantime, let me welcome to the ol' forum!
Title: Re: .gif avatars
Post by: kat on February 05, 2012, 08:45:42 AM
Did a search and there doesn't seem to be anything, I'm afraid.

You could always make it a forum rule not to use them and remove any that breaks the rule, of course.
Title: Re: .gif avatars
Post by: NanoSector on February 05, 2012, 08:47:25 AM
Lemmesee, there must be a way.. I'll make you something in a moment.

/me gets his tools ready for some screwing work
Title: Re: .gif avatars
Post by: kat on February 05, 2012, 08:49:33 AM
Quote from: Yoshi2889 on February 05, 2012, 08:47:25 AM
/me gets his tools ready for some screwing

Pervert. ;)
Title: Re: .gif avatars
Post by: Illori on February 05, 2012, 09:01:30 AM
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.
Title: Re: .gif avatars
Post by: NanoSector on February 05, 2012, 09:05:50 AM
On line 2591 of Profile-Modify.php in your Sources directory, find this:

if ($value == 'none')


add before:

        // 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');
            }
        }


Then, in your "Themes/default/languages" folder, find "modifications.english.php" or any other language you have installed, and add this:
$txt['no_gif_allowed'] = 'Animated avatars are not allowed in this forum.';

This is probably not the most reliable way to do it, but it gets the job done I guess.
Title: Re: .gif avatars
Post by: Illori on February 05, 2012, 09:40:12 AM
but that would stop the use of gifs in general as well right?
Title: Re: .gif avatars
Post by: NanoSector on February 05, 2012, 10:45:53 AM
Quote from: Illori on February 05, 2012, 09:40:12 AM
but that would stop the use of gifs in general as well right?
Yeah. But it's easier then to check if the image has multiple frames.
Title: Re: .gif avatars
Post by: JimM on March 01, 2012, 09:13:29 PM
You can disable them in your browser if you are using Firefox, Opera, or IE.  :P