Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

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

  • MrFreeKen
  • MrFreeKen
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
14 years 2 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 or Create an account to join the conversation.

14 years 2 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 or Create an account to join the conversation.

13 years 11 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum