By Christian Hostettler on Tuesday, 14 May 2019
Posted in General
Likes 0
Views 452
Votes 0
Hi StackIdeas
We are currently writing overrides to get the ED forum pages and modules ready for our template using UI Kit.
In the module ED Recent Discussions we also want to display the avatar of the last replier, analogous to displaying the avatar of the author of a recent post.

<?php if ($params->get('show_avatar', 1)) { ?>
<?php echo ED::themes()->html('user.avatar', $post->getOwner(), array('rank' => false, 'status' => true)); ?>
<?php } ?>
How can we display the author of the last replier in the same way?
Best regards
Christian
Hey there,

Do you mean that you want to show the avatar of the last replier in the module?

If yes, you can add the following PHP code into your module override:

<?php if ($post->getLastReplier()) { ?>
<li class="current">
<div>
<a href="<?php echo $post->getLastReplier()->getPermalink(); ?>" class="o-avatar o-avatar--sm">
<img src="<?php echo $post->getLastReplier()->getAvatar(); ?>"/>
</a>
</div>
</li>
<?php } ?>
·
Tuesday, 14 May 2019 17:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Irwin
Yes, we wont to show the avatar of the last replier in the module. And thank You for the snippet! It works, but now we use this,

<?php if ($post->getLastReplier()) { ?>
<?php echo ED::themes()->html('user.avatar', $post->getLastReplier(), array('rank' => false, 'status' => true)); ?>
<?php } ?>

because we need the same layout/style like the author avatar display.

So, it works fine, thank You!
Best regards
Christian
·
Tuesday, 14 May 2019 19:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Tuesday, 14 May 2019 19:39
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post