Avatar Images Break on Multisite

This topic contains 11 reply and 2 voices, and was last updated by Mike 10 years, 12 months ago
Viewing 11 Posts - 1 through 11 (of 11 total)
Author Posts
April 21, 2013 at 8:40 am 2631
Mike Hi It's me again with multisite issue lol..still loving this plugin though ! The issue now is that when uploading an avatar on a user profile on the main site, the avatar doesn't carry over to their profile on their own site in the network. All other info carries over just fine but the avatar image is broken on subsites. I was using Simple Local Avatar which worked perfect and it automatically showed up on frontend profiles when using the free version. However, it doesn't show up on the profile of the PRO version because I can't figure out the action hook thingy. So firstly, is there a way to force the avatar to show up on sub sites in the network as well? Or , is there a way to get "Simple local avatar" plugin to show up on the user profile in the front end? Thanks!   Mike
April 21, 2013 at 8:42 am 2632
Mike Mike

Actually even trying to re-upload the avatar on profile in a sub site doesn’t work at all. Still shows broken image! 🙁

April 21, 2013 at 11:47 am 2639
Tareq Hasan Tareq Hasan

Did you activate the plugin network wide? Or per site based?

April 21, 2013 at 5:21 pm 2648
Mike Mike

Hey

I have it Network Activated. Should I make it activated per site? That might make sense..hmm im gonna try and let you know what happens

April 21, 2013 at 5:23 pm 2649
Mike Mike

Dang that didnt work 🙁  When clicking select image the image shows up on the form but as soon as you click update profile it becomes a broken image 🙁

April 22, 2013 at 10:40 am 2670
Tareq Hasan Tareq Hasan

Just tested with network wide activation and also per site activation. Seems fine.

April 22, 2013 at 5:50 pm 2715
Mike Mike

Wow I hate to hear that since that means there is something conflicting or wrong with my install 🙁  lol …thanks for checking though I guess I got to be doing some troubleshooting on my end

April 24, 2013 at 5:57 am 2801
Mike Mike

Hi

I figured out the problem but I dont know how to fix it. Its the way the plugin is built because it didn’t keep Multisite in mind sometimes but not blaming ya 😉

OK, so if you upload avatar on your profile on a Sub-site in the network it works fine. However, if you navigate over to the main site in the network and view your profile from there you will see the image as broken. If you then attempt to upload from the profile on the main network it will work again. But then navigate over to the sub site and see it broken yet again. endless cycle and this is why:

When uploading to the main site it is grabbing for the avatar in the media folder of the main site which is in the URL Like this: http://mydomain.com/wp-content/uploads/2013/04/photoname-avatar.jpg which works BUT if you navigate over to your profile on a subsite it is trying to grab the avatar image from its own media library which is evident in the URL like this http://subsite-mydomain/wp-content/uploads/sites/250/2013/04/photoname-avatar.jpg

This is why the broken image happens because the avatar doesn’t exist in that media library but instead on whatever site you uploaded the avatar to your profile from. Any ideas on how this could be fixed? Thanks so much!

April 24, 2013 at 7:06 am 2803
Tareq Hasan Tareq Hasan

The explanation makes sense. I’ll see what I can do to fix the problem.

April 24, 2013 at 7:16 am 2804
Mike Mike

Thanks so much Tareq as always 🙂

April 24, 2013 at 10:20 am 2815
Tareq Hasan Tareq Hasan

It’s a kinda big problem for multisite. If you upload a avatar from the main site, it’ll upload the photo to /uploads/2013/04/ folder. But if you upload the photo a sub site, it’ll upload in the sub sites upload folder.

As the avatar path is save in user meta, there is no way to know from which site you’ve uploaded the photo and where should I look for it. So there is ambiguity for this situation.

The only fix I can provide is, it’ll show the avatar correctly in the current site. But it’ll not show the avatar in other sites, in that case it’ll fallback to gravatar instead of showing a broken image.

April 24, 2013 at 5:16 pm 2839
Mike Mike

Hey Tareq

Yeah I see this problem. I thought maybe it could be cuz I am using the same Profile shortcode on each of the sites but not sure if changing that would make a difference. But since I am using a plugin that creates default templates for new sites I wouldn’t be able to change this anyway.

Maybe you can help me use this plugin: http://wordpress.org/extend/plugins/simple-local-avatars/

It actually works PERFECTLY for not only multisite but also with your WP User FrontEnd Free version! Your free version automatically grabbed this plugin into the frontend form and it was soo slick. Can you take a look and see if its possible to add this into my front end pro profile ? Thanks for any help you can provide on this..I am still loving your work

Viewing 11 Posts - 1 through 11 (of 11 total)