On integration plugin WP_w3all phpBB WordPress, at date of this post, the code do not return correct avatars results, if the user that the avatar need to be retrieved for, isn't already also registered member in WordPress, or the plugin run as
"No linked users".
To resolve this issue, on file:
/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php
function:
there is this code:
Code: Select all
if($usid):
$wp_user_phpbb_avatar[] = array("wpuid" => $usid->ID, "phpbbavaurl" => $ava_set_x['uavaurl'], "phpbbuid" => 0);
endif;
that lead to fill the array, but only if it is a wp user, and will not be possible to check against nothing to assign after the avatar for a specific post.
Then this may need to be changed into:
Code: Select all
if($usid):
$wp_user_phpbb_avatar[] = array("wpuid" => $usid->ID, "phpbbavaurl" => $ava_set_x['uavaurl'], "phpbbuid" => 0);
else:
$wp_user_phpbb_avatar[] = array("wpuid" => 0, "phpbbavaurl" => $ava_set_x['uavaurl'], "phpbbuid" => $ava_set_x['puid']);
endif;
Then on
/wp-content/plugins/wp-w3all-phpbb-integration/views/phpbb_last_topics.php for example
(so these changes needs to be applied on each views/ folder files that display shortcodes etc )
where:
immediately after, this should be added:
Code: Select all
// added
$w3phpbbuava = unserialize(W3ALLPHPBBUAVA);
and where:
Code: Select all
$countn = 0;
foreach ($last_topics as $key => $value) {
immediately after add:
Code: Select all
// added
if(!empty($w3phpbbuava)){
foreach($w3phpbbuava as $k){
if($k['phpbbuid'] == $value->user_id && $k['phpbbuid'] > 1){
$phpbbUAVA = $k['phpbbavaurl'];
}
}
}
then where:
Code: Select all
if( ! $wpu ){
$w3all_avatar_display = get_avatar(0, $w3all_last_t_avatar_dim);
} else {
$w3all_avatar_display = get_avatar($wpu->ID, $w3all_last_t_avatar_dim);
}
}
should be changed in:
Code: Select all
if( ! $wpu && isset($phpbbUAVA) ){
$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.'">';
} elseif ( ! $wpu && !isset($phpbbUAVA) ) {
$w3all_avatar_display = get_avatar(0, $w3all_last_t_avatar_dim);
} else {
$w3all_avatar_display = get_avatar($wpu->ID, $w3all_last_t_avatar_dim);
}
}
- result_ava1.png (26.32 KiB) Viewed 17878 times
If nothing wrong should work on any situation now but i've still not test on all configuration, so appreciated any possible report.
On integration plugin WP_w3all phpBB WordPress, at date of this post, the code do not return correct avatars results, if the user that the avatar need to be retrieved for, isn't already also registered member in WordPress, or the plugin run as [b]"No linked users"[/b].
To resolve this issue, on file:
[i]/wp-content/plugins/wp-w3all-phpbb-integration/[b]class.wp.w3all-phpbb.php[/b][/i]
function:
[code]wp_w3all_assoc_phpbb_wp_users()[/code]
there is this code:
[code]if($usid):
$wp_user_phpbb_avatar[] = array("wpuid" => $usid->ID, "phpbbavaurl" => $ava_set_x['uavaurl'], "phpbbuid" => 0);
endif;[/code]
that lead to fill the array, but only if it is a wp user, and will not be possible to check against nothing to assign after the avatar for a specific post.
Then this may need to be changed into:
[code] if($usid):
$wp_user_phpbb_avatar[] = array("wpuid" => $usid->ID, "phpbbavaurl" => $ava_set_x['uavaurl'], "phpbbuid" => 0);
else:
$wp_user_phpbb_avatar[] = array("wpuid" => 0, "phpbbavaurl" => $ava_set_x['uavaurl'], "phpbbuid" => $ava_set_x['puid']);
endif;[/code]
Then on [i]/wp-content/plugins/wp-w3all-phpbb-integration/views/[b]phpbb_last_topics.php[/b][/i] for example
(so these changes needs to be applied on each views/ folder files that display shortcodes etc )
where:
[code]if(!empty($last_topics)){[/code]
immediately after, this should be added:
[code]// added
$w3phpbbuava = unserialize(W3ALLPHPBBUAVA);[/code]
and where:
[code]$countn = 0;
foreach ($last_topics as $key => $value) {[/code]
immediately after add:
[code]// added
if(!empty($w3phpbbuava)){
foreach($w3phpbbuava as $k){
if($k['phpbbuid'] == $value->user_id && $k['phpbbuid'] > 1){
$phpbbUAVA = $k['phpbbavaurl'];
}
}
}[/code]
then where:
[code] if( ! $wpu ){
$w3all_avatar_display = get_avatar(0, $w3all_last_t_avatar_dim);
} else {
$w3all_avatar_display = get_avatar($wpu->ID, $w3all_last_t_avatar_dim);
}
} [/code]
should be changed in:
[code] if( ! $wpu && isset($phpbbUAVA) ){
$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.'">';
} elseif ( ! $wpu && !isset($phpbbUAVA) ) {
$w3all_avatar_display = get_avatar(0, $w3all_last_t_avatar_dim);
} else {
$w3all_avatar_display = get_avatar($wpu->ID, $w3all_last_t_avatar_dim);
}
}
[/code]
[attachment=0]result_ava1.png[/attachment]
If nothing wrong should work on any situation now but i've still not test on all configuration, so appreciated any possible report.