Skip to Content Skip to Menu

Load CBuser object and Include API externally

  • nour2imen
  • nour2imen
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
11 years 8 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