JsnUser Object
You can use our API to interact with the user object, retrieve and store data.
JsnUser extends the class JUser of Joomla, you can use every function of JUser.
Include Classes (Required)
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
Retrieve User Object
$user=JsnHelper::getUser($user_id);
Retrieve current User Object
$user=JsnHelper::getUser();
Retrieve Raw User Field
$user=JsnHelper::getUser(); echo $user->field_alias
or
$user=JsnHelper::getUser(); echo $user->getValue('
field_alias');
Retrieve User Field (without privacy control)
$user=JsnHelper::getUser(); echo $user->getField('
field_alias');
Retrieve User Field (with privacy control)
$user=JsnHelper::getUser(); echo $user->getField('
field_alias',true);
Get Formatted Name (like Easy Profile configuration)
$user=JsnHelper::getUser(); echo $user->getFormatName();
Get a profile Link
$user=JsnHelper::getUser(); echo $user->getLink();
Get a online Status
$user=JsnHelper::getUser(); echo $user->isOnline(); /*return true or false*/
Set Value of User Object
$user=JsnHelper::getUser(); $user->field_alias=value;
or
$user=JsnHelper::getUser(); echo $user->setValue('field_alias','value');
Save User
$user=JsnHelper::getUser(); $user->field_alias=value; $user->save();
Get links of user from Social Connect Plugin$user=JsnHelper::getUser(); $user->getField('socialconnect');