Support Forum

Avatars disappeared!

SP Stefano Prete
Stefano Prete
Member

Hi guys,

I have NO IDEA about what happened, but all the avatars (personal pictures) of myself and all my members had have suddenly disappeared!

The default images are shown.

I don’t now how to fix it!

18 Answers

New Answer

SP Stefano Prete
Stefano Prete
Member

Sorry boys…

I don’t know what happened, but LOADED AVATAR (or something…) was at the bottom.

Moved it to the top, the avatars are back.

Sorry…

YS Yellow Swordfish
Yellow Swordfish
Member

Weird… keep an eye out for those mischievous gremlins 🙂

SP Stefano Prete
Stefano Prete
Member

Actually, it still doesn’t work…

I saved the page and the LOADED AVATARS disappeared, so did the pictures!

In admin–>forum–>profiles–>avatars I can only see “SP Default Avatar” and “Gravatars”…

SP Stefano Prete
Stefano Prete
Member

OK!

If I switch off the possibility to load avatars, the LOADED AVATARS disappears.

It comes back only if I allow to load avatars, which I don’t want…

YS Yellow Swordfish
Yellow Swordfish
Member

It disappears because if you remove the ability to upload avatars it is no longer a viable option. This actually corrects an anomaly that has been in the system for quite a while. Other options will also disappear from the list if they become redundant.

You – I recall – wanted the ability to upload avatars for your users but not let them do it. I think what you should be doing is having the option to upload them (in the profiles > Avatar panel) turned ON. And the permission for users to upload avatars turned off (in whatever permission sets you are using). If that doesn’t work for you then I will treat it as a bug that needs fixing.

SP Stefano Prete
Stefano Prete
Member

You recall perfectly, Andy!

I set it up as you suggested, but now I cannot upload the avatars myself which is what I need…

YS Yellow Swordfish
Yellow Swordfish
Member

OK – I can work up a fix for that. If you need it would you be happy making a small code change?

YS Yellow Swordfish
Yellow Swordfish
Member

OK – the file is /simple-press/forum/profile/forms/sp-form-avatar.php

Try and locate this line of code:

case 2: # avatar uploading

It is at line number 130 – about half way through the file.

We need to replace the line of code beneath that (i.e., line 131). Use the following:

if (($spAvatars['sfavataruploads'] && sp_get_auth('upload_avatars', '', $userid)) || $spProfileUser->admin) {

Use the Raw Code button to copy the code so you can paste it into the file. That should fix it….

YS Yellow Swordfish
Yellow Swordfish
Member

Oh stupid me, Sorry. the line of code SHOUL:D be:

if (($spAvatars['sfavataruploads'] && sp_get_auth('upload_avatars', '', $userid)) || $spThisUser->admin) {

AND in addition right at the TOP, after the line that reads:

if (empty($userid)) return;

You need to also add a new line:

global $spThisUser;

Sorry about that. Trying to juggle too many things at the same time,

SP Stefano Prete
Stefano Prete
Member

It seems nothing changed…

I need to ask my members whether they can upload avatars or not.

I will keep you updated.

YS Yellow Swordfish
Yellow Swordfish
Member

Oh dear. I am not doing very well am I. OK – I tested this version out and it definitely works!

if (($spAvatars['sfavataruploads'] && sp_get_auth('upload_avatars', '', $userid)) || ($spThisUser->admin)) {

Needed an extra pair of brackets

SP Stefano Prete
Stefano Prete
Member

OK, I changed the code, now let’s see if they can upload avatars…