Jump to content

user's avatar instead of name


Recommended Posts

hi my lord

I use the following code to display the name of the topic solver in topicrow template. However, I want to display the user's avatar who solved the topic instead of the name.

{{if $solvedComment = $row->getSolution() AND ( $solvedComment->hidden() == 0 OR ( \in_array( $solvedComment->hidden(), array( 1, -1 ) ) AND $solvedComment->canUnhide() ) )}}
				  {lang="solved_byline" htmlsprintf="$solvedComment->author()->name"}
{{endif}}

 

 

thanks!

Edited by Arash.Ranjbar
Link to comment
Share on other sites


  • Management

You can access the member data using $solvedComment->author(). For an example of the HTML to display the avatar simply look at other templates that show the image.

 

Here's a quick example:

IMAGE ONLY:

<img src='{$solvedComment->author()->photo}' class="ipsUserPhoto ipsUserPhoto_mini">

===

IMAGE WITH PROFILE LINK:

<a href="{$solvedComment->author()->url()}" class='ipsUserPhoto ipsUserPhoto_mini'><img src='{$solvedComment->author()->photo}' class='ipsUserPhoto ipsUserPhoto_mini'></a>

You can also replace ipsUserPhoto_mini with other CSS classes:

  • ipsUserPhoto_tiny
  • ipsUserPhoto_medium
  • ipsUserPhoto_large (this is the class used in posts)
Board Rules - Available Products - Need a Custom Work?

 

< Don't PM me for support, post in the forum or submit a ticket from the client area instead! >

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.