Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
p01-contact : simply add contact forms in your pages
#28
Thanks for a nice plugin!

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>
Reply


Messages In This Thread
askcopy syntax Not Working - by celextel - 2019-05-24, 01:54:40
RE: askcopy syntax Not Working - by celextel - 2019-05-28, 01:51:47
p01-contact : simply add contact forms in your pages - by RobA - 2010-10-15, 06:06:16



Users browsing this thread: 3 Guest(s)