Hello friends,
Today we learn how we can access the profile plugin data in Joomla. To access the profile data User - Profile plugin should be enabled. Otherwise it will only display current user id.
To access the data you need to write the following code:
jimport('joomla.user.helper');
$userprofile=JUserHelper::getProfile();
First we will import the JUserHelper class. After that, we will call the getProfile() function of the helper class. It will return the profile information of current logged-in user.
To get the profile details of a particular user you need to pass the id of the user as a parameter to the getProfile() function as follows:
jimport('joomla.user.helper');
$userid='value';//value is the userid whose profile information is required
$userprofile=JUserHelper::getProfile($userid);
So using getProfile() function we can find out the profile details of a particular user.
0 Comment(s)