Difference between revisions of "JomSocial User Object"

(Created page with "__FORCETOC__ Each user within JomSocial is represented by a special object called CUser. CUser inherit all JUser object properties and added a couple new functionality. ===Re...")
(No difference)

Revision as of 15:56, 17 January 2013

Each user within JomSocial is represented by a special object called CUser. CUser inherit all JUser object properties and added a couple new functionality.

Retrieve User Object

// Return user with the given id
$user =& CFactory::getUser($userId);
 
// Return current logged-in user. If no one is logged-in, it will
// return a visitor object
$user =& CFactory::getUser();


Retrieve any user-specific information from custom field

$user =& CFactory::getUser($userId);
$data = $user->getInfo('FIELD_CODE');