1

This question already has an answer here:

I am using Joomla! v3.3.3 and I have just enabled the "User-Profile" component.

How can I access and/or echo the "User-Profile" component data via PHP, such as: address1, city, website, etc?

I know how to access/echo standard user data ex. <?php echo $user->username; ?> but how can I access and echo out the "User-Profile" component's data?

Thanks in advance for the help!

marked as duplicate by jonboy, TryHarder, GDP, Farahmand, Lodder Jan 7 '15 at 19:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

For anyone else with this question, you can find the answer here: How to display user profile information?

As described in the aforementioned post, the short answer is as follows:

To access the User Profile Data

jimport( 'joomla.user.helper' ); 
$user = JFactory::getUser();
$userId = $user->id; 
$userProfile = JUserHelper::getProfile( $userId );

echo "Main Address: " . $userProfile->profile['address1']

Not the answer you're looking for? Browse other questions tagged or ask your own question.