Thank you every one for your input!
Here is what I came up with:
administrator/components/com_kunena/libraries/user.php
Code:
public function profileIcon($name) {
$kunena_config = KunenaFactory::getConfig (); //Added This line and next
$isRegistered = KunenaFactory::getUser()->exists();
switch ($name) {
case 'gender' :
switch ($this->gender) {
case 1 :
$gender = 'male';
break;
case 2 :
$gender = 'female';
break;
default :
$gender = 'unknown';
}
$title = JText::_ ( 'COM_KUNENA_MYPROFILE_GENDER' ) . ': ' . JText::_ ( 'COM_KUNENA_MYPROFILE_GENDER_' . $gender );
return '<span class="kicon-profile kicon-profile-gender-' . $gender . '" title="' . $title . '"></span>';
break;
case 'birthdate' :
if ($this->birthdate && ($isRegistered || $kunena_config->pubprofile != 0)) { //Added member condition so not public unless profile is set to public in Kunena config
jimport('joomla.utilities.date');
$date = new JDate ( $this->birthdate, 0 );
if ($date->toFormat('%Y')<1902) break;
return '<span class="kicon-profile kicon-profile-birthdate" title="' . JText::_ ( 'COM_KUNENA_MYPROFILE_BIRTHDATE' ) . ': ' . CKunenaTimeformat::showDate ( $this->birthdate, 'date', 'utc', 0 ) . '"></span>';
}
break;
case 'location' :
if ($this->location)
return '<span class="kicon-profile kicon-profile-location" title="' . JText::_ ( 'COM_KUNENA_MYPROFILE_LOCATION' ) . ': ' . kunena_htmlspecialchars ( $this->location ) . '"></span>';
break;
case 'website' :
$url = 'http://' . $this->websiteurl;
if (! $this->websitename)
$websitename = $this->websiteurl;
else
$websitename = $this->websitename;
if ($this->websiteurl)
return '<a href="' . kunena_htmlspecialchars ( $url ) . '" target="_blank"><span class="kicon-profile kicon-profile-website" title="' . JText::_ ( 'COM_KUNENA_MYPROFILE_WEBSITE' ) . ': ' . kunena_htmlspecialchars ( $websitename ) . '"></span></a>';
break;
case 'private' :
$pms = KunenaFactory::getPrivateMessaging ();
return $pms->showIcon ( $this->userid );
break;
case 'email' :
// TODO: show email
return; // '<span class="email" title="'. JText::_('COM_KUNENA_MYPROFILE_EMAIL').'"></span>';
break;
case 'profile' :
if (! $this->userid)
return;
return CKunenaLink::GetProfileLink ( $this->userid, '<span class="profile" title="' . JText::_ ( 'COM_KUNENA_VIEW_PROFILE' ) . '"></span>' );
break;
}
}
This is the entire function. Right after the function call you can see I added a call to get from the database Kunea config and to populate a variable for user status.
Code:
public function profileIcon($name) {
$kunena_config = KunenaFactory::getConfig (); //Added This line and next
$isRegistered = KunenaFactory::getUser()->exists();
Then added the condition:
Code:
case 'birthdate' :
if ($this->birthdate && ($isRegistered || $kunena_config->pubprofile != 0)) { //Added member condition so not public unless profile is public in Kunena config.
I also added the same code to social Icons in case someone wants to make a custom template to include these on the summery profile beside or on top of posts in the attached file.
Thank you all and maybe this helps someone