Notifications
Clear all

Can wpDiscuz Load wpForo Uploaded Avatar Image?

11 Posts
3 Users
0 Reactions
3,868 Views
Curtis
(@cbisel16)
Member Customer
Joined: 8 years ago
Posts: 60
Topic starter  

I am using wpDiscuz and wpForo — with most of your add-ons for each. I have members of my website logging in and using wpForo as my community forum, and adding comments under my Blog posts.

My members are all uploading their own avatar photos in wpForo on their profile settings page, choosing the "

Problem I'm having is then when my Members comment on my Blog posts on my website, their woForo uploaded images for avatars aren't showing up in their comments (using wpDiscuz). I know it's the same account they are using (email) because I also have myCred and gVector myCred plugins installed, so their "point" count is showing up correctly under their generic avatar. Instead of their uploaded avatar, it's just showing the generic wordpress system one for someone without a unique avatar.

How can I get wpDiscuz to pull from their wpForo uploaded avatar image and display that one systemwide (even widgets for things like myCred leaderboard lists of users etc)?


   
Quote
Curtis
(@cbisel16)
Member Customer
Joined: 8 years ago
Posts: 60
Topic starter  

I found this forum post by Astghik that seems to show a workaround for those using wpForo and Ultimate Member plugins together, but I'm not sure it's a fix for my issue as well, and might cause other problems:

1) the line of code it asks to find and replace doesn't seem to exist anymore (probably has been updated by now)

2) if I do change this code in my custom theme file, this class.WpdiscuzWalker.php file seems to be really long with a lot of code to it. Surely this code will change often and once I update wpForo and wpDiscuz a few times, won't my "walker" file now be out of date if you all update this walker file? I don't think I am savvy enough to constantly update this file every time in my custom theme folder you all make updates to it.

Is there another option to sync these avatars in both wpForo and wpDiscuz?


   
ReplyQuote
Astghik
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6191
 

Hi @cbisel16,

Please add the following code in your current active theme functions.php file. 

if (function_exists('wpforo_avatar') && function_exists('um_get_avatar')) {
add_filter('get_avatar', function ($avatar, $id_or_email, $size, $default, $alt, $args) {
if (isset($args['wpdiscuz_current_user'])) {
remove_filter('get_avatar', 'wpforo_avatar');
add_filter('get_avatar', 'wpforo_avatar', 99999999999999999, 5);
}
}, 1, 6);
}

   
ReplyQuote
Curtis
(@cbisel16)
Member Customer
Joined: 8 years ago
Posts: 60
Topic starter  

Thank you @astghik,

I just added the above code to my custom theme's functions.php file, and I am not seeing any changes to my wpDiscuz comments (by commenters I know have a wpForo uploaded avatar image).

After saving functions.php, I also cleared wpDiscuz all caches, wpForo all caches, cleared my host's cache, and then cleared my browser's cache. I also tried using a private browsing tab just to be sure.

Could there be a delay, or should I see results immediately with cleared caches?

Do you have any other code variations I could try?


   
ReplyQuote
Astghik
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6191
 

Hi @cbisel16,

It doesn't change even the avatars of existing comments? 

On our test website, it changes the avatars of already existing comments but doesn't change the avatars on the comment box section. Please let us know is it the same in your case?

avatar

   
ReplyQuote
Curtis
(@cbisel16)
Member Customer
Joined: 8 years ago
Posts: 60
Topic starter  

Hi @astghik,

Sadly no. The added code didn't affect previous existing wpDiscuz comments.

I get what you are saying in how the fix works, that your code won't affect the avatar in the comment box where the user will be adding a new wpDiscuz comment, but it should affect their previously published comment avatars.

Here are a couple screenshots I just made concurrently showing you how a user's image looks in wpForo in the profile settings area where his avatar was uploaded, and then how it looks when he's signed in and about to write another comment on a blog post, and showing a published "test" comment he wrote underneath.

1 mearl profile settings
2   Mearl Comment Box and Comment

So, you can clearly see both avatars in my wpDiscuz comments have the wp default avatar.  


   
ReplyQuote
Astghik
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6191
 

@cbisel16,

Please navigate to Dashboard > Forums > Settings > Features admin page, enable the "Replace Author Avatar with Forum Profile Avatar" option and check again. Let us know how it works.

Don't forget to delete all caches before checking. 


   
ReplyQuote
Curtis
(@cbisel16)
Member Customer
Joined: 8 years ago
Posts: 60
Topic starter  

@astghik,

The "Replace Author Avatar with Forum Profile Avatar" option was already enabled. So this was enabled this whole time — even before I added the code you provided me.

Here's are how that group of options are set:

2018 11 17  wpForo Settings

 

I looked in wpDiscuz settings area just to see if there is a similar option with Avatars that needed to be set in a specific way, and I didn't see one.


   
ReplyQuote
 Tom
(@tomson)
Famed Member Admin
Joined: 10 years ago
Posts: 4214
 

Hi @cbisel16,

Please navigate to Dashboard > Comments > Settings > Cache Tab and click on these buttons:

  • Purge expired caches
  • Purge statistics caches

   
ReplyQuote
Curtis
(@cbisel16)
Member Customer
Joined: 8 years ago
Posts: 60
Topic starter  

Hi @tomson,

Thanks for your suggestion Tom, everything at this point is worth a try.

I just Purged these two caches, cleared browser cache.. still displaying generic avatars.  

Purged host CDN.. same thing.  🙁

 

Is there a way when users upload a personal avatar image in their wpForo profile settings page, to have it (also) save it as the avatar that is associated with their individual Wordpress account? When I go to my Wordpress Dashboard > Users > [user account], I am seeing the generic wordpress avatar there (too). If this wpForo image was associated as the Wordpress account avatar (as well), wouldn't it then always show up in comments? (no matter what commenting system was used even?)

I know, I know... it's easy for me to suggest this since I am not a developer, looking out for other potential issues this could cause that I have clue of from my limited perspective. But in my case, in my mind the pros would seem to outweigh the cons at this point. And maybe as well for anyone else using both wpForo and wpDiscuz together who is having the same issue I am having, with customers wondering if they aren't "logged in" before adding their comments on blog posts because their image they know is associated with their logged in user account isn't displaying with their blog post comments.


   
ReplyQuote
 Tom
(@tomson)
Famed Member Admin
Joined: 10 years ago
Posts: 4214
 

If you've added any custom functions for avatars in theme functions.php please remove those.

Then delete user cache in Dashboard > Forums > Dashboard admin page. wpForo displays user avatars in wpDiscuz without any extra manipulation, all extra things just affects it. Also if you have some profile plugin installed (BuddyPress or Ultimate Member) please let me know.


   
ReplyQuote
Share:
Scroll to top