Ideally I'd like to have a gallery of avatars that I've uploaded in advance that users can select from, in addition to the option of allowing them to upload a custom avatar of their choosing. I know you're swamped, but I'd love to see a plugin that does this.
Since that is beyond my ability (I only know enough PHP to get myself in trouble), I'm trying a much simpler solution in the mean time.
I'm trying to replace the mysteryman with a random avatar from an avatar folder if user's don't have an avatar. This is what I'm trying currently:
I set the default avatar in Buddypress to the Mystery Man. And I’m trying this:
function myavatar_add_default_avatar( $url )
{
$tmp = glob('avatars/*.png');
$flist = array();
if (is_array($tmp))
{
$flist = array_merge($flist,$tmp);
}
$default_avatar = $flist[array_rand($flist)];
return $default_avatar;
}
add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );
But I'm not getting mysteryman, or the random avatars. Everyone has the default Gravatar. I thought if I configured Buddypress to use mysteryman, that is what I'd get. I'm not sure why Gravatars are overriding that.