Avatar bug on last topics: non registered user's post associated with actual logged in user (in certain conditions)

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 1 MiB.

Expand view Topic review: Avatar bug on last topics: non registered user's post associated with actual logged in user (in certain conditions)

Avatar bug on last topics: non registered user's post associated with actual logged in user (in certain conditions)

by axew3 » Mon Apr 05, 2021 9:16 am

Manual fix (or download the ready file more below)
file
/wp-content/plugins\/wp-w3all-phpbb-integration/views/phpbb_last_topics.php
search for:

Code: Select all

$w3all_avatar_display = ( is_email( $phpbbUAVA ) !== false ) ? get_avatar($phpbbUAVA, $w3all_last_t_avatar_dim) : '<img alt="" src="'.$phpbbUAVA.'" class="avatar" width="'.$w3all_last_t_avatar_dim.'" height="'.$w3all_last_t_avatar_dim.'">';
change into:

Code: Select all

      if(is_email( $phpbbUAVA )){
      	$w3all_avatar_display = get_avatar($phpbbUAVA, $w3all_last_t_avatar_dim);
      } elseif(!empty($phpbbUAVA)){
      	$w3all_avatar_display = '<img alt="" src="'.$phpbbUAVA.'" class="avatar" width="'.$w3all_last_t_avatar_dim.'" height="'.$w3all_last_t_avatar_dim.'">';
      } else {
      	$w3all_avatar_display = get_avatar(0, $w3all_last_t_avatar_dim);
       }
then search for

Code: Select all

$countn++;
change into:

Code: Select all

  $phpbbUAVA = '';
  $countn++;

or download the ready and updated file on repo:

https://plugins.trac.wordpress.org/expo ... topics.php
and substitute it into folder:
/wp-content/plugins/wp-w3all-phpbb-integration/views/phpbb_last_topics.php

Result: if an user is not existent into wordpress, and own an avatar in phpBB his phpBB avatar will display.
If the user exist in WP and own an avatar, the avatar will display.
It the user do not own any avatar that can display, both in wp and phpBB, then the dafault WP gravatar, based on WP Settings -> Discussion -> Gravatar will display for the user.

Top