Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: avatars in wordpress and bbpress

@affacat

Member

Not sure what you mean – the code I had above should do what I say it did, it just didn’t do what I wanted.

That said? I now have it working the way I wanted.

This code:

Gets the bbPress avatar, if it exists.

Checks to see if it’s an Identicon…

No? Display it.

Yes? Display Gravatar… but with the URL of the Identicon set as the default in case none exists.

Problem solved.

Note: I believe Gravatar recently integrated Identicons as a default setting, so you can probably do this now without Identicons setup in bbPress by modifying the code some. But this works.

PROFILE.PHP:

$ava = avatarupload_get_avatar($user->ID,1,1,0);

if ( avatarupload_get_avatar($user->ID) && !(usingidenticon($user->ID) )) {

avatarupload_display($user->ID);

}

else {

echo bb_get_avatar($user->ID,48,$ava[0]);

}

POST.PHP:

$ava = avatarupload_get_avatar(get_post_author_id(),1,1,0);

if ( avatarupload_get_avatar(get_post_author_id()) && !(usingidenticon(get_post_author_id()) )) {

avatarupload_display(get_post_author_id());

}

else {

post_author_avatar(48,$ava[0]);

}

Skip to toolbar