Code:
function getProfileLink( $profilechoice, $userinfo, $xhtml=true )
{
switch ( $profilechoice )
{
case 'ku' :
$profilLink = JRoute::_('index.php?option=com_kunena&func=fbprofile&userid='.$userinfo->userid, $xhtml);
$menu = 'com_kunena';
break;
case 'cb' :
$profilLink = JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='.$userinfo->userid,$xhtml);
$menu = 'index.php?option=com_comprofiler&view=userprofile';
break;
case 'cbe' :
$profilLink = JRoute::_( 'index.php?option=com_cbe&task=userProfile&user=' . $userinfo->userid, $xhtml);
$menu = 'index.php?option=com_cbe&task=userProfile';
break;
case 'js' :
$profilLink = JRoute::_( 'index.php?option=com_community&view=profile&userid=' . $userinfo->userid, $xhtml);
$menu = 'index.php?option=com_community&view=profile';
break;
case 'es' :
$profilLink = JRoute::_('index.php?option=com_easysocial&view=profile&id='.$userinfo->userid, $xhtml);
$menu = 'index.php?option=com_easysocial&view=profile';
break;
case 'ep' :
$profilLink = JRoute::_('index.php?option=com_jsn&view=profile&id='.$userinfo->userid, $xhtml);
$menu = 'index.php?option=com_jsn&view=profile';
break;
case 'j!' :
$profilLink = JRoute::_( 'index.php?option=com_users&view=profile', $xhtml);
$menu = 'index.php?option=com_users&view=profile';
break;
case 'jw' :
if (is_file ( JPATH_ROOT . '/components/com_awdwall/helpers/user.php' ))
{
include_once JPATH_ROOT . '/components/com_awdwall/helpers/user.php';
$itemId = AwdwallHelperUser::getComItemId();
$profilLink = JRoute::_('index.php?option=com_awdwall&view=awdwall&layout=mywall&wuid=' . $userinfo->userid . '&Itemid=' . $itemId, false);
} else $profilLink = '';
$menu = '';
break;
default :
// AUP Link Profile
$profilLink = JRoute::_( 'index.php?option=com_altauserpoints&view=account&userid=' . $userinfo->referreid , $xhtml);
$menu = 'index.php?option=com_altauserpoints&view=account';
break;
}
if($menu !=''){
$db = JFactory::getDBO();
$lang = JFactory::getLanguage();
$q = "SELECT id FROM #__menu
WHERE `link`=".$db->quote($menu)."
AND `type`='component' AND `published`='1' AND access='1' AND ( language =".$db->quote($lang->getTag())." OR language='*')";
$db->setQuery( $q );
$profilLink .= '&Itemid=' . $db->loadResult();
}
return $profilLink;
}
Let me know the result.