2010-10-15, 06:06:16
Thanks for a nice plugin!
I made a small change I wanted to share:
I wrapped the following code in the CREATE ELEMENTS section:
with this check:
This will cause the form to not be displayed again after a comment is successfully emailed, and will just display the message.
To complement, I changed the sent word array to so:
SO it Says "Thanks for your message" rather than "Email Sent"
-Rob A>
I made a small change I wanted to share:
I wrapped the following code in the CREATE ELEMENTS section:
Code:
// display fields
foreach($settings['fields_shown'] as $field) {
if(!in_array('no'.$field, $form_data['parameters']) &&
$type = get_field_type($field)
) {
$form .= add_field($type, $form_data);
}
}
// add tag parameters fields
foreach($form_data['parameters'] as $field) {
if($type = get_field_type($field))
$form .= add_field($type, $form_data);
}
$form .= '
<tr>
<td><input name="contact_id" type="hidden" value="' . $id . '" /></td>
<td><input class="submit" id="contact-submit" name="contact-submit" type="submit" value="' . lang('send') . '" /></td>
</tr>';
with this check:
Code:
if ((empty($form_data['status']['message'])) || (!(empty($form_data['status']['message'])) && ($form_data['status']['sent'] == false))) {
...
}
This will cause the form to not be displayed again after a comment is successfully emailed, and will just display the message.
To complement, I changed the sent word array to so:
Code:
'sent' => array('en' => 'Thanks for your message!', 'fr' => 'Email envoyé.'),
SO it Says "Thanks for your message" rather than "Email Sent"
-Rob A>