Hello everyone,
First off -- Chronoforms is an absolutely fantastic product. I'm grateful someone took the time to produce and share this functional software.
I have a question, regarding how to access multiple tables and draw data from them at once.
I'll layout how the process works:
1)User visits website (<!-- w --><a class="postlink" href="http://www.censorednation.com">www.censorednation.com</a><!-- w -->) and registers through community builder. Community builder is setup with additional fields such as -- such as "mailing address, city, state, zip etc.)
2) Upon registration they are taken to a new screen which allows them to fill out a Chronoforms form
3)This form pulls the {username}, {name}, and {email} field in a hidden fashion -- the values of these fields are SENT OUT via email
In order to make step 3 work, I enabled the profile page plugin, then I selected "jos_users" > "ID"
Now I'd also like to pull data from the COMMUNITY BUILDER fields. Such as "jos_comprofiler" > "ID"
The community builder fields are the ones that contain the address and the like. Is there anyway to allow data to be pulled from BOTH of these tables?
I'm relatively new at this...so I appreciate any advice you can give me.
If I have been unclear in anyway, just let me know🙂
Thanks again for the help.
First off -- Chronoforms is an absolutely fantastic product. I'm grateful someone took the time to produce and share this functional software.
I have a question, regarding how to access multiple tables and draw data from them at once.
I'll layout how the process works:
1)User visits website (<!-- w --><a class="postlink" href="http://www.censorednation.com">www.censorednation.com</a><!-- w -->) and registers through community builder. Community builder is setup with additional fields such as -- such as "mailing address, city, state, zip etc.)
2) Upon registration they are taken to a new screen which allows them to fill out a Chronoforms form
3)This form pulls the {username}, {name}, and {email} field in a hidden fashion -- the values of these fields are SENT OUT via email
In order to make step 3 work, I enabled the profile page plugin, then I selected "jos_users" > "ID"
Now I'd also like to pull data from the COMMUNITY BUILDER fields. Such as "jos_comprofiler" > "ID"
The community builder fields are the ones that contain the address and the like. Is there anyway to allow data to be pulled from BOTH of these tables?
I'm relatively new at this...so I appreciate any advice you can give me.
If I have been unclear in anyway, just let me know🙂
Thanks again for the help.
Hi dbirchmier,
Most of the jos_user info is available from the 'user' object, you can access these directly in your form code and then use the profiler plugin for the Community Builder table.
Bob
Later: changed to use JFactory instead of $user =& JUser::getInstance();
Most of the jos_user info is available from the 'user' object, you can access these directly in your form code and then use the profiler plugin for the Community Builder table.
<?php
$user =& JFactory::getUser();
?>
<p>Welcome <php? echo $user->name; ?></p>
<p>Your email is <php? echo $user->email; ?></p>
Bob
Later: changed to use JFactory instead of $user =& JUser::getInstance();
Dear Bob,
Thanks so much for the prompt response!
By using:
Could I then call the "$user" variable in the email template section. I need to echo it when the email is sent. Will this work?
Thanks again!
Thanks so much for the prompt response!
By using:
<?php
$user =& JUser::getInstance();
?>
Could I then call the "$user" variable in the email template section. I need to echo it when the email is sent. Will this work?
Thanks again!
Yes!
Hi dbirchmier,
As Max says it will work there (or anywhere else).
You may find it simpler to use hidden fields to set the user values in the form html.
You can then access them in the template using the CF {field_name} syntax.
Bob
As Max says it will work there (or anywhere else).
You may find it simpler to use hidden fields to set the user values in the form html.
<input type="hidden" name="email" value="<?php echo $user->email; ?>" ?>
You can then access them in the template using the CF {field_name} syntax.
Bob
Wow.
You guys are beyond great. Thanks so much!
I'll try this tonight. Sounds like the perfect solution.
Where's the donate button?
You guys are beyond great. Thanks so much!
I'll try this tonight. Sounds like the perfect solution.
Where's the donate button?
Hi dbirchmier, Thank you, we don't have a donate button, you can support us in 2 ways, you can get a license from the link at the top of all pages, you can also vote/review Chronoforms at the Joomla site from the link in my signature because this helps us go up in listings.
Regards
Max
Regards
Max
Okay! I've rated the product.
Thanks again guys!
Thanks again guys!
Hey guys,
I've added the following code to the top of my "Form HTML:
(may contain PHP code with tags)" section:
However when viewing the form, I don't see my name/email echoed. (I've checked to assure I'm logged in)
Any ideas?
I've added the following code to the top of my "Form HTML:
(may contain PHP code with tags)" section:
<?php
$user =& JUser::getInstance();
?>
<p>Welcome <php? echo $user->name; ?></p>
<p>Your email is <php? echo $user->email; ?></p>
However when viewing the form, I don't see my name/email echoed. (I've checked to assure I'm logged in)
Any ideas?
Thanks! try to use :
instead of :
Regards
Max
$user = JFactory::getUser();
instead of :
$user =& JUser::getInstance();
Regards
Max
Hi dbirchmier,
Are you logged in to the Front-end when you check this?
If there is no user logged in then $user will be empty, as Joomla has no way of knowing who is there.
Logging in the back end as administrator is not enough, you must log in the front-end as well.
ob
Are you logged in to the Front-end when you check this?
If there is no user logged in then $user will be empty, as Joomla has no way of knowing who is there.
Logging in the back end as administrator is not enough, you must log in the front-end as well.
ob
hey there,
I am logged in through the front end, and I tried including this code at the top of my form to test:
However the form outputs:
I am definitely logged in to the front end, and the name variable is set for the user. Any other ideas?
I am logged in through the front end, and I tried including this code at the top of my form to test:
<?php
$user = JFactory::getUser();
?>
<p>Welcome <php? echo $user->name; ?></p>
<p>Your email is <php? echo $user->email; ?></p>
However the form outputs:
Welcome name; ?>
Your email is email; ?>
I am definitely logged in to the front end, and the name variable is set for the user. Any other ideas?
Hi, catch typo, this :
should be
cheers
Max
<php?
should be
<?php
cheers
Max
This topic is locked and no more replies can be posted.