By Fagault Eric on Saturday, 05 August 2017
Posted in General
Replies 5
Likes 0
Views 256
Votes 0
Hello,
I need to retrieve the id of the member when clicking on his profile (For example in the list of members)
Or retrieve the id of the displayed member when visiting his profile.

Where can I retrieve this information?

Best regards.

Eric
Hello Eric,

I am really sorry for the delay of this reply as it is a weekend for us here. If you need to generate the ID, you could just echo the ID like this,

[gist]
<?php echo $user->id;?>
[/gist]
·
Saturday, 05 August 2017 23:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
Thank you very much.

I understand that it is the weekend, do not worry, I will consult the answers at the beginning of the week.

Exactly, I'm looking for how to retrieve the id of the user.
For example, I'm looking at a user's profile, what I'm trying to do is retrieve that user's ID.

This is done when you click on the name of a user to view the details of his profile.

Best regards.
Eric
·
Sunday, 06 August 2017 00:41
·
0 Likes
·
0 Votes
·
0 Comments
·
If you would like to get the user id when you access one of the member profile page, you can try use following code :


$app = JFactory::getApplication();

// Get the user's id.
$id = $app->input->get('id', 0, 'int');
$userObj = ES::user($id);

·
Sunday, 06 August 2017 11:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you very much
·
Tuesday, 08 August 2017 14:31
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Tuesday, 08 August 2017 14:39
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post