Hi All, I had a ticket with the helpdesk to advise on positioning custom data fields in the "profile.html" form. Alex and his team were of great help and helped solve the problem I was having. This is what I did. 1.a. Use the control panel to add custom fields. 1.b. Visibility of field, make "Don't display" in Signup or Profile. 2.a Open "profile.php" found in the aMember directory. 2.b. find the line $maf = array(); foreach ($member_additional_fields as $f){ $maf[$f['name']] = $f; // Set empty values for all fields that were not submited. // Need to do this to get validation functions working for radio buttons. if(!$vars[$f[name]]) $vars[$f[name]] = ''; } 2.c. Edit the code in the following way. If you are adding more than one custom field. After "$maf = array();" Add your custom fields useing the format below: $addfields = array('company_name', 'telephone_no', 'mobile_no'); foreach ($member_additional_fields as $f){ if (in_array($f['name'], $addfields)) $f['display_profile'] = 1; $maf[$f['name']] = $f; // Set empty values for all fields that were not submited. // Need to do this to get validation functions working for radio buttons. if(!$vars[$f[name]]) $vars[$f[name]] = ''; } 2.d. Save the script and close. 3.a. Open the "profile.html" file found in the amember/templates directory. 3.b. Position your custom fields where you want them to be. 3.c. Make sure they follow the format below: <tr> <td>Telephone No: </td> <td><input type="text" name="telephone_no" value="{$user.telephone_no|escape}" size="30" /></td> </tr> 3.d. When you have complete placing your custom fields, save the "profile.html". 4.a. Upload "profile.php to the amember directory 4.b. Upload "profile.html" to the amember/templates directory. I hope that this helps other member of this forum. Dereck
Hallo! Something like this would be also needed for my work and really big thanks to Alex and yourself for working this little but useful piece of code. However, my request is to centralise the code in both the places i.e. admin/user.php and profile.php if possible.
This works well in profile.html/profile.php. However, I am not able to get this to work in the signup form. I get the fields added no problem, but the data is not added to the member's record. Any suggestions?
Hi, Did you assign the respective template variables like $t-> that may capture the form input and add them into the array? If not, how will the template array know that there is one more creation mapped?
I am still using the trial version, is this the reason the code in "profile.php" is encoded and therefore I am not seeing the information you are describing?
I have a question regarding this aswell. I want to be able to provide a paying subscriber more fields in there profile can this same process be used as described above if a free member then show fields 1 2 3 if paying fields 1 2 3 4 5 6 or even show a totally different set of fields a b c d e if i am not clear i can explain better thanks Jay
In signup.html we use {if $smarty.request.price_group == 1} or {if in_array($smarty.request.price_group, array(3,5,6))} to customize the signup form for price groups What's the code difference to do the same thing in profile.html (not $smarty.request.price_group == 1, I've tested it) and take full advantage of your add fields modification?