Support Forum

Default Avatars exist, but SP not finding them

PM Patricia Miller
Patricia Miller
Member

Using SP version 5.6.4

I noticed that when I view my forum when not logged in, the default ‘guest’ avatar does not show (just the image placeholder with a question mark). In the source code it shows the image src=”mm”.

EDIT: This is only for the first ‘avatar’ on the page, in the upper right where it encourages guests to register – in the posts themselves it does display the correct (guest) avatar.

SO my guess is that it’s a flaw in the theme (?) – I created a child theme of the css-only theme in order to modify some of the CSS, but made no other changes to any template files.  If you can tell me where to fix this in the template file, I can do that.

THAT SAID, there is still an ‘oddity’ in the Settings, where it shows that the default avatars folder doesn’t exist when it actually does……read on for that……

In my Settings>Profiles>Avatar Options, at the bottom under Available Default Avatars it says “The avatar defaults folder does not exist”

But in my Settings>Integration>Storage Location it shows that I do indeed have a folder named /sp-resources/forum-avatars as well as a folder for the avatars pool, both show green check marks and writeable…..I also (just to double-check) verified this using my FTP program, the folders are there, are writeable, and do have avatar images including a default ‘guest’ image.

Also not sure this is relevent but in my Avatars Options settings I have the order as this:

Gravatars
WP Avatars
SP Default Avatars
Avatar Pool
Remote Avatars
Uploaded Avatars

Uploading is disabled by choice, and I’m not sure what “remote avatars” is – I enabled that checkbox because I thought it was necessary for Gravatars, but if not please let me know so I can disable it again.

Any ideas on why my default avatars won’t show?

It will be a looooong time before I can update SP because the newer version now *requires* WP 4.5 and it will be a long time before I can update WP, so if there is a fix I need to make in my version let me know – I’m pretty comfortable modifying code if needed.

15 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

The ‘default avatars’ development was released in 5.6.2 so I am a little surprised that problems have not occurred before now.

The folder that holds the default avatars is actually a sub-folder of the ‘forum-avatars’ folder and should be called ‘defaults’. It does not have its own entry in the storage locations listing.

When created during the upgrade default files were moved from the original ‘forum-avatars’ folder into their new location. Perhaps you could take a look there and see what you have. There should be a minimum of 4 of them…

If we can do this first to ensure things are where hey should be then we can look at the other avatars issue.

PM Patricia Miller
Patricia Miller
Member

Hi Yellow Swordfish, thanks for the very quick reply!

It may have been going on for a while, I don’t typically go to my forum when not logged in, but was making some minor CSS tweaks and just wanted to ensure it looked right across several browsers.

SO in my folders, I just have /forum-avatars, and in that folder are three default images (I don’t know if at one time there were four, but there are only three now) they are admindefault.png, guestdefault.png, and userdefault.png.  I also found an /forum-avatars-old folder, but it has the same three images.

It sounds like I need to create a sub-folder called /defaults and move the images to there?

YS Yellow Swordfish
Yellow Swordfish
Member

Correct. We also added a new default avatars for moderators. It is most odd that this did not happen during the upgrade. Considering how long ago it was I am sure we would have heard from others yet this is the first such report.

Anyway – yes create the folder and move those three and then we will see of they reappear as they should!

PM Patricia Miller
Patricia Miller
Member

OK so definitely some progress……

I now have a folder named /sp-resources/forum-avatars/defaults and moved the three images to there.

Now in Profiles>Avatar Options>Available Default Avatars I see those three images (yay!) so I know they are in the right place.  And the image for guest avatar *does* have “guest” checked.

However, when viewing the forum while not logged in, the upper left Avatar (which should be ‘guest’) still does not show, it’s just the image placeholder with the question mark…..so possibly a problem with the Theme template?

I use a Child Theme of the css-only Theme, but have not modified the template files, just the CSS (with the exception of the spGroupView.php to comment out the unread posts list at the bottom).

Is there something I need to change in the Theme?

FYI, I do recall using the built-in WP update function when I updated to my current version of SP, but I don’t recall if I skipped over a version in the process (?) it’s been a while, but maybe that’s why the folders didn’t get reorganized as expected.

YS Yellow Swordfish
Yellow Swordfish
Member

It doesn’t matter if you miss a version – the upgrade still goes through everything needed since you last updated.

How about a double check after you clear your browser cache – just in case that is why it has not yet been found…

PM Patricia Miller
Patricia Miller
Member

OK, cleared cache and tried again, still no image.

Here’s a link, I’d be very interested in what you see…

http://www.bestallinclusive.com/community/

You may remove the link or this post afterward if you like, the site is not yet ready for prime-time. 🙂

YS Yellow Swordfish
Yellow Swordfish
Member

Most odd. It is trying to load an image from ‘http://www.bestallinclusive.com/community/mm/’. And looking at the HTML code at that point – it doesn’t look like it comes form SP… So puzzling,

The template for that is the spHead.php template and the function called is sp_UserAvatar(). Worth a look to see if it is there as it should be.

PM Patricia Miller
Patricia Miller
Member

Yep, most odd.

When I created the Child Theme, I just copied all of the templates to the new theme folder, and only modified the CSS (following the proper procedure to create a child theme, all else seems fine).

So I do have a file named spHead.php, and on line 80 of that file it does have this:

        sp_UserAvatar(‘tagClass=spImg spLeft’);

But your last comments got me thinking about how this is setup – I first began working on this site over a year ago (it was put on hold for a while, then the project was greenlighted again) so I honestly can’t recall why I set things up as I did (I’m pretty sure I would have just followed along with some instructions), but I setup a Page in WP (named “community”) and in my SP settings I have that page ID and the template file specified under “Integration”.

My page uses a template file called ‘forum.php’ which is basically a copy of my (WP theme’s) page.php, in that it uses the content call get_template_part( ‘content’, ‘forum’ ).

In content-forum.php, it’s just a standard template that calls the content – here is what is in that file:

`<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <div class=”entry-content”>
        <?php the_content(); ?>
        <?php wp_link_pages( array(
            ‘before’ => ‘<div class=”page-links”>’ . esc_html__( ‘Pages:’, ‘quark’ ),
            ‘after’ => ‘</div>’,
            ‘link_before’ => ‘<span class=”page-numbers”>’,
            ‘link_after’ => ‘</span>’
        ) ); ?>
    </div><!– /.entry-content –>
</article>`

Nothing out of the ordinary.  Every part of the forum works great – all seems as it should be, just this one odd bug with the default image not showing at the top.  On post topics and replies, they show as expected.

I did try regenerating the permalinks, both in WP and in SP, but it didn’t make a difference.  I can’t find any HTML or code that actually calls that image aside from the one line in spHead.php.

MP Mr Papa
Mr Papa
Member

late to the game, but confused… I dont see any posts (didnt check every post) that would use default avatars.. can you link to one?

Is this still you avatar priorities?

Gravatars
WP Avatars
SP Default Avatars
Avatar Pool
Remote Avatars
Uploaded Avatars

If so, it wont get to default avatars…   it will find a gravatar since it will just display the gravatar default icon (mystery man, G icon, etc) if the address is not recognized…  if it doesnt find a gravatar, it will look for a wp avatar… and will find one…  so not sure how it would get to our default avatars…

PM Patricia Miller
Patricia Miller
Member

Hi Mr Papa, thanks for jumping in.

On posts (topics and replies) the default avatars are showing just fine.

The place where it isn’t is in the upper left corner where, if you’re logged in you’ll see your gravatar, or wp avatar, or the SP default avatars, next to your name, and if you’re not logged in (and are a first time visitor) you’d see the default ‘guest’ avatar.

That’s where it doesn’t show up, just the image placeholder and question mark.

I linked to our forum page above, if you go there (and assuming you’ve not been there before) you should see the guest avatar and a ‘please consider registering’ message (although while the site is still in development we don’t have registration open)…..I’ve tried using different computers and browsers, but it never shows the default avatar in that spot.

I realize it’s a very minor problem, all else works great, I’d just like to figure out this mystery.

MP Mr Papa
Mr Papa
Member

ah, that helps – didnt catch that part..

but still doesnt really explain why you are not getting a gravatar or wp avatar… you still will not get a sp default avatar there… the priorities wont allow it…  gravatar or wp will always provide one…

can you tell me on wp – settings – discussion, what you avatar settings are there?  I assume show is selected but what type is selected?  the mm in your url is odd as that is quite similar to the mystery man (name changed to mystery person but name still mm) url but without the rest of the gravatar url…

can you also show a screenshot of the forum – profiles – avatar options page?  would like to see what you have for the default avatar settings at bottom…

so no other avatar plugins?  or from your wp theme?  might be worth quick check of temp switch to default wp theme and make sure no change..

YS Yellow Swordfish
Yellow Swordfish
Member

mr-papa – it is worth taking a look at he html being output which is malformed and doesn’t look like ours. The classes are wrong for example. But it doe appear to be trying to load a file named ‘mm’ – no file type – just ‘mm’. The only thing that came to mind was ‘mystery man’ which is a WP default avatar. But I have no idea where they load it from.

MP Mr Papa
Mr Papa
Member

precisely what I said about the mm file in my comment being part of the url for gravatar mystery person…  and why curious if another plugin or the wp theme is doing avatar things…

PM Patricia Miller
Patricia Miller
Member

Hi Guys, sorry for the delay, I had to get some sleep 🙂

Well there is good news, at least on the S:P side…..both of your last replies were *very* helpful, even though they mostly posed questions as they were just the sort of questions to get me digging in the right direction.

 

You were both correct that it was apparently trying to use the “mystery man” image, because of my sort order – a new site visitor who is not logged in would not cause a gravatar to display there, so it would look next to the WP default avatars (mystery person is my setting in WP) – but those avatars seem to be missing entirely (and I have no clue where WP looks for them).

I use a plugin called “Easy Author Image” that allows post authors to upload their own image to their profile, but I’m guessing that plugin may have a conflict with WP 4.4.2 or otherwise messed with the avatars, because when I went to see what the WP avatar settings are in Settings>Discussion, all I see is my face – gah!! Not what I expected or want….my author image is shown for all the avatar choices…..must do some work there and I’ll contact that plugin developer for help.

SO I changed up the order in S:P Profiles>Avatar Options to put SP Default Avatars second on the list after Gravatars, accessed the site in a clean browser, and my SP default Guest Avatar shows up!

SO THANK YOU for helping me figure this one out – I have more work to do but at least I know that S:P is doing it’s job perfectly correctly. 🙂