phpBB avatars not loading correctly in wpDiscuz and Post Author

teebling
User w
User w
Posts: 11
Joined: Wed Jun 10, 2020 4:26 pm

phpBB avatars not loading correctly in wpDiscuz and Post Author

Post by teebling »

Hello again,

When a user is logged in, they see the post author's phpBB avatar correctly in the 'post author' section of a typical blog.
unknown.png
unknown.png (174.61 KiB) Viewed 2457 times
However when it is a guest visitor, they see the default 'no avatar' image:
unknown2.png
unknown2.png (216.98 KiB) Viewed 2457 times
There is also a similar issue in the comments section, using the plugin wpDiscuz. When the user who posted the comment themselves is logged in, they see their avatar. But when you're logged in as a different user, or a guest, you only see the default noavatar image:
Screen Shot 2020-06-17 at 17.56.40.png
Screen Shot 2020-06-17 at 17.56.40.png (103.37 KiB) Viewed 2457 times
Does w3all natively support phpBB avatars in the post author meta and in comments, and this is merely a misconfiguration? Or does it not support this functionality yet?

Thanks,
Teeb
teebling
User w
User w
Posts: 11
Joined: Wed Jun 10, 2020 4:26 pm

Re: phpBB avatars not loading correctly in wpDiscuz and Post Author

Post by teebling »

In fact, interestingly enough, when I view a normal user's profile as an admin in wp-admin, they don't have their phpBB avatar either... I thought that the gravatars of all users change to their phpBB avatar as per the configuration?

It seems that you only see phpBB avatars when you are logged in as that user.
teebling
User w
User w
Posts: 11
Joined: Wed Jun 10, 2020 4:26 pm

Re: phpBB avatars not loading correctly in wpDiscuz and Post Author

Post by teebling »

One last thing to note is that all the phpBB users have 'Gallery' type avatars - that is - they haven't uploaded a picture for their avatar, they have chosen their avatar from a gallery of images in phpBB.

My question is this - why are phpBB avatars not replacing gravatars on WP?
teebling
User w
User w
Posts: 11
Joined: Wed Jun 10, 2020 4:26 pm

Re: phpBB avatars not loading correctly in wpDiscuz and Post Author

Post by teebling »

At some point we moved the wordpress installation up one directory, from the root / to content. Perhaps the database is still using the old path to the avatar files or something?
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: phpBB avatars not loading correctly in wpDiscuz and Post Author

Post by axew3 »

Did you set
Retrieve phpBB avatars by using native phpBB file.php
option to yes, done this, if an user have an avatar in phpBB, of any flavor, then it should display into wordpress posts or shortcodes or widgets.
The unique wordpress page where avatars may DO NOT affect/display is on
WP admin -> Settings -> Discussion (for a reason i will not go to explain now here but you are noticed that this is it, if the avatar to retrieve isn't gravatar, it will not display in this admin page)

And there are some points where you're right, if an admin is editing an user profile, it do not display, until THE EDITED user do not have almost a comment or reply in wp, or a post in phpBB. If editing your profile, it will display in any case.
This is normal as the code is, because it retrieve avatars for current logged user, all others that are retrieved when you see a post in wp with replies. There are more aspects by the way. All easy to be resolved.

To make the long story short, to fix the bug that when an admin edit an user profile, and it do not show the user's avatar:
OPEN file
/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php
there are these two lines

Code: Select all

// add the current user
// if any other condition fail assigning avatars to users, add it here
just after, add the follow:

Code: Select all

if (isset($_GET['user_id'])){
 	 $guid = intval($_GET['user_id']);
  	$u = get_user_by( 'ID', $guid );
   if(!empty($u)){
 	  $p_unames[] = $u->user_email;
 	 }
 }
So into default wordpress it will work, the user_id of the wp user passed via GET while editing an user profile, you can so grab the user email of this user with the code above, used then to retrieve needed avatars into phpBB.

But the plugin you are using, works the same way? Pass the user_id var when an user profile viewed or edited? Maybe into a custom front-end page?
Do you have this example online? (so i can check without installing the plugin to test).
This fix will be added by default into next coming 2.3.6, as well all others you may report to be fixed, if still not resolved with this simple addition.
Post Reply