Kunena 7.0.6 & Kunena 6.4.12 – Security Updates Released

The Kunena team has announce the arrival of Kunena 7.0.6 [K 7.0.6] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0.

The Kunena team is also pleased to announce the twelfth version of Kunena 6.4, a native Joomla extension for Joomla! 5.0, 5.1, 5.2, 5.3, 5.4 and 6.0.

Solved How do i get the post author id?

More
10 years 6 months ago #170612 by Baze
Hi guys,

i'm using this code to show JomSocial custom fields under the Kunena avatar in the forum:
Code:
$authorid = $this->profile->userid; $username = $this->profile->username; $jspath = JPATH_BASE.DS.'components'.DS.'com_community'; include_once($jspath.DS.'libraries'.DS.'core.php'); $cuser =& CFactory::getUser($authorid); $db=JFactory::getDBO(); $bike = $cuser->getInfo('FIELD_MODEL'); echo "Bike: $bike";

i have this in /components/com_kunena/template/mytemplate/layouts/user/profile/default.php

So in kunena under the avatar on each post i see the "Bike:" label but the data on all posts is from the logged in user, not the user who wrote the post. Any idea how can i get the current author and to show the custom field for him?

Using JomSocial 4.x, Kunena 4.0.7

thanks

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

More
10 years 6 months ago #170632 by Baze
OK, got it myself.

I you want to show JomSocial custom fields under Kunenas user avatar, here's the code:
Code:
<?php //get important Joomla data and connections $authorid = $this->profile->userid; $username = $this->profile->username; $jspath = JPATH_BASE.DS.'components'.DS.'com_community'; include_once($jspath.DS.'libraries'.DS.'core.php'); $buser =& CFactory::getUser($authorid); $baze = $buser->getInfo('FIELD_yourfield'); if ($baze) { echo "Label: $baze"; } ?>

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

Time to create page: 0.220 seconds