PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2013-08-31 16:51:37

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Auto Avatar 1.0

Code:

##
##        Mod title:  Auto Avatar
##
##      Mod version:  1.0
##   Works on PunBB:  1.2.*
##     Release date:  2013-08-31
##           Author:  Koos (pampoen10@yahoo.com)
##  Original Author:  thame^
##
##      Description:  PunBB's default behaviour is to reject any uploaded avatar
##                    image whose dimensions exceed those set in the options.
##                    Using this mod, PunBB will attempt to automatically resize
##                    those images to the maximum allowed dimensions, maintaining
##                    their aspect ratio. If the file size of the _resized image_
##                    is larger than allowed by the options, the upload will still
##                    be rejected.
##
##   Affected files:  profile.php
##
##       Affects DB:  No
##
##            Notes:  This mod requires the GD image library, including support
##                    for at least JPEG (GIF and PNG are also recommended). If
##                    your copy of PHP is compiled without GD support (or lacks
##                    support for the uploaded image type), the mod will silently
##                    revert to the default PunBB behaviour. Visit
##                    http://php.net/gd for more information about the GD image
##                    library.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##

Download here

Offline

 

#2 2013-08-31 16:56:44

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Auto Avatar 1.0

This mod adds functionality for automatically resizing uploaded user avatars.

This mod is based on the mod by thame^ found here:
http://www.punres.net/viewtopic.php?id=3768

I just made it a bit easier to install, and rewrote the part doing the image resizing. It will now also preserve transparencies in GIF and PNG images.

Avatars will be resized to the maximum allowable size for avatars set in Administration->Options (Max width and Max height).

Just remember to set the "Max size" of avatars in Administration->Options to an appropriately large enough value, e.g. 51200 (50 KB).

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.