Create profile based on registration

Pam1234 08 Apr, 2008
I love this component (thanks!!). This is probably obvious to everyone but me...

I am not using Community Builder and hope I don't have to. I set up a custom registration form using Chrono and it works perfectly. What I need now is to be able to allow users to see their profile with the new custom fields and edit if needed. I understand the registration plugin but how does the profile plugin work? Do I need to hack the user profile component?

FYI, Here are the parameters I set for the profile plugin:

Table name: jos_chronoforms1
REQUEST parameter name: userid
Target field name: cf_id

I'm not sure if that's correct. Essentially I want the registered user to see all the details from the named table only within his profile. Right now if I use the URL for the default profile they see the bare minimum only.

Thanks for any assistance,
Pam
Max_admin 08 Apr, 2008
Hi Pam,

Whats the HTML code of this form which is configured to use the profile plugin ?

whats the url you use to access it ?

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pam1234 08 Apr, 2008
The URL is here:
(removed)

The code is here (mostly borrowed from an example I found somewhere on this site or perfilador, can't remember which):

<?php global $mosConfig_live_site; echo "<script  type=\"text/javascript\" "
    . "src=\"".$mosConfig_live_site."/includes/js/overlib_mini.js\"></script>"; ?>
	<style type="text/css">
	.titleCell{
	padding-right:3px;text-align:right;	
	}
	</style> 
<table cellpadding="5" cellspacing="0" border="0" width="98%" class="contentpane" id="registrationTable">
    <tr>
      <td colspan="2" width="100%"><div class="componentheading">Visiting Agent Registration</div></td>

    </tr>
		<tr><td> </td><td>Fields marked with an asterisk* are required.</td></tr><tr>
			<td class="titleCell">First Name:</td>
			<td class="fieldCell"><input type="text" size="40" id="firstname" name="firstname" value="" />*</td>
		</tr>
		<tr>
			<td class="titleCell">Last Name:</td>

			<td class="fieldCell"><input type="text" size="40" id="lastname" name="lastname" value="" />*</td>
		</tr>

    <tr>
		<td class="titleCell">Username:</td>
		<td class="fieldCell"><input type="text" id="username" name="username" autocomplete="off" mosReq="0"  size="40" value="" />*<span class='cbFieldIcons'>  <?php echo mosToolTip( "Please enter a valid User Name.  No spaces, more than 2 characters and contain 0-9,a-z,A-Z" ); ?></span></td>

	</tr>

	<tr>
		<td class="titleCell">E-mail:</td>
		<td class="fieldCell"><input type="text" id="email" name="email" size="40" value="" />*<span class='cbFieldIcons'>  <?php echo mosToolTip( "Please enter a valid e-mail address." ); ?></span></td>
	</tr>

	
	<tr>

		<td class="titleCell">Password:</td>
		<td class="fieldCell"><input type="password" id="password" name="password" autocomplete="off" mosReq="0" size="40" value="" />*<span class='cbFieldIcons'>  <?php echo mosToolTip( "Please enter a valid Password.  No spaces, more than 6 characters and contain 0-9,a-z,A-Z" ); ?></span></td>
	</tr>
    <tr>
		<td class="titleCell">Verify Password:</td>
		<td class="fieldCell"><input type="password" id="verifyPass" name="verifyPass" autocomplete="off" mosReq="0" size="40" value="" />*</td>

	</tr>

    		<tr id="cbfr_54">
			<td class="titleCell">Agency Name:</td>			<td class="fieldCell"><input size='40'   maxlength='50'  type="text" name="va_agencyname" value="" />*</td>
		</tr>
		<tr id="cbfr_56">
			<td class="titleCell">Agency Address:</td>			<td class="fieldCell"><input   size='40'   maxlength='50'  type="text" name="va_address" value="" />*</td>
		</tr>
		<tr id="cbfr_560">
			<td class="titleCell">Agency Address 2:</td>			<td class="fieldCell"><input   size='40'   maxlength='50'  type="text" name="va_address2" value="" />
			</td>
		</tr>
		<tr id="cbfr_58">
			<td class="titleCell">Agency City:</td>			<td class="fieldCell"><input   size='40'   maxlength='50'  type="text" name="va_city" value="" />*</td>
		</tr>
		<tr id="cbfr_580">
			<td class="titleCell">Agency State:</td>			<td class="fieldCell"><input   size='10'   maxlength='2'  type="text" name="va_state" value="" />* (example: FL)</td>
		</tr>
		<tr id="cbfr_581">
			<td class="titleCell">Agency Zip:</td>			<td class="fieldCell"><input   size='10'   maxlength='5'  type="text" name="va_zip" value="" />*</td>
		</tr>
		<tr id="cbfr_582">
			<td class="titleCell">Phone number with area code:</td>			<td class="fieldCell"><input   size='10'   maxlength='15'  type="text" name="va_phone" value="" />*</td>
		</tr>
		<tr id="cbfr_583">

			<td class="titleCell" style="vertical-align:top;">What licenses do you currently hold?<br />Check all that apply:</td>
			<td class="fieldCell">
<input type="checkbox" name="Life" value="x" /> Life<br />
<input type="checkbox" name="Health" value="x" /> Health<br />
<input type="checkbox" name="PC" value="x" /> P&C<br />
<input type="checkbox" name="Securities" value="x" />Securities<br />
<input type="checkbox" name="None" value="x" />None<br /></td>
		</tr><tr id="cbfr_584">
			<td class="titleCell">Enter code (to reduce spam):</td>			<td class="fieldCell">*{imageverification}</td>
		</tr>
<tr><td> </td><td class="fieldCell"><input type="submit" value="Send Registration" class="button" />
		<br>
		<br></td></tr>

		</table>


You are welcome to create an account as it's still in testing. (edit: link removed)

Thanks,
Pam<br><br>Post edited by: Pam1234, at: 2008/04/09 19:48
Max_admin 09 Apr, 2008
Hi Pam,

This is the form which iwll be used to save the new data to the database, you will need a complete new form to be used as profile, the new form will have some fields names between {}, so create a new form and add any field name from the form above between two {} and then configure the profile plugin for the NEW form then view the NEW form!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pam1234 09 Apr, 2008
I see. I will give that a try. Thanks for your help!

Pam
Pam1234 10 Apr, 2008
I am still a bit lost.

I created the form, and an example field looks like this:

<input type="text" size="40" id="firstname" name="firstname" value="{firstname}" />


Then in the profile plugin I set it up this way:

Table name: jos_chronoforms1 (the previously created registration form table)
REQUEST paramater name: username (a unique field from the previously created registration table)
Target field name: cf_id

I was unsure whether to create a db table for the profile form since as far as I can tell there is no reason to duplicate the info -- it's all from the registration form and that is the table that needs to be updated each time. I tried it with and without a teable generated. It seems like the "auto generate" section should be updating the registration, not a new table but I don't know exactly what to change.

When this didn't work I based the new profile on jos_chronoforms4 (the new profile table) instead although it doesn't make sense to me because I don't understand how the forms know to communicate with each other if you know what I mean. Regardless it still doesn't work.

I made sure the box for the plugin is checked. Do I need to check anything else such as the registration box?

Anyway once logged in, if I visit the profile link generated by chronoforms, I get a blank form.

If I'm not logged in the form is populated with field names in brackets.

Please help me understand how to make this work. Thanks.

Pam
Max_admin 10 Apr, 2008
Hi Pam,

Say you had the big HTML working before called "main_form", this form has a form_id = 1, so it will be saving data to jos_chronoforms_1 , now, create a new form called "profile", in the HTML box of the new form write :


{username}


now, save the form, check it, click the profile plugin icon, at the table select "jos_chronoforms_1" then REQUEST parameter name, add "dataid", then "cf_id"!

now open this url :
index.php?option=com_chronocontact&chronoformname=profile&dataid=1

this will show the new form wil only the username of the record "1", does this make sense ? please let me know, its alittle tricky, we are preparing a full documentation and video tutorial about the new features!

Best regards,

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pam1234 10 Apr, 2008
Max,

You are being so helpful that I am sending you a shiny red sports car! It's attached! :woohoo: I'm almost there, just need a few more things...

I was able to set up the profile form and it works! Thanks!

The only problem I'm having with it is the checkboxes. Here is my new improved code for the registration (this is working fine):

<td class="titleCell" style="vertical-align:top;">What licenses do you currently hold?<br />Check all that apply:</td>
			<td class="fieldCell">
<input type="checkbox" name="Lic_Life" value="checked" <?php if($_POST['Lic_Life'])echo 'checked'; ?> /> Life<br />
<input type="checkbox" name="Lic_Health" value="checked" <?php if($_POST['Lic_Health'])echo 'checked'; ?> /> Health<br />
<input type="checkbox" name="Lic_PC" value="checked" <?php if($_POST['Lic_PC'])echo 'checked'; ?> /> P&C<br />
<input type="checkbox" name="Lic_Securities" value="checked" <?php if($_POST['Lic_Securities'])echo 'checked'; ?> /> Securities<br />
<input type="checkbox" name="Lic_None" value="checked" <?php if($_POST['Lic_None'])echo 'checked'; ?> /> None<br />
</td>


The problem is, I can't get those checkboxes to appear as checked in the profile. Here are a few ways I've tried:

<input type="checkbox" name="Lic_Life" value="{Lic_Life}" <?php if($_POST ['Lic_Life'] == 'checked') echo 'checked'; ?> /> Life<br />

or

<input type="checkbox" name="Lic_Life" value="{Lic_Life}" <?php if($_POST ['Lic_Life']) echo 'checked'; ?> /> Life<br />


No joy either way. Can you help?

Second, I need to create a dynamic link to the profile in Joomla so that it takes the member directly to their own profile.

Thanks again,
Pam

Create profile based on registration image 1
Max_admin 11 Apr, 2008
Hi Pam,

Thanks for the carπŸ™‚

your 2nd question, dont add the userid parameter at the end of the URL and it will show the logged in user profile automatically!

your first question, this will need this piece of code :
<?php if($_POST ['Lic_Life']) echo 'checked'; ?>

But it will need you to write SQL query to get the DB values, like :

$database->setQuery('SELECT * FROM jos_chronoforms_1 WHERE userid = "44"');
$rows = $database->loadObjectList();


and replace the $_POST with something like :
$rows[0]->radio_name;

Let mek now how it goes!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pam1234 21 Apr, 2008
Hi Max,

Sorry for the long delay in responding!

your 2nd question, dont add the userid parameter at the end of the URL and it will show the logged in user profile automatically!



Unfortunately this is not working for me. I still get a blank profile even if I'm logged in. I've tried these 2 ways (using my foform's name of course):

index.php?option=com_chronocontact&chronoformname=profile

index.php?option=com_chronocontact&chronoformname=profile&dataid=

No joy, just a blank form.😟

your first question, this will need this piece of code :

<?php if($_POST ['Lic_Life']) echo 'checked'; ?>

But it will need you to write SQL query to get the DB values, like :



That part confuses me because the SQL query you wrote calls for a specific userid but of course I'll need for the info to be specific to each person's profile. Also I'm not sure where the query code goes. (Haven't tried it yet.)

Thanks for all of your help. If you keep up all this great support I will have to send a YELLOW sports car to add to your collection!

Pam
GreyHead 21 Apr, 2008
Hi Pam,

Max is away for a few days and I'm up to my eyebrows. One of us will get back to you as soon as we can.

Bob
This topic is locked and no more replies can be posted.