Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Plugin: Avatar Upload


_ck_
Participant

@_ck_

Another fix for another caching bug:

The query below is never cached – hence if the avatar is for a user other than the current one and is shown multiple times on a page, it causes a query each time since it does not pass through the bbpress caching mechanism.

(around line 117)

$bb_query = "SELECT meta_value FROM $bbdb->usermeta WHERE meta_key='avatar_file' AND user_id='$id' LIMIT 1";
if ( $avatar = $bbdb->get_results($bb_query) ) {

replace with this code to properly cache and radically reduce queries on a busy topic:

if ( $avatar = bb_get_usermeta( $id, "avatar_file")) {
$a = explode("|", $avatar);

note that $avatar[0]->meta_value is then simply replaced with $avatar

This may require newer versions of bbpress (build 904+) but that was seven months ago as of my post now.

I think I am going to whip up a little “import gravatar” feature for this.

Skip to toolbar