I just got a super easy way of creating a user in CB, if you have the AutoAction CB plugin.
Instead of doing a lot of PHP coding, and including all sorts of stuff from CB, just ask CB to register the user for you, this is the way to do it, and it will work even if the framework in CB is changed.
1) Add a Custom Code module in your chronoforms, add this code:
2) Create a Custom Trigger in CB, in auto actions, create a new auto action, and under Triggers you enter what you like, with this code example it's OnChronoUser and press Enter, this will create a new trigger
3) Set the Type of Auto Action to Registratin
4) Set access to Everybody
[attachment=0]global.png[/attachment]
5) In the Action Tab, fill in the form field names so they fit the user registration, if you have more fields than the standard set, they can be added as well
[attachment=1]action1.png[/attachment]
[attachment=2]action2.png[/attachment]
That's it, all the fields you want to register is just a question of entering their form names.
Instead of doing a lot of PHP coding, and including all sorts of stuff from CB, just ask CB to register the user for you, this is the way to do it, and it will work even if the framework in CB is changed.
1) Add a Custom Code module in your chronoforms, add this code:
<?php
global $_PLUGINS;
if ( ( ! file_exists( JPATH_SITE . '/libraries/CBLib/CBLib/Core/CBLib.php' ) ) || ( ! 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' );
cbimport( 'cb.html' );
$_PLUGINS->loadPluginGroup( 'user' );
$_PLUGINS->trigger( 'OnChronoUser', array( $form->data ) );
?>
2) Create a Custom Trigger in CB, in auto actions, create a new auto action, and under Triggers you enter what you like, with this code example it's OnChronoUser and press Enter, this will create a new trigger
3) Set the Type of Auto Action to Registratin
4) Set access to Everybody
[attachment=0]global.png[/attachment]
5) In the Action Tab, fill in the form field names so they fit the user registration, if you have more fields than the standard set, they can be added as well
[attachment=1]action1.png[/attachment]
[attachment=2]action2.png[/attachment]
That's it, all the fields you want to register is just a question of entering their form names.
Hi fribse,
Looks useful thank you.
In case you had missed it there is an Enable CB Support option in the ChronoForms Joomla! Registration action that will add a new user to the CB Tables. That probably has less flexibility than your method though.
Bob
Looks useful thank you.
In case you had missed it there is an Enable CB Support option in the ChronoForms Joomla! Registration action that will add a new user to the CB Tables. That probably has less flexibility than your method though.
Bob
This topic is locked and no more replies can be posted.