Re: [Toledoh] Website Membership v1.01 Released
Hi Tim,
I've updated your profile.php form. Can you test it out and let me know if works the way you want?
Also, note that the way it's setup, if you save an account through profile.php it will replace the username with the email. This isn't a problem, just surprising if you're not expecting it! :)
Here's my instructions I wrote for the next release of the plugin readme:
HOW TO ADD RADIO FIELDS WITH VALUES LOADED FROM THE CMS
-------------------------------------------------------------------------------
Follow these steps:
- Add a field in the CMS field editor under the User Accounts (For this example
we'll pretend your field is called 'interest')
- Edit your php form (signup.php or profile.php) and copy and paste an error
checking line:
if (!@$_REQUEST['interest']) { $errorsAndAlerts .= "You must select your interest!<br/>\n"; }
- Edit your php form and copy and paste a mysql update line:
interest = '".mysql_escape( $_REQUEST['interest'] )."',
- Edit your form and copy and paste an input field for the user:
<tr>
<td valign="top">Interest</td>
<td>
<?php $fieldname = 'interest'; ?>
<?php $idCounter = 0; ?>
<?php foreach (getListOptions('accounts', $fieldname) as $value => $label): ?>
<?php $id = "$fieldname." . ++$idCounter; ?>
<input type="radio" name="<?php echo $fieldname ?>" id="<?php echo $id ?>"
value="<?php echo htmlspecialchars($value) ?>" <?php checkedIf(@$_REQUEST[$fieldname], $value) ?> />
<label for="<?php echo $id ?>"><?php echo htmlspecialchars($value) ?></label><br/>
<?php endforeach ?>
</td>
</tr>
- Test that the form lets you save each possible value, displays the last saved
value, and that saved values are also displayed correctly in the CMS under:
User Accounts.
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com