By Josh Lewis on Wednesday, 19 August 2015
Posted in General Issues
Likes 0
Views 2.3K
Votes 0
I'm trying to get the author of a article module to link to the respective profile. On my frontpage you can see that the author links do not link to a profile. The module currently supports CB, JomSocial, and Kunena but not CB. As I understand it, this is the code used to link to each profile type:

/* COMMUNITY BUILDER LINK */

$cblink = JRoute::_('index.php?option=com_comprofiler&task=userProfile&user=' . $row->created_by);

/* JOMSOCIAL LINK */

$jslink = JRoute::_('index.php?option=com_community&view=profile&userid=' . $row->created_by);

/* KUNENA LINK */

$kunlink = 'index.php?option=com_kunena&func=profile&userid=' . $row->created_by;


For the sake of making this as easy as possible, I'm wanting to swap out the CommunityBuilder link method to link to ES. I assume this is kinda close?

$cblink = JRoute::_('index.php?option=com_easysocial&task=profile&user=' . $row->created_by);


I know how to link to the currently logged in user but am not sure how to prefer to a user. I suppose it's even more work if I want to use the permalink for the link? If I remember right the module produces clean SEF url's (to the public) with the code mentioned above for the given profile systems. And yes I've looked through the ES dev docs.
Hello Josh,

You might want to try this:


require_once(JPATH_ROOT . '/administrator/components/com_easysocial/includes/foundry.php');

$user = FD::user($row->created_by);
$profileLink = $user->getPermalink();



Hope this helps.
·
Wednesday, 19 August 2015 10:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Yeay, it works! In addition to what you said I replaced all instances of $cblink with $profileLink so that I wouldn't run into any conflicts with the variables. Thanks Nick for your assistance.
·
Wednesday, 19 August 2015 10:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Josh,

You're welcome.
·
Wednesday, 19 August 2015 10:45
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post