By Fagault Eric on Saturday, 06 May 2017
Posted in General
Likes 0
Views 161
Votes 0
Hello,
I would like to add the gender of the member in the application "Suggestion of friends", can you tell me which file is concerned and where it is?
Thank you very much.

Best regards.

Eric
Hello Eric,

The theme file that is responsible to output the friend suggestions are located in /components/com_easysocial/themes/wireframe/helpers/user/user.suggest.php
·
Saturday, 06 May 2017 17:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
Thank you for your reply.
In the database, I look for the table in which the gender of the member is indicated.
Can you tell me what this table is?
Best regards.
Eric
·
Saturday, 06 May 2017 18:22
·
0 Likes
·
0 Votes
·
0 Comments
·
You need to identify the field key used for that custom field. By default it should be named as "GENDER" but you could try something like this,

[gist]
$suggestion->user->getFieldData('GENDER');
[/gist]
·
Saturday, 06 May 2017 18:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
Thank you for your reply.
That's what I did.
Is this the best solution?


]<?php
$genrefriend = $suggestion->user->getFieldData('GENDER');

if ($genrefriend == 1)
{$genre = JText::_('PLG_FIELDS_GENDER_DISPLAY_MALE');}
elseif ($genrefriend == 2)
{$genre = JText::_('PLG_FIELDS_GENDER_DISPLAY_FEMALE');}
elseif ($genrefriend == 3)
{$genre = JText::_('PLG_FIELDS_GENDER_DISPLAY_OTHER');}
?>
<a href="<?php echo $suggestion->user->getPermalink();?>"><?php echo $suggestion->user->getName(); echo " - "; echo $genre;?></a>


Best regards.

Eric
·
Saturday, 06 May 2017 19:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Perhaps you could try this,

[gist]
<?php
$gender = $suggestion->user->getFieldValue('gender');

echo $gender->text;
?>
[/gist]
·
Saturday, 06 May 2017 23:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
Thank you for your reply.
Yes this is simpler.

But why ->text?
$ Gender->text;

Bests regards.

Eric
·
Sunday, 07 May 2017 00:38
·
0 Likes
·
0 Votes
·
0 Comments
·
You're welcome.

Oh, because we pass in ->text from the standard class.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Sunday, 07 May 2017 12:15
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post