Hello, Guest.

User Object

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


Contents

To 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();


To retrieve current user status

$user = CFactory::getUser($userId);
$status = $user->getStatus();

To retrieve any user avatar uri

$user = CFactory::getUser($userId);
$thumbAvatar = $user->getThumbAvatar();
$largeAvatar = $user->getAvatar();


To retrieve any user-specific information from custom field

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

Docs Navigation

Slashes & Dots Sdn. Bhd.
MALAYSIA OFFICE
No 1-7, Signature Office,
The Boulevard Mid Valley City,
Lingkaran Syed Putra,
59200 Kuala Lumpur, Malaysia.
U.S. OFFICE
251 West Central Avenue #146,
Springboro, Ohio 45066, U.S.A.

Copyright © 2007 - 2010 JomSocial.com. All rights reserved.
JomSocial is made for Joomla!
JomSocial Community Count

1454 users currently online | 112566 forum posts