Kunena 6.3.0 released

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

Solved How to add custom fields to User statistics ?

More
11 years 3 months ago - 11 years 3 months ago #11 by Baze
ok, i did it, now the code checks if the fields are empty and it shows them

/components/com_kunena/template/blue_eagle/html/topic/default_profile_vertical.php (or your templates name if you have override for default_profile_vertical.php

at the bottom add this:
Code:
<?php $authorid = $this->profile->userid; $jspath = JPATH_BASE.DS.'components'.DS.'com_community'; include_once($jspath.DS.'libraries'.DS.'core.php'); $user =& CFactory::getUser($authorid); //put all your custom field code here, you can put as much as you want. In backend open components->jomsocial->custom profiles, to see your field codes and replace them in this code (replace cb_gender,cb_city..with your codes) $data1 = $user->getInfo('cb_gender'); $data2 = $user->getInfo('cb_city'); $data3 = $user->getInfo('cb_motor'); $data4 = $user->getInfo('cb_club'); //and here we print the data, you should manually change the labels (birthday, gender..) to whatever suits you if ($data1== '') {} else {echo '<li>Gender: '.$data1.'</li>';} if ($data2== '') {} else {echo '<li>City: '.$data2.'</li>';} if ($data3== '') {} else {echo '<li>Motorcycle: '.$data3.'</li>';} if ($data4== '') {} else {echo '<li>Club: '.$data4.'</li>';} ?>
Last edit: 11 years 3 months ago by Baze.
The following user(s) said Thank You: flagking

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

Time to create page: 0.581 seconds