WordPress.org

Ready to get started?Download WordPress

Forums

User Avatar
avatar size (8 posts)

  1. jnz31
    Member
    Posted 2 years ago #

    what i dont like about this plugin is, if you want to have another picture size as 150px you have to hack yourself throught the plugin. this is a very easy step, but when it comes to updates, you have to hack it again.

    best practice would be, to let the user edit the size in an input field and save that data in the db, so when there is an update, these changes wont get lost.

    http://wordpress.org/extend/plugins/user-avatar/

  2. enej
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi jnz31, thanks for your feedback.

    The plugin should be automatically resizing the pictures to particular sizes defined in the theme, just like gravitar.
    I wanted this plugin to work without having to save any settings. So some configurations is available by defining it in the code.

    To do that you have
    You should be able to place

    define( 'USER_AVATAR_FULL_WIDTH', 150 );
    define( 'USER_AVATAR_FULL_HEIGHT', 150 );

    into your wp-config.php file and user avatar will pick it up.
    And if you update the plugin it should stay as your defined values.

    I hope my answer make sense.

  3. jnz31
    Member
    Posted 2 years ago #

    quel, thx for the quick reply.
    will see if this works with the next update ;)

    thanks.

  4. enej
    Member
    Plugin Contributor

    Posted 2 years ago #

    Let me know if it doesn't :)

  5. freelance08
    Member
    Posted 2 years ago #

    I tried that, and it didn't work for me. I even took out the relevant "define" lines from your plugin, and that didn't make a difference. For that matter, before that, I edited those lines in your plugin to have different sizes (both the thumbnail and the full size settings), and nothing seemed to change. Actually, that's not totally true--on the crop page, it shows my image size under "Choose the part of the image you want to use as your profile image." and under the preview, but then when I click "Crop, it warps the image and creates a 150 x 150 version.

    Can you help? I'm boggled and frustrated. Thanks!

  6. jnz31
    Member
    Posted 2 years ago #

    the size is defined in file user-avatar.php
    in line 80 – 90 is the specific code.

    if ( !defined( 'USER_AVATAR_THUMB_WIDTH' ) )
    	define( 'USER_AVATAR_THUMB_WIDTH', 50 );
    
    if ( !defined( 'USER_AVATAR_THUMB_HEIGHT' ) )
    	define( 'USER_AVATAR_THUMB_HEIGHT', 50 );
    
    if ( !defined( 'USER_AVATAR_FULL_WIDTH' ) )
    	define( 'USER_AVATAR_FULL_WIDTH', 260 );
    
    if ( !defined( 'USER_AVATAR_FULL_HEIGHT' ) )
    	define( 'USER_AVATAR_FULL_HEIGHT', 260 );

    its already modded to my needs, 260px. works like a charme.

    BUT they only are generated, when you upload a new image, not when you update the settings.

  7. freelance08
    Member
    Posted 2 years ago #

    OK, as I mentioned, I had already tried editing those lines to no avail, but I'll go through it once again. Meanwhile, if anyone has an idea why that wouldn't work for some reason, please let me know.
    Thanks again!

  8. freelance08
    Member
    Posted 2 years ago #

    I just went and deleted the plugin, reinstalled it, and went directly to change those values. I changed both the thumb and full size values to 100 width and 125 height.

    Just as before, those new dimensions seem to be reflected in the page where it asks you to choose the crop area to use, but once I click "Crop", the resulting image is 150 x 150, and distorted (since the original image is not 150 px wide).

    Any help figuring out why this would for some reason not work as described would be much appreciated. Is there somewhere else where this might be being overridden? It's not in my wp-config.php, and I did a search through my theme's files for USER_AVATAR and nothing came up.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic