Custom Contact Forms - Version 3.5.3

Version Description

  • custom-contact-forms.php - Style popover height option added to style manager. Form title heading not shown if left blank.
  • custom-contact-forms-db.php - New success popover height column added to styles table
Download this release

Release Info

Developer tlovett1
Plugin Icon 128x128 Custom Contact Forms
Version 3.5.3
Comparing to
See all releases

Code changes from version 3.5.2 to 3.5.3

custom-contact-forms-db.php CHANGED
@@ -103,6 +103,7 @@ if (!class_exists('CustomContactFormsDB')) {
103
 
104
  function updateTables() {
105
  global $wpdb;
 
106
  if (!$this->columnExists('user_field', $this->fields_table))
107
  $wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `user_field` INT( 1 ) NOT NULL DEFAULT '1'");
108
  if (!$this->columnExists('form_style', $this->forms_table))
@@ -137,6 +138,8 @@ if (!class_exists('CustomContactFormsDB')) {
137
  $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '12px'");
138
  if (!$this->columnExists('success_popover_title_fontsize', $this->styles_table))
139
  $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_title_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '1.3em'");
 
 
140
  if (!$this->columnExists('success_popover_fontcolor', $this->styles_table))
141
  $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333'");
142
  if (!$this->columnExists('success_popover_title_fontcolor', $this->styles_table))
@@ -147,6 +150,8 @@ if (!class_exists('CustomContactFormsDB')) {
147
  $wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_options` VARCHAR( 300 ) NOT NULL");
148
  if (!$this->columnExists('field_required', $this->fields_table))
149
  $wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_required` INT( 1 ) NOT NULL DEFAULT '0'");
 
 
150
  }
151
 
152
  function insertFixedFields() {
@@ -200,6 +205,7 @@ if (!class_exists('CustomContactFormsDB')) {
200
 
201
  function insertStyle($style) {
202
  global $wpdb;
 
203
  if (empty($style) or empty($style[style_slug]) or $this->styleSlugExists($this->formatSlug($style[style_slug]))) return false;
204
  $style[style_slug] = $this->formatSlug($style[style_slug]);
205
  foreach ($style as $key => $value) {
@@ -207,6 +213,7 @@ if (!class_exists('CustomContactFormsDB')) {
207
  $style[$key] = $this->formatStyle($this->encodeOption($value));
208
  }
209
  $wpdb->insert($this->styles_table, $style);
 
210
  return $wpdb->insert_id;
211
  }
212
 
103
 
104
  function updateTables() {
105
  global $wpdb;
106
+ $wpdb->show_errors();
107
  if (!$this->columnExists('user_field', $this->fields_table))
108
  $wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `user_field` INT( 1 ) NOT NULL DEFAULT '1'");
109
  if (!$this->columnExists('form_style', $this->forms_table))
138
  $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '12px'");
139
  if (!$this->columnExists('success_popover_title_fontsize', $this->styles_table))
140
  $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_title_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '1.3em'");
141
+ if (!$this->columnExists('success_popover_height', $this->styles_table))
142
+ $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_height` VARCHAR( 20 ) NOT NULL DEFAULT '200px'");
143
  if (!$this->columnExists('success_popover_fontcolor', $this->styles_table))
144
  $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333'");
145
  if (!$this->columnExists('success_popover_title_fontcolor', $this->styles_table))
150
  $wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_options` VARCHAR( 300 ) NOT NULL");
151
  if (!$this->columnExists('field_required', $this->fields_table))
152
  $wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_required` INT( 1 ) NOT NULL DEFAULT '0'");
153
+ $wpdb->show_errors();
154
+ $wpdb->print_error();
155
  }
156
 
157
  function insertFixedFields() {
205
 
206
  function insertStyle($style) {
207
  global $wpdb;
208
+ $wpdb->show_errors();
209
  if (empty($style) or empty($style[style_slug]) or $this->styleSlugExists($this->formatSlug($style[style_slug]))) return false;
210
  $style[style_slug] = $this->formatSlug($style[style_slug]);
211
  foreach ($style as $key => $value) {
213
  $style[$key] = $this->formatStyle($this->encodeOption($value));
214
  }
215
  $wpdb->insert($this->styles_table, $style);
216
+ $wpdb->print_error();
217
  return $wpdb->insert_id;
218
  }
219
 
custom-contact-forms.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Custom Contact Forms
4
  Plugin URI: http://taylorlovett.com/wordpress-plugins
5
  Description: Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact Forms or Contact Form 7. Customize every aspect of your forms without any knowledge of CSS: borders, padding, sizes, colors. Ton's of great features. Required fields, captchas, tooltip popovers, unlimited fields/forms/form styles, use a custom thank you page or built-in popover with a custom success message set for each form. <a href="options-general.php?page=custom-contact-forms">Settings</a>
6
- Version: 3.5.2
7
  Author: Taylor Lovett
8
  Author URI: http://www.taylorlovett.com
9
  */
@@ -133,7 +133,7 @@ if (!class_exists('CustomContactForms')) {
133
  <a href="javascript:void(0)" class="close">[close]</a>
134
  </div>
135
  <div class="popover-body">
136
- <p>CCF is an extremely intuitive plugin allowing you to create any type of contact form you can image. CCF is very user friendly but with possibilities comes completexity. It is recommend that you click the button below to add default fields, field options, and forms.
137
  The default content will help you get a feel for the amazing things you can accomplish with this plugin. This popover only shows up automatically the first time you visit the admin page; <b>if you want to view this popover again, click the "Show Plugin Usage Popover"</b> in the instruction area of the admin page.</p>
138
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
139
  <input type="submit" class="insert-default-content-button" value="Insert Default Content" name="insert_default_content" />
@@ -1034,6 +1034,10 @@ if (!class_exists('CustomContactForms')) {
1034
  <label for="success_popover_title_fontsize">Success Popover Title Font Size:</label>
1035
  <input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_title_fontsize]" />
1036
  (ex: 12px, 1em, 100%)</li>
 
 
 
 
1037
  <li>
1038
  <input type="submit" value="Create Style" name="style_create" />
1039
  </li>
@@ -1076,6 +1080,7 @@ if (!class_exists('CustomContactForms')) {
1076
  <label>Textarea Height:</label><input type="text" maxlength="20" value="<?php echo $style->textarea_height; ?>" name="style[textarea_height]" /><br />
1077
  <label>Dropdown Width:</label><input type="text" maxlength="20" value="<?php echo $style->dropdown_width; ?>" name="style[dropdown_width]" /><br />
1078
  <label>Label Margin:</label><input type="text" maxlength="20" value="<?php echo $style->label_margin; ?>" name="style[label_margin]" /><br />
 
1079
  </td>
1080
  <td>
1081
  <label>Label Width:</label><input type="text" maxlength="20" value="<?php echo $style->label_width; ?>" name="style[label_width]" /><br />
@@ -1130,13 +1135,7 @@ if (!class_exists('CustomContactForms')) {
1130
  <th scope="col" class="manage-column"></th>
1131
  </tr>
1132
  </tfoot>
1133
- </table><a name="plugin-news"></a>
1134
- <div id="plugin-news" class="postbox">
1135
- <h3 class="hndle"><span>Custom Contact Forms Plugin News</span></h3>
1136
- <div class="inside">
1137
- <?php $this->displayPluginNewsFeed(); ?>
1138
- </div>
1139
- </div><a name="contact-author"></a>
1140
  <div id="contact-author" class="postbox">
1141
  <h3 class="hndle"><span>Report a Bug/Suggest a Feature</span></h3>
1142
  <div class="inside">
@@ -1178,6 +1177,13 @@ the field names you want required by commas. Remember to use underscores instead
1178
  &lt;/form&gt;</textarea>
1179
  </div>
1180
  </div>
 
 
 
 
 
 
 
1181
  </div>
1182
  <?php
1183
  }
@@ -1195,7 +1201,8 @@ the field names you want required by commas. Remember to use underscores instead
1195
  }
1196
  $matches = array();
1197
  preg_match_all('/\[customcontact form=([0-9]+)\]/si', $content, $matches);
1198
- for ($i = 0; $i < count($matches[0]); $i++) {
 
1199
  if (parent::selectForm($matches[1][$i], '') == false) {
1200
  $form_code = '';
1201
  } else {
@@ -1306,9 +1313,11 @@ the field names you want required by commas. Remember to use underscores instead
1306
  $style = parent::selectStyle($form->form_style, '');
1307
  $style_class = $style->style_slug;
1308
  }
 
1309
  $action = (!empty($form->form_action)) ? $form->form_action : get_permalink();
1310
  $out .= '<form id="'.$form_id.'" method="'.strtolower($form->form_method).'" action="'.$action.'" class="'.$style_class.'">' . "\n";
1311
- $out .= parent::decodeOption($form->custom_code, 1, 1) . '<h4 id="h4-' . $form->id . '-'.$form_key.'">' . parent::decodeOption($form->form_title, 1, 1) . '</h4>' . "\n";
 
1312
  $fields = parent::getAttachedFieldsArray($fid);
1313
  $hiddens = '';
1314
  $code_type = ($admin_options[code_type] == 'XHTML') ? ' /' : '';
@@ -1319,14 +1328,11 @@ the field names you want required by commas. Remember to use underscores instead
1319
  $input_id = 'id="'.parent::decodeOption($field->field_slug, 1, 1).'-'.$form_key.'"';
1320
  $field_value = parent::decodeOption($field->field_value, 1, 1);
1321
  $instructions = (empty($field->field_instructions)) ? '' : 'title="' . $field->field_instructions . $req_long . '" class="ccf-tooltip-field"';
1322
- //if ($is_sidebar && $admin_options[enable_widget_tooltips] == 0) $instructions = '';
1323
  if ($admin_options[enable_widget_tooltips] == 0 && $is_sidebar) $instructions = '';
1324
  if ($_SESSION[fields][$field->field_slug]) {
1325
  if ($admin_options[remember_field_values] == 1)
1326
  $field_value = $_SESSION[fields][$field->field_slug];
1327
- }
1328
-
1329
- if ($field->user_field == 0 && $field->field_slug == 'captcha') {
1330
  $out .= '<div>' . "\n" . $this->getCaptchaCode($form->id) . "\n" . '</div>' . "\n";
1331
  } elseif ($field->field_type == 'Text') {
1332
  $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="'.$field->field_maxlength.'"';
@@ -1429,7 +1435,7 @@ the field names you want required by commas. Remember to use underscores instead
1429
  ?>
1430
  <style type="text/css">
1431
  <!--
1432
- #ccf-form-success { border-color:#<?php echo parent::formatStyle($style->success_popover_bordercolor); ?>; }
1433
  #ccf-form-success div { background-color:#<?php echo parent::formatStyle($style->success_popover_bordercolor); ?>; }
1434
  #ccf-form-success div h5 { color:#<?php echo parent::formatStyle($style->success_popover_title_fontcolor); ?>; font-size:<?php echo $style->success_popover_title_fontsize; ?>; }
1435
  #ccf-form-success div a { color:#<?php echo parent::formatStyle($style->success_popover_title_fontcolor); ?>; }
3
  Plugin Name: Custom Contact Forms
4
  Plugin URI: http://taylorlovett.com/wordpress-plugins
5
  Description: Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact Forms or Contact Form 7. Customize every aspect of your forms without any knowledge of CSS: borders, padding, sizes, colors. Ton's of great features. Required fields, captchas, tooltip popovers, unlimited fields/forms/form styles, use a custom thank you page or built-in popover with a custom success message set for each form. <a href="options-general.php?page=custom-contact-forms">Settings</a>
6
+ Version: 3.5.3
7
  Author: Taylor Lovett
8
  Author URI: http://www.taylorlovett.com
9
  */
133
  <a href="javascript:void(0)" class="close">[close]</a>
134
  </div>
135
  <div class="popover-body">
136
+ <p>CCF is an extremely intuitive plugin allowing you to create any type of contact form you can image. CCF is very user friendly but with possibilities comes complexity. It is recommend that you click the button below to add default fields, field options, and forms.
137
  The default content will help you get a feel for the amazing things you can accomplish with this plugin. This popover only shows up automatically the first time you visit the admin page; <b>if you want to view this popover again, click the "Show Plugin Usage Popover"</b> in the instruction area of the admin page.</p>
138
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
139
  <input type="submit" class="insert-default-content-button" value="Insert Default Content" name="insert_default_content" />
1034
  <label for="success_popover_title_fontsize">Success Popover Title Font Size:</label>
1035
  <input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_title_fontsize]" />
1036
  (ex: 12px, 1em, 100%)</li>
1037
+ <li>
1038
+ <label for="success_popover_height">Success Popover Height:</label>
1039
+ <input type="text" maxlength="20" value="200px" class="width75" name="style[success_popover_height]" />
1040
+ (ex: 200px, 6em, 50%)</li>
1041
  <li>
1042
  <input type="submit" value="Create Style" name="style_create" />
1043
  </li>
1080
  <label>Textarea Height:</label><input type="text" maxlength="20" value="<?php echo $style->textarea_height; ?>" name="style[textarea_height]" /><br />
1081
  <label>Dropdown Width:</label><input type="text" maxlength="20" value="<?php echo $style->dropdown_width; ?>" name="style[dropdown_width]" /><br />
1082
  <label>Label Margin:</label><input type="text" maxlength="20" value="<?php echo $style->label_margin; ?>" name="style[label_margin]" /><br />
1083
+ <label>Success Popover<br />Height:</label><input type="text" maxlength="20" value="<?php echo $style->success_popover_height; ?>" name="style[success_popover_height]" /><br />
1084
  </td>
1085
  <td>
1086
  <label>Label Width:</label><input type="text" maxlength="20" value="<?php echo $style->label_width; ?>" name="style[label_width]" /><br />
1135
  <th scope="col" class="manage-column"></th>
1136
  </tr>
1137
  </tfoot>
1138
+ </table><a name="contact-author"></a>
 
 
 
 
 
 
1139
  <div id="contact-author" class="postbox">
1140
  <h3 class="hndle"><span>Report a Bug/Suggest a Feature</span></h3>
1141
  <div class="inside">
1177
  &lt;/form&gt;</textarea>
1178
  </div>
1179
  </div>
1180
+ <a name="plugin-news"></a>
1181
+ <div id="plugin-news" class="postbox">
1182
+ <h3 class="hndle"><span>Custom Contact Forms Plugin News</span></h3>
1183
+ <div class="inside">
1184
+ <?php $this->displayPluginNewsFeed(); ?>
1185
+ </div>
1186
+ </div>
1187
  </div>
1188
  <?php
1189
  }
1201
  }
1202
  $matches = array();
1203
  preg_match_all('/\[customcontact form=([0-9]+)\]/si', $content, $matches);
1204
+ $matches_count = count($matches[0]);
1205
+ for ($i = 0; $i < $matches_count; $i++) {
1206
  if (parent::selectForm($matches[1][$i], '') == false) {
1207
  $form_code = '';
1208
  } else {
1313
  $style = parent::selectStyle($form->form_style, '');
1314
  $style_class = $style->style_slug;
1315
  }
1316
+ $form_title = parent::decodeOption($form->form_title, 1, 1);
1317
  $action = (!empty($form->form_action)) ? $form->form_action : get_permalink();
1318
  $out .= '<form id="'.$form_id.'" method="'.strtolower($form->form_method).'" action="'.$action.'" class="'.$style_class.'">' . "\n";
1319
+ $out .= parent::decodeOption($form->custom_code, 1, 1) . "\n";
1320
+ if (!empty($form_title)) $out .= '<h4 id="h4-' . $form->id . '-' . $form_key . '">' . $form_title . '</h4>' . "\n";
1321
  $fields = parent::getAttachedFieldsArray($fid);
1322
  $hiddens = '';
1323
  $code_type = ($admin_options[code_type] == 'XHTML') ? ' /' : '';
1328
  $input_id = 'id="'.parent::decodeOption($field->field_slug, 1, 1).'-'.$form_key.'"';
1329
  $field_value = parent::decodeOption($field->field_value, 1, 1);
1330
  $instructions = (empty($field->field_instructions)) ? '' : 'title="' . $field->field_instructions . $req_long . '" class="ccf-tooltip-field"';
 
1331
  if ($admin_options[enable_widget_tooltips] == 0 && $is_sidebar) $instructions = '';
1332
  if ($_SESSION[fields][$field->field_slug]) {
1333
  if ($admin_options[remember_field_values] == 1)
1334
  $field_value = $_SESSION[fields][$field->field_slug];
1335
+ } if ($field->user_field == 0 && $field->field_slug == 'captcha') {
 
 
1336
  $out .= '<div>' . "\n" . $this->getCaptchaCode($form->id) . "\n" . '</div>' . "\n";
1337
  } elseif ($field->field_type == 'Text') {
1338
  $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="'.$field->field_maxlength.'"';
1435
  ?>
1436
  <style type="text/css">
1437
  <!--
1438
+ #ccf-form-success { border-color:#<?php echo parent::formatStyle($style->success_popover_bordercolor); ?>; height:<?php $style->success_popover_height; ?>; }
1439
  #ccf-form-success div { background-color:#<?php echo parent::formatStyle($style->success_popover_bordercolor); ?>; }
1440
  #ccf-form-success div h5 { color:#<?php echo parent::formatStyle($style->success_popover_title_fontcolor); ?>; font-size:<?php echo $style->success_popover_title_fontsize; ?>; }
1441
  #ccf-form-success div a { color:#<?php echo parent::formatStyle($style->success_popover_title_fontcolor); ?>; }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.taylorlovett.com
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
5
  Requires at least: 2.8.1
6
  Tested up to: 3.0.1
7
- Stable tag: 3.5.2
8
 
9
  Gauranteed to be the most customizable and intuitive contact form plugin for Wordpress.
10
 
@@ -49,6 +49,7 @@ Special Features:
49
  2. Activate the plugin from your Wordpress Admin Panel
50
  3. Configure the plugin, create fields, and create forms in the Settings page called Custom Contact Forms
51
  4. Display those forms in posts and pages by inserting the code: __[customcontact form=FORMID]__
 
52
 
53
  == Configuring and Using the Plugin ==
54
  1. Create as many forms as you want.
@@ -60,6 +61,8 @@ Special Features:
60
  7. Create form styles to change your forms appearances. The image below explains how each style field can change the look of your forms.
61
  8. (advanced) If you are confident in your HTML and CSS skills, you can use the Custom HTML Forms feature as a framework and write your forms from scratch. This allows you to use this plugin simply to process your form requests. The Custom HTML Forms feature will process and email any form variables sent to it regardless of whether they are created in the fields manager.
62
 
 
 
63
  == Support ==
64
  For questions, feature requests, and support concerning the Custom Contact Forms plugin, please email me at:
65
  admin@taylorlovett.com
@@ -73,6 +76,10 @@ Visit http://www.taylorlovett.com/wordpress-plugins for screenshots. Right now a
73
 
74
  == Changelog ==
75
 
 
 
 
 
76
  = 3.5.2 =
77
  * custom-contact-forms.php - Plugin Usage popover added, insert default content button
78
  * custom-contact-forms-db.php - Insert default content function
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
5
  Requires at least: 2.8.1
6
  Tested up to: 3.0.1
7
+ Stable tag: 3.5.3
8
 
9
  Gauranteed to be the most customizable and intuitive contact form plugin for Wordpress.
10
 
49
  2. Activate the plugin from your Wordpress Admin Panel
50
  3. Configure the plugin, create fields, and create forms in the Settings page called Custom Contact Forms
51
  4. Display those forms in posts and pages by inserting the code: __[customcontact form=FORMID]__
52
+ 5. In the instruction section of the plugin. Press the button to insert the default content. The default content contains a very generic form that will help you understand the many ways you can use Custom Contact Forms.
53
 
54
  == Configuring and Using the Plugin ==
55
  1. Create as many forms as you want.
61
  7. Create form styles to change your forms appearances. The image below explains how each style field can change the look of your forms.
62
  8. (advanced) If you are confident in your HTML and CSS skills, you can use the Custom HTML Forms feature as a framework and write your forms from scratch. This allows you to use this plugin simply to process your form requests. The Custom HTML Forms feature will process and email any form variables sent to it regardless of whether they are created in the fields manager.
63
 
64
+ Custom Contact Forms is an extremely intuitive plugin allowing you to create any type of contact form you can image. CCF is very user friendly but with possibilities comes complexity. __It is recommend that you click the button in the instructions section of the plugin to add default fields, field options, and forms.__ The default content will help you get a feel for the amazing things you can accomplish with this plugin. __It is also recommended you click the "Show Plugin Usage Popover"__ in the instruction area of the admin page to read in detail about all parts of the plugin.
65
+
66
  == Support ==
67
  For questions, feature requests, and support concerning the Custom Contact Forms plugin, please email me at:
68
  admin@taylorlovett.com
76
 
77
  == Changelog ==
78
 
79
+ = 3.5.3 =
80
+ * custom-contact-forms.php - Style popover height option added to style manager. Form title heading not shown if left blank.
81
+ * custom-contact-forms-db.php - New success popover height column added to styles table
82
+
83
  = 3.5.2 =
84
  * custom-contact-forms.php - Plugin Usage popover added, insert default content button
85
  * custom-contact-forms-db.php - Insert default content function