Gonna serve default avatars from gravatar. see #5775

git-svn-id: https://develop.svn.wordpress.org/trunk@6749 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-02-07 06:58:38 +00:00
parent b0a8da663d
commit a132f8d9a6
6 changed files with 3 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1015 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1189,17 +1189,11 @@ function get_avatar( $id_or_email, $size = '96', $default = '' ) {
$email = $id_or_email;
}
$default_sizes = array(16, 32, 48, 96, 128);
if ( empty($default) ) {
if ( in_array($size, $default_sizes) )
$default = trailingslashit(get_bloginfo('wpurl')) . "wp-includes/images/avatar/unknown-$size.jpg";
else
$default = trailingslashit(get_bloginfo('wpurl')) . "wp-includes/images/avatar/unknown-96.jpg";
}
if ( empty($default) )
$default = 'http://www.gravatar.com/avatar.php?gravatar_id=' . md5('unknown@gravatar.com') . "&size=$size";
$default = urlencode( $default );
if ( !empty($email) ) {
$default = urlencode( $default );
$out = 'http://www.gravatar.com/avatar.php?gravatar_id=';
$out .= md5( $email );
$out .= "&size={$size}";