×
Kunena 5.1.12.1 Released - Security release (22 Apr 2019)

The Kunena team has announce the arrival of Kunena 5.1.12.1 [K 5.1.12.1] which is now available for download as a native Joomla extension for J! 3.9.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1. This is a security release.

Solved Load/Display user avatar image inside post

More
7 months 1 week ago - 7 months 1 week ago #1 by ante.resetar
Hi guys. I want to load user avatar image inside the post.

This is my template code inside template/crypsis/layouts/message/item/default.php and it displays created date, edited date, ID and username...

<small class="text-muted pull-right">
		<?php if ($this->ipLink && !empty($this->message->ip)) : ?>
			<?php echo KunenaIcons::ip(); ?>
			<span class="ip"> <?php echo $this->ipLink; ?> </span>
		<?php endif; ?>
		<?php echo KunenaIcons::clock(); ?>
		<?php echo $message->getTime()->toSpan('config_post_dateformat', 'config_post_dateformat_hover'); ?>
		<?php if ($message->modified_time) : ?> - <?php echo KunenaIcons::edit() . ' ' . $message->getModifiedTime()->toSpan('config_post_dateformat', 'config_post_dateformat_hover'); endif; ?>
		<a href="#<?php echo $this->message->id; ?>" id="<?php echo $this->message->id; ?>"
		   rel="canonical">#<?php echo $this->numLink; ?></a>
		<span class="visible-phone"><?php echo Text::_('COM_KUNENA_BY') . ' ' . $message->getAuthor()->getLink(); ?></span>
	</small>

After the username i want to display the user avatar. I'm not very skilled with PHP but i know you are :)

Thank you
Last edit: 7 months 1 week ago by ante.resetar.

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago #2 by ante.resetar
Any help much appreciated. Thank you

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago #3 by 810
try:
<?php echo $this->message->getAuthor()->getAvatarImage(KunenaFactory::getTemplate()->params->get('avatarType'), 120);

where 120 is the size.

Please Log in or Create an account to join the conversation.

More
7 months 2 days ago #4 by ante.resetar
That worked like charm! Mark as solved. Thank you chief!

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.068 seconds