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