Code to call user's phpBB Avatar

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: Code to call user's phpBB Avatar

Re: Code to call user's phpBB Avatar

by teebling » Wed Jun 10, 2020 7:43 pm

Nevermind, I managed to figure it out myself. For anyone else reading use this:

Code: Select all

<?php
global $w3all_last_t_avatar_dim;
$user = wp_get_current_user();
 
if ( $user ) :
    ?>
   <?php echo '' . get_avatar(get_current_user_id(), $w3all_last_t_avatar_dim); ?>
<?php endif; ?>
This will grab the 'Last Topic' avatar - so unfortunately also any dimensions you set for that in the w3all configuration. But it's still pretty good and did the job for me.

Code to call user's phpBB Avatar

by teebling » Wed Jun 10, 2020 4:35 pm

Hello,

I'm trying to call the current user's phpBB avatar in a template file.

I have tried the default WP get_avatar_url() function but it just returns the default WP 'No Avatar' image.

I can see that the user's phpBB avatar is successfully rendered in the Admin Toolbar, and in the w3all Login/User Info widget. I also see that avatars are working successfully on the Latest Topics Widget. So - the phpBB avatars working correctly on the rest of my site.

I just don't have the PHP code to call the user's phpBB avatar anywhere else in a template file - can you please provide it? It seems to me like a different call than the default get_avatar function.

Thanks

Top