Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/14/2016 04:48:29 AM (8 years ago)
Author:
boonebgorges
Message:

Default no_grav avatars should be thumb-sized when appropriate.

mystery-man-50.jpg should be served when:

  • A 'thumb' is requested, and the thumb width set in the config is 50 pixels or less, or
  • An avatar with a width of 50 or less is requested.

Props r0z.
Fixes #7056.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-avatars.php

    r10721 r10754  
    18661866    // Use the local default image.
    18671867    } elseif ( 'local' === $type ) {
    1868         $avatar = buddypress()->plugin_url . 'bp-core/images/mystery-man.jpg';
     1868        $size = '';
     1869        if (
     1870            ( isset( $params['type'] ) && 'thumb' === $params['type'] && bp_core_avatar_thumb_width() <= 50 ) ||
     1871            ( isset( $params['width'] ) && $params['width'] <= 50 )
     1872        ) {
     1873
     1874            $size = '-50';
     1875        }
     1876
     1877        $avatar = buddypress()->plugin_url . "bp-core/images/mystery-man{$size}.jpg";
    18691878
    18701879    // Use Gravatar's mystery person as fallback.
    18711880    } else {
    1872         $avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&amp;s=' . bp_core_avatar_full_width();
     1881        $size = '';
     1882        if ( isset( $params['type'] ) && 'thumb' === $params['type'] ) {
     1883            $size = bp_core_avatar_thumb_width();
     1884        } else {
     1885            $size = bp_core_avatar_full_width();
     1886        }
     1887        $avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&amp;s=' . $size;
    18731888    }
    18741889
Note: See TracChangeset for help on using the changeset viewer.