Wrong path to image, solved (Avatars 3.6)

Hi,

I had a problem Avatars plugin v3.6 in WordPress 3.5, in a wordpress multisite install (without buddypress).

The “User avatar” was working fine.

The “Blog avatar” was not working: It uploaded the image fine, I could crop it fine, but then, when the page reloaded, the path to the new image was wrong:

The plugin function “get_blog_avatar” returned this:

mywebsite.com/avatar/blog–96.png

And it should return this:

mywebsite.com/avatar/blog-14-96.png

The number between the — is the id blog (in this case, 14), was missing.

I solved it by editing the function “get_blog_avatar”, defined in the file plugins/avatars/avatars.php

In the line 1391 I replaced this:

$path = 'http://' . $current_site->domain . $current_site->path . 'avatar/blog-' . $avatar_user_id . '-' . $size . '.png';

with this:

$path = 'http://' . $current_site->domain . $current_site->path . 'avatar/blog-' . $id . '-' . $size . '.png';

so, basically, I replaced $avatar_user_id with $id, and now it works as expected.

Best regards,

Josep.

  • Paul Barthmaier
    • Code Wrangler

    Hi there, Josep, and welcome to the WPMUdev Support Community!

    I’ve always said we have the smartest members in our community, and the best looking! Pretty sure that’s why they put me on staff. I was pulling down the average as a member!

    I’ve pinged the developer to be made aware of this, but very happy to hear that you have got this one figure out. If you’re all good on this issue, then, I’ll just mark this as resolved. Please feel free to reopen if we missed something. Likewise, if the developer sees something.

    Cheers,

    Paul

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.