Notifications
Clear all

Style [Solved] Show Likers with their avatar

8 Posts
3 Users
4 Reactions
988 Views
Tutrix
Posts: 1453
Topic starter
(@tutrix)
Noble Member
Joined: 5 years ago

Hi,

i have mudified the mentioned members and the likers (in a separate line) so that the avatar is also shown.

everything works fine for the members mentioned

but the Likers only avatars are displayed that were uploaded via the upload function of wpForo
Gravatars or Letters Avatar (plugin) are not displayed

example post

i use this code for the likers, adjusted to the number of likers [0][1][2]

' . esc_url(WPF()->member->get_avatar_url($l_usernames[0]['ID'])) . '

can someone give me the correct code that all avatars are displayed 😉 

7 Replies
Chris
Posts: 3627
(@chris)
Famed Member
Joined: 3 years ago

Hi @tutrix,

Try this methods in Members Class

WPF()->member->get_avatar()

or

WPF()->member->avatar()
1 Reply
Tutrix
(@tutrix)
Joined: 5 years ago

Noble Member
Posts: 1453

Hi @chris 

thanks for your help
but what do you mean by "members class"?

my complete avatar code above currently looks like this

first liker

<span class="nickname-ava"><img src="' .esc_url(WPF()->member->get_avatar_url($l_usernames[0]['ID'])) . '"/></span>

second liker

<span class="nickname-ava"><img src="' .esc_url(WPF()->member->get_avatar_url($l_usernames[1]['ID'])) . '"/></span>

etc.

have now tested different versions with your code, but always gives an error 😉 

 

for the mentioned members I use this code

<span class="nickname-ava">' . WPF()->member->avatar( $member ).' </span>

but it does not work for the Likers

Posts: 201
 fawp
(@fawp)
Reputable Member
Joined: 5 years ago
Posted by: @tutrix

have now tested different versions with your code, but always gives an error

What error are you getting?

1 Reply
Tutrix
(@tutrix)
Joined: 5 years ago

Noble Member
Posts: 1453

@fawp 

  • a half crashed forum
  • a fully crashed forum
  • syntax error if I forget a character 😀 
  • an empty image path like the code used so far

    if you know the right code, just post it 😉 

Posts: 201
 fawp
(@fawp)
Reputable Member
Joined: 5 years ago
Posted by: @tutrix

if you know the right code, just post it

No, I don't use any such function. The reason I asked is I thought you were getting a php error which might have been helpful to wpForo support, but it seems you are not getting those.

1 Reply
Tutrix
(@tutrix)
Joined: 5 years ago

Noble Member
Posts: 1453

@fawp 

ok, thanks for trying to help

Tutrix
Posts: 1453
Topic starter
(@tutrix)
Noble Member
Joined: 5 years ago

Have now found the correct code 😀 

are these 3 lines for the 3 displayed Likers

<span class="nickname-ava">' .WPF()->member->get_avatar($l_usernames[0]['ID']). '</span>
<span class="nickname-ava">' .WPF()->member->get_avatar($l_usernames[1]['ID']). '</span>
<span class="nickname-ava">' .WPF()->member->get_avatar($l_usernames[2]['ID']). '</span>