| 
Welcome, Guest

[SOLVED] Includes for API use in external plugin
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: [SOLVED] Includes for API use in external plugin

[SOLVED] Includes for API use in external plugin 1 year, 9 months ago #140716

  • gjeff
  • gjeff
  • OFFLINE
  • Fresh Boarder
    Fresh Boarder
  • Posts: 2
  • Karma: -
Hello,

I'm trying to use the API getUserData in an external plugin (mean non CB plugin...)

I had several missing class so I had to modify the included files as following:
global $_CB_framework, $mainframe;
if ( defined( 'JPATH_ADMINISTRATOR' ) ) {
if ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.class.php' ) ) {
echo 'CB not installed!';
return;
}
 
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.class.php' );
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/comprofiler.class.php' );
} else {
if ( ! file_exists( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.class.php' ) ) {
echo 'CB not installed!';
return;
}
 
include_once( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.class.php' );
include_once( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/comprofiler.class.php' );
}

instead of plugin.fondation.php as stated in tutorials.

Now my plugin is working very well.
Is it a good tip or just a hazardous solution ?

Post edited by: krileon, at: 2010/08/27 15:29
The topic has been locked.

Re:Includes for API use in external plugin 1 year, 9 months ago #140766

  • krileon
  • krileon
  • ONLINE
  • Moderator
    Moderator
  • Posts: 24015
  • Karma: 695
Please do as instructed within the tutorial then used cbimport( 'cb.html' ); after the inclusion to load the remainder of CBs API. Your current usage is incorrect, but should work (not advised).
Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Advanced, Professional, Developer, or CBSubs 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 Advanced, 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 EST to 4:00 PM EST. 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.
--
My personal site(s)/link(s): AllMySocials - Tutorials
The topic has been locked.

Re:Includes for API use in external plugin 1 year, 9 months ago #140802

  • gjeff
  • gjeff
  • OFFLINE
  • Fresh Boarder
    Fresh Boarder
  • Posts: 2
  • Karma: -
OK
cbimport( 'cb.html' );
right after the Include works great

Thanks a lot

Post edited by: gjeff, at: 2010/08/27 10:44
The topic has been locked.
  • Page:
  • 1
Time to create page: 0.88 seconds