Actions

API16

JUserHelper/getProfile

From Joomla! Documentation

< API16:JUserHelper
Revision as of 17:36, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Gets the user profile information

[Edit Descripton]

Description:JUserHelper/getProfile

Syntax

getProfile($userId=0)
Parameter Name Default Value Description
$userId 0

Defined in

libraries/joomla/user/helper.php

Importing

jimport( 'joomla.user.helper' );

Source Body

function getProfile($userId = 0)
{
        if ($userId == 0) {
                $user   = & JFactory::getUser();
                $userId = $user->id;
        }
        else {
                $user   = & JFactory::getUser((int) $userId);
        }
 
        // Get the dispatcher and load the users plugins.
        $dispatcher     = &JDispatcher::getInstance();
        JPluginHelper::importPlugin('users');
 
        $data = new JObject;
 
        // Trigger the data preparation event.
        $results = $dispatcher->trigger('onPrepareUserProfileData', array($userId, &$data));
 
        return $data;
}

[Edit See Also] SeeAlso:JUserHelper/getProfile

Examples

<CodeExamplesForm />