By Fagault Eric on Saturday, 05 August 2017
Posted in General
Likes 0
Views 306
Votes 0
Hello,
I would like to know how it is possible to retrieve information present in the profiles of the users.
For example, gender, date of birth ...

I was thinking of something like:

<?php
$idTarget = 984; // pour tests
require_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/easysocial.php');
$profil = ES::user($idTarget);
$genreText = $profil->user->getFieldValue('gender');
echo $genreText;
?>


Best regards.

Eric
Perhaps you can try this :


$idTarget = 984; // pour tests
require_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/easysocial.php');
$profil = ES::user($idTarget);
$genreText = $profil->getFieldValue('gender');
echo $genreText;


That 'gender' is unique key from the user custom field, you can find those unique key from backend > Easysocial > profile type > select profile type > custom field > edit custom field > advanced , you can refer on my attached screenshot below.
·
Saturday, 05 August 2017 09:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Arlex,
Thank you very much.

Best regards.
Eric
·
Saturday, 05 August 2017 17:24
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Eric, glad that your issues are resolved now
·
Sunday, 06 August 2017 00:03
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post