Forums

Adding more User details or Contact fields

phlampe 19 Jan, 2010
Hello All !

I'm new to Joomla and it's world of modules and extensions. Sort of a bit lost in it, so that's why I need some help.

I've setup a site for our non-profit organization, and will have to load in it about 3000 members. I have a file with First and Last name, email, and company.

I tried User Loader, and it seems to work ok for my needs. But I realized with my tests that Joomla didn't have a field to store a company name for each user. So I poked around a bit, and understand (hopefully) that there could be 3 ways to do that:
1. either change the core user component to add that field to the registration screen, but that's not a good idea for me
2. find an extension that would allow me to personnalize the registration process (and add that single field),
3. or find an extension that would change the contact form accordingly

Idea 1 is out: I don't feel like messing with core components...
Idea 2: are there any extensions for that ? It would be the simplest way to do it: Chrono Form ?
Idea 3: what would you recommend for this one ? Either a contact extension (like QContact) or a forms builder (like Chrono Forms...)? And is there an automatic contact creation utility that would trigger when a user is added ?

So here I am to check that my 2nd or 3rd idea are the good ones: how easy is it just to add the company name to the standard user registration form of Joomla (or more precisely replace it with a ChronoForm form that would mimick it with an extra field) ?

Or would it be easier or safer to replace in the same way the standard contact form ?

Thanks for your help,
Paul-Henri
the_fitz 09 Mar, 2010
I too am having the same question.....

I am new with this extension, and have pained over it for a long time... More than 16 hours, just trying to extend the joomla registration form. I have spent many of those hours going through this forum to get some answers, but even as I have gotten "parts" of answers I have tried everything I saw, and am no further along.
GOAL:
To have a new account form with more fields.
all I want is to be able to save the default form information into the standard jos_users table and the extra information into jos_uesers_extra. Of course, they will have to each have the same data in the "ID" field so I can join the tables later to get comprehensive profile of each member.
WHAT WORKS:
I have followed the tutorial and have replaced the default "new account" form with a replica chronoforms form called registrations.
It works.
WHAT I HAVE TRIED:
I added a new database and If I launch the form directly it will save data.
WHAT DOES NOT WORK:
I tried using the redirect to bring me to the new form and I see it, but I am showing the ID and NAME fields to see if they populate from the original forms data using:

   <?php
    global $row_chronocontact_registrations;
    $cf_id = $row_chronocontact_registrations->cf_id;
    $cf_name = $row_chronocontact_registrations->cf_name;
    $db =& JFactory::getDBO();
    $query = "
        UPDATE `jos_users_extra`
            SET `ex_user_id` = "$cf_id",'ex_full_name' = "$cf_name"             
            WHERE `cf_id` = $cf_id;";
    $db->setQuery($query);
    $db->query();
    ?> 


Which doesn't seem to work.
With debug "on" I get...........

Parse error: syntax error, unexpected T_VARIABLE in /home5/posloyal/public_html/merchant-net/components/com_chronocontact/libraries/customcode.php(64) : eval()'d code on line 9

1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [text_3] => bbbbbbbbbb [text_4] => bbbbbbbbb [text_5] => [email]bbbbbbbbb@aol.com[/email] [text_9] => 20bbb [text_8] => 20bbb [chrono_verification] => axf2r [button_12] => Go to Step 2 [9be8a784f3717a34d9d13dfdd9c9f87a] => 1 [1cf1] => f89466aae154b27c8a4fd94f0ca73a73 [chronoformname] => registration )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
8. Debug End
9.
Redirect link set, click to test:



I guess I have 2 questions??? 1. Is this the right approach? 2. What am I doing wrong?

Please just point me in the right direction.
Thanks in advance
GreyHead 10 Mar, 2010
Hi the_fitz,

The error message is because the query is misquoted - there are several errors on the SET line
    $query = "
        UPDATE `jos_users_extra`
            SET `ex_user_id` = $cf_id, `ex_full_name` = '$cf_name'            
            WHERE `cf_id` = $cf_id; ";


If you use the Joomla Registration plugin that should take care of saving the data to jos_users; a DB Connection on the form should save anything else that you need to the new table. I think that would include the user_id. If that works you don't need this query.

Boib
the_fitz 10 Mar, 2010
If I gleen correctly from what you stated... I should be able to do this with 1 form and 2 db's not 2 forms. But when is the user Id generated? And will it be available before saving the record in the second table?

Item 2
I see you posted

SET `ex_user_id` = $cf_id, `ex_full_name` = '$cf_name'

I do php programming and I don't think that a single quoted variable will expand. I believe only double quoted variables expand.
Please confirm

Thanks in advance for your quick response.
The_fitz
the_fitz 10 Mar, 2010
Woah, I just reread your post... Did you mean that I can connect 1 form to 2 databases in the management interface?

Thanks again
the_fitz
GreyHead 10 Mar, 2010
Hi the_fitz,

Yes. There are two different things here though.

a) The registration plugins use the Joomla code to 'do' the registrations so they will create the jos_user table entries independently of any DB Connection in the form.

b) The DB Connection drop-down is a 'multi-select'. You can select one or two or more tables in there and the data will be saved to those tables. The data that is saved depends on there being input names that match column names in the table.

Bob
rgfuller 18 Mar, 2010
Can the CB registration plugin be used to update only a subset of the registration fields for a user who already has an existing profile? My tests so far suggest not, but maybe I've made a mistake.

I want to create a CF which can insert address fields into existing user profiles, while storing the other fields from the form in the connected table.

to test, I followed the steps in the PDF tutorial for the Joomla registration plugin (assuming the same steps for CB, and omitting the pw validation stuff) but only used one field (Address)on the General tab. No luck.

This thread indicates that what I am trying to do might work, but only if the plugin can accept incomplete data. Please let me know if this is possible.

Thanks very much..
GreyHead 19 Mar, 2010
Hi rgfuller,

The CB Registration plugin includes the Joomla and CB Registration processes so it should *only* be used to register new members.

To update existing records you'll need a form linked to the corresponding CB tables. Unfortunately because of the way that the CB tables are structured* neither the Profile plugin, nor (I think) the standard DB Connection will do the trick so the code has to be handwritten. You'll find much of it in the CB plugin though.

Bob

* For CB you look up the fields in one table and use those settings to write the values to another.
phlampe 19 Apr, 2010
Hello All !

Thanks for your answers to my original questions, they helped me understand what to do and how to do it.

To answer myself 😀 , I finally opted for the 2nd solution: replacing the registration form with ChronoForm and adding several user details fields and using the reCaptcha plugin. It also enabled me to manage at the same time optional user subscriptions to newsletters, with the AcyMailing extension (which integrates well with ChronoForm). I didn't use Community Builder even if I tried, because of an incompatibility with my version of php (I have version 4 installed, not 5 as recommended by CB, and can't upgrade).

Cheers,
Paul-Henri
This topic is locked and no more replies can be posted.