Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

Load CBuser object and Include API externally

  • nour2imen
  • nour2imen
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
11 years 9 months ago #220430 by nour2imen
Hello,

I want to create a file in the root of the joomla website to be a webservice that receive a user id and returns the data of the user, but since I am using the registration of Community builder and I have added some fields I want to load the cbuser object instead of the juser object I started with Including API externally but I always get the error
Fatal error: Call to a member function getCfg() on a non-object

here is my code :
Code:
<?php global $_CB_framework, $mainframe; if ( defined( 'JPATH_ADMINISTRATOR' ) ) { if ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) { echo 'CB not installed!'; return; } include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ); } else { if ( ! file_exists( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' ) ) { echo 'CB not installed!'; return; } include_once( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' ); } ?>

please help me

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum