×
Kunena 5.2 Beta 1 Released (Yesterday)

The Kunena team is thrilled to announce the first public beta release of Kunena 5.2, a native Joomla extension for Joomla 3.9. This is a development release and should be only be used for testing; this version is not recommended for live websites at this stage.

The purpose of this release is to encourage testing by downloading, installing and identifying any problems or shortcomings that people may discover. K 5.2.0 B1 is stable and we are aware that people will discover defects. We encourage you to use the forum to report defects, as soon as they are discovered, so that the development team can work through the problems before the release of K 5.1 as a stable product. Reporting defects does not mean that the problems can or will be fixed. The Kunena team is looking forward to hearing your feedback on how well we have achieved our design goals.

Solved Load/Display user avatar image inside post

More
1 year 9 months ago - 1 year 9 months 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: 1 year 9 months ago by ante.resetar.

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

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

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

More
1 year 9 months 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
1 year 9 months 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.096 seconds