By Rachel Jollie on Tuesday, 16 August 2016
Posted in General
Likes 0
Views 359
Votes 0
I see how to get the information of the user that is logged in. However, if you visit a friend's profile page, how do you get their user id?

I'd like to make a custom mod that will take both the logged in user id and the user of the page you are viewing. Thank you!
Hi Rachel Jollie,

Can you try follow the code below and see how it goes?
$id = JRequest::getInt( 'id' , null );
$my = ES::user($id);
echo $my->id;
·
Tuesday, 16 August 2016 12:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks! It looks like this works well on the user's profile page. When I tried this when viewing a user's video page, the id was NULL.

Is the video page only assigned to the user that's signed in?
Thanks for the advice
·
Wednesday, 17 August 2016 11:35
·
0 Likes
·
0 Votes
·
0 Comments
·
can you try using this
$id = JRequest::getInt( 'uid' , null );
$my = ES::user($uid);
echo $my->id;

and see how it goes?
·
Wednesday, 17 August 2016 12:27
·
0 Likes
·
0 Votes
·
0 Comments
·
That worked out great, thank you!
·
Friday, 19 August 2016 13:18
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome. Glad to hear that your issue has been resolved now.

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.
·
Friday, 19 August 2016 15:14
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post