Adding a user to users table and community builder

Status
Not open for further replies.

jbadiag

Member
Hi, I've created a form where I can create users to my joomla database using fabrik's user plugin.
I need to insert some data in my Community builder customized fields (like telephone, etc) at the same time that I create a user.
I've tried to join my temporal table where to create users, with comprofiler table and create a user in 2 steps:
1 step: I create the user in users J! database
2 step: I edit data in the created user in CB
but data in CB does not save.
How can I do it?

Thanks
 
Hi again, I've solved this issue.
just with the php plugin, in form, creating a php file (onAfterProcess), like this:
Code:
<?php
//get a database object
$db = JFactory::getDbo();
 
$userid = JRequest::getInt('fbk_altausuaris___id');
$tel = JRequest::getVar('fbk_altausuaris___telefon');
$mun = JRequest::getVar('fbk_altausuaris___poble_lbl');
$com = JRequest::getVar('fbk_altausuaris___comarca_lbl');
$sub = JRequest::getVar('fbk_altausuaris___subregio_lbl');
$reg = JRequest::getVar('fbk_altausuaris___regio_lbl');
$nom = JRequest::getVar('fbk_altausuaris___nom');
$cog = JRequest::getVar('fbk_altausuaris___cognoms');
 
// Create and populate an object.
$profile = new stdClass();
$profile->user_id = $userid;
$profile->id = $userid;
$profile->cb_telefon = $tel;
$profile->cb_municipi = $mun;
$profile->cb_comarca = $com;
$profile->cb_regiusuari = $reg;
$profile->cb_subregio = $sub;
$profile->firstname = $nom;
$profile->lastname = $cog;
 
// Insert the object into the user profile table.
$result = JFactory::getDbo()->insertObject('#__comprofiler', $profile);
 
?>
Hope to help to anyone.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top