×

Error

Please login first

[SOLVED] How to access CB user data from other component ?

12 years 1 month ago - 12 years 1 month ago #197203 by mtaras
Hi,
I use CB as user manager for my site.

Now I need to have access to user data from some other components that I have develop or customized.

What I need to include to my component to have access to cb user data ?

To have access to joomla user manager I have to include the below code
<?php 
/**  framework joomla check login user */
define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 );
define('JPATH_BASE', dirname(__FILE__));
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

/* Create the Application */
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();

/* End joomla user framework */
?>

Then I can user commands like "JFactory::getUser()->id" to get data from user.

Is there any method to access CB data from my component?

Thanks.

Please Log in to join the conversation.

12 years 1 month ago #197207 by mtaras

Please Log in to join the conversation.

12 years 1 month ago #197237 by krileon
Please see tutorials within my signature where I've explained how to access CB API externally, how to prepare a user object, register a user object, obtain field values, etc..


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: mtaras

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.166 seconds

Facebook Twitter LinkedIn