How do you add user's address to atricle/module

13 years 6 months ago #143414 by MrFreeKen
I am able to use this code along with Jumi to pull up a user's username, name, & id:

[code:1]$user =& JFactory::getUser();

if (!$user->guest) {
echo 'You are logged in as:<br />';
echo 'User name: ' . $user->username . '<br />';
echo 'Real name: ' . $user->name . '<br />';
echo 'User ID : ' . $user->id . '<br />';[/code:1]

How can I pull up other user information a user has submitted through Community Builder?

I need to be able to pull up fields like cb_address, cb_city, cb_state, cb_zipcode, and cb_phone. All these fields are under jos_comprofiler in the database.

Please Log in to join the conversation.

13 years 6 months ago #143783 by cloudalacarte
Replied by cloudalacarte on topic Re:How do you add user's address to atricle/module
I have a similar question. I am interested in finding out if you have have found a solution ...

Cloud a la Carte - www.cloudalacarte.com
Web consulting and integrated online solutions

Please Log in to join the conversation.

13 years 3 months ago #150389 by cloudalacarte
Replied by cloudalacarte on topic Re:How do you add user's address to atricle/module
Here is the solution I used to retrieve community builder profile information:

[code:1]<?php
//Get CB info for logged in user
$user =& JFactory::getUser();
$db =& JFactory::getDBO();
$query = "SELECT * FROM `jos_comprofiler` WHERE `id` = ".$user->id."; ";
$db->setQuery($query);
$user_info = $db->loadObject();

// Retrieve CB prfile field cb_xyz
$xyz = $user_info->cb_xyz;
?>
[/code:1]

I hope this helps.

Cloud a la Carte - www.cloudalacarte.com
Web consulting and integrated online solutions

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.220 seconds

Facebook Twitter LinkedIn