I have searched the forum and have read many, many posts regarding this issue. But I have not yet found a post that stays on track with this topic or one that has the complete solution. Many posts jump around between posters or are incomplete. If there is a COMPLETE A to Z on what I am trying to accomplish please post it here. It would be great if there was a tutorial or a backup form.
What I am trying to do:
Users register and login using CB 1.2. If the user requests information by snail mail, they click on a link to the form. I would like chronoforms to pull information from their profile and populate form fields based on data in the user profile. I don't need to write data back to the user profile.
I have tried many things, but I am lost.
Thanks,
Wes
Hi Wes,
There is no tutorial to do this, and neither Max or I are frequent users of CB.
The trickiest bit is going to be finding where CB stores the data, once you know that you can write MySQL query to read it and set the values in the Form HTML.
Bob
Hi Wes,
As bob said, if you can find the CB table name which has the users data then you can use the Chronoforms "profile plugin" to load the data at your form, this plugin can load the data from ANY table in the database!
Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Bob & Max,
The CB table name that holds the data I need is called jos_comprofiler.
jos_comprofiler fields (that I need):
id
user_id
firstname
middlename
lastname
company
address
city
state
zipcode
country
phone
Please let me know what the next step is.
Thanks
Thank you Cheryl. I remember seeing one of your posts before regarding the CB connection. I was making some simple mistakes before regarding which plugin to use. I will add a post to contain a full step by step on how to do this, but have a few more questions first.
1 > CB doesn't include the email field in the jos_comprofiler table, it is in user jos_users (at least for me). How do I access the email field in jos_users? What are you doing different? I copied the code from your sample for email, but it is doesn't populate. I am guessing this is because it's in a different table. The fields in jos_comprofiler work fine.
2 > Did you find a way to clear field values if the user was not logged in? In a perfect world, a non-registered user would see a blank form without {firstname} {lastname} in the field values.
Thanks.
Hi dtcinc,
easy answer is the "profile" plugin for Chronoforms, please search the forums for how to use it with many examples!
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
I think he means how to get it not to show the field values {fieldname} in the fields where people are not logged in/registered.
Cheryl
Hi dtcinc,
Out of curiosity what does a guest see if you just use value='{firstname}' ?
Bob
{firstname} as the field value
Hi dtcinc,
Thanks, when I have a moment I'll see if I can find a quick fix.
Bob
So with dtcinc's version, you have to put the code in for every field value, not just once at the top or something, right?
Cheryl
right, you need the php code at the top to get check for a user, and the other small php code in each value to echo the user values if they exist. If it's not a user, the field value will be blank.
Let's see what Bob comes up with, might be easier to manage.
aha, I will add an updated version of the profile plugin soon which will fix this issue!
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Awesome Max, that will be great!! It's kind of annoying seeing the fieldnames in there, although it's great to be able to get them at all!! Other components who shall remain nameless...ahem<coughcough>, do not have such a plugin and it is INFINITELY useful.
Thank you!!
Cheryl😀