Custom Contact Forms - Version 4.0.0.b3

Version Description

Popover forms will be added in September 2010.

Download this release

Release Info

Developer tlovett1
Plugin Icon 128x128 Custom Contact Forms
Version 4.0.0.b3
Comparing to
See all releases

Code changes from version 3.5.9 to 4.0.0.b3

css/custom-contact-forms-admin.css CHANGED
@@ -19,21 +19,6 @@
19
  height:25px;
20
  padding: 7px 0 0 9px;
21
  }
22
- #customcontactforms-admin a.rate-me {
23
- background-color:#FFFF99;
24
- width:920px;
25
- border:1px solid #666666;
26
- padding:7px;
27
- display:block;
28
- text-align:center;
29
- margin:.5em 0 .8em 5px;
30
- -moz-border-radius:11px;
31
- -webkit-border-radius:11px;
32
- border-radius:11px;
33
- -moz-box-shadow:0 0 1px #123;
34
- -webkit-box-shadow: 0 0 1px #123;
35
- box-shadow:0 0 1px #123;
36
- }
37
  #customcontactforms-admin #instructions {
38
  float:left;
39
  clear:none;
@@ -70,6 +55,43 @@
70
  margin:20px 1em 1em 5px;
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  #customcontactforms-admin #form-submissions {
74
  clear:both;
75
  width:1000px;
@@ -87,6 +109,15 @@
87
  #customcontactforms-admin #form-submissions table.second { margin-left:48%; border-collapse:collapse; width:48%; }
88
 
89
 
 
 
 
 
 
 
 
 
 
90
  #customcontactforms-admin #field-options {
91
  clear:both;
92
  width:1000px;
@@ -134,21 +165,6 @@
134
  text-align:center;
135
  padding:6px 0 0 0;
136
  }
137
- #customcontactforms-admin a.rate-me {
138
- background-color:#FFFF99;
139
- width:920px;
140
- border:1px solid #666666;
141
- padding:7px;
142
- display:block;
143
- text-align:center;
144
- margin:.5em 0 .8em 5px;
145
- -moz-border-radius:11px;
146
- -webkit-border-radius:11px;
147
- border-radius:11px;
148
- -moz-box-shadow:0 0 1px #123;
149
- -webkit-box-shadow: 0 0 1px #123;
150
- box-shadow:0 0 1px #123;
151
- }
152
  #customcontactforms-admin #field-options .action { width:155px; }
153
  #customcontactforms-admin #field-options .option-value { width:125px; }
154
  #customcontactforms-admin #field-options .create-field-options-header {
@@ -192,6 +208,8 @@
192
  width:1000px;
193
  margin:20px 1em 1em 5px;
194
  }
 
 
195
  #customcontactforms-admin #create-styles .style_left { float:left; width:48% }
196
  #customcontactforms-admin #create-styles .style_right { width:48%; margin-left:51%; clear:none }
197
  #customcontactforms-admin #plugin-news {
@@ -326,6 +344,9 @@
326
  -webkit-box-shadow: 0 0 14px #123;
327
  box-shadow:0 0 14px #123;
328
  }
 
 
 
329
  #ccf-usage-popover div.popover-header {
330
  background-color:#efefef;
331
  padding:9px 9px 9px 20px;
@@ -350,7 +371,7 @@
350
  overflow:scroll;
351
  position:absolute;
352
  bottom:0px;
353
- top:2.4em;
354
  padding:3px;
355
  }
356
  #ccf-usage-popover div.popover-body ul { margin:5px 0px 5px 8px; padding:0; border-top:1px solid #efefef; }
19
  height:25px;
20
  padding: 7px 0 0 9px;
21
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  #customcontactforms-admin #instructions {
23
  float:left;
24
  clear:none;
55
  margin:20px 1em 1em 5px;
56
  }
57
 
58
+ #customcontactforms-admin a.rate-me {
59
+ background-color:#FFFEEB;
60
+ width:920px;
61
+ border:1px solid #cccccc;
62
+ padding:7px;
63
+ display:block;
64
+ text-align:center;
65
+ margin:.5em 0 .8em 5px;
66
+ -moz-border-radius:11px;
67
+ -webkit-border-radius:11px;
68
+ border-radius:11px;
69
+ }
70
+ .ccf-tooltip {
71
+ background-color:#FFFEEB;
72
+ border:2px solid #666666;
73
+ padding:10px 15px;
74
+ width:200px;
75
+ -moz-border-radius:9px;
76
+ -khtml-border-radius:9px;
77
+ -webkit-border-radius:9px;
78
+ border-radius:9px;
79
+ display:none;
80
+ color:#333333;/*#D54E21;*/
81
+ font-weight:bold;
82
+ font-family:Verdana, Arial, Helvetica, sans-serif;
83
+ text-align:left;
84
+ font-size:10px;
85
+ -moz-box-shadow:0 0 6px #123;
86
+ -webkit-box-shadow: 0 0 6px #123;
87
+ box-shadow:0 0 6px #123;
88
+ }
89
+ #customcontactforms-admin .toollink {
90
+ text-decoration:none;
91
+ }
92
+ #customcontactforms-admin a.rate-me span { font-weight:bold }
93
+ #customcontactforms-admin .rate-me a span { text-decoration:underline }
94
+
95
  #customcontactforms-admin #form-submissions {
96
  clear:both;
97
  width:1000px;
109
  #customcontactforms-admin #form-submissions table.second { margin-left:48%; border-collapse:collapse; width:48%; }
110
 
111
 
112
+ #customcontactforms-admin #import-export {
113
+ clear:both;
114
+ width:1000px;
115
+ margin:20px 1em 1em 5px;
116
+ }
117
+ #customcontactforms-admin #import-export .import { float:left; margin:0; padding:0; width:48%; }
118
+ #customcontactforms-admin #import-export .export { margin-left:50%; width:48%; }
119
+ #customcontactforms-admin #import-export p { padding:0 0 5px 0; margin:0; }
120
+
121
  #customcontactforms-admin #field-options {
122
  clear:both;
123
  width:1000px;
165
  text-align:center;
166
  padding:6px 0 0 0;
167
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  #customcontactforms-admin #field-options .action { width:155px; }
169
  #customcontactforms-admin #field-options .option-value { width:125px; }
170
  #customcontactforms-admin #field-options .create-field-options-header {
208
  width:1000px;
209
  margin:20px 1em 1em 5px;
210
  }
211
+ #customcontactforms-admin #create-styles .inside,
212
+ #customcontactforms-admin #create-styles form { margin-top:0px; padding-top:0 }
213
  #customcontactforms-admin #create-styles .style_left { float:left; width:48% }
214
  #customcontactforms-admin #create-styles .style_right { width:48%; margin-left:51%; clear:none }
215
  #customcontactforms-admin #plugin-news {
344
  -webkit-box-shadow: 0 0 14px #123;
345
  box-shadow:0 0 14px #123;
346
  }
347
+ #ccf-usage-popover #popover-tof { text-align:center; border-bottom:1px #ccc dashed; margin:5px 0 10px 0; padding:0 0 6px 0; }
348
+ #ccf-usage-popover #popover-tof li { display:inline; padding:0 2px 0 3px;
349
+ }
350
  #ccf-usage-popover div.popover-header {
351
  background-color:#efefef;
352
  padding:9px 9px 9px 20px;
371
  overflow:scroll;
372
  position:absolute;
373
  bottom:0px;
374
+ top:3em;
375
  padding:3px;
376
  }
377
  #ccf-usage-popover div.popover-body ul { margin:5px 0px 5px 8px; padding:0; border-top:1px solid #efefef; }
css/custom-contact-forms-standards.css CHANGED
@@ -11,4 +11,7 @@
11
  .floatleft { float:left; }
12
  .floatright { float:right; }
13
  .form-extra-options-table { margin:0 auto 0 auto; }
14
- .evenrow { background-color:#f5f5f5; }
 
 
 
11
  .floatleft { float:left; }
12
  .floatright { float:right; }
13
  .form-extra-options-table { margin:0 auto 0 auto; }
14
+ .evenrow { background-color:#f5f5f5; }
15
+ .alignright { text-align:right; }
16
+ .alignleft { text-align:right; }
17
+ .ccf-loading-icon { margin-left: 5px; margin-right:7px; }
css/custom-contact-forms.css CHANGED
@@ -66,7 +66,7 @@ form.customcontactform-sidebar div select { width:auto; }
66
  }
67
 
68
  .ccf-popover .ccf-popover-close { position:absolute; top:1px; right:5px; }
69
- .tooltip {
70
  background-color:#000;
71
  border:1px solid #fff;
72
  padding:10px 15px;
@@ -75,8 +75,6 @@ form.customcontactform-sidebar div select { width:auto; }
75
  color:#fff;
76
  text-align:left;
77
  font-size:12px;
78
-
79
- /* outline radius for mozilla/firefox only */
80
  -moz-box-shadow:0 0 10px #000;
81
  -webkit-box-shadow:0 0 10px #000;
82
  }
@@ -97,6 +95,9 @@ form.customcontactform-sidebar div select { width:auto; }
97
  left:30%;
98
  background-color:white;
99
  top:30%;
 
 
 
100
  }
101
  #ccf-form-success div {
102
  background-color:#efefef;
66
  }
67
 
68
  .ccf-popover .ccf-popover-close { position:absolute; top:1px; right:5px; }
69
+ .ccf-tooltip {
70
  background-color:#000;
71
  border:1px solid #fff;
72
  padding:10px 15px;
75
  color:#fff;
76
  text-align:left;
77
  font-size:12px;
 
 
78
  -moz-box-shadow:0 0 10px #000;
79
  -webkit-box-shadow:0 0 10px #000;
80
  }
95
  left:30%;
96
  background-color:white;
97
  top:30%;
98
+ -moz-box-shadow:0 0 14px #123;
99
+ -webkit-box-shadow: 0 0 14px #123;
100
+ box-shadow:0 0 14px #123;
101
  }
102
  #ccf-form-success div {
103
  background-color:#efefef;
custom-contact-forms-db.php CHANGED
@@ -6,34 +6,11 @@
6
  */
7
  if (!class_exists('CustomContactFormsDB')) {
8
  class CustomContactFormsDB {
9
- var $forms_table;
10
- var $fields_table;
11
- var $styles_table;
12
- var $field_options_table;
13
  var $cache = array();
14
- function CustomContactFormsDB() {
15
- global $wpdb;
16
- $table_prefix = $wpdb->prefix;
17
- $this->forms_table = $table_prefix . 'customcontactforms_forms';
18
- $this->fields_table = $table_prefix . 'customcontactforms_fields';
19
- $this->styles_table = $table_prefix . 'customcontactforms_styles';
20
- $this->field_options_table = $table_prefix . 'customcontactforms_field_options';
21
- }
22
-
23
- function encodeOption($option) {
24
- return htmlspecialchars(stripslashes($option), ENT_QUOTES);
25
- }
26
-
27
- function decodeOption($option, $strip_slashes = 1, $decode_html_chars = 1) {
28
- if ($strip_slashes == 1) $option = stripslashes($option);
29
- if ($decode_html_chars == 1) $option = html_entity_decode($option);
30
- return $option;
31
- }
32
-
33
  function createTables() {
34
  global $wpdb;
35
  if(!$this->formsTableExists()) {
36
- $sql1 = " CREATE TABLE `".$this->forms_table."` (
37
  `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
38
  `form_slug` VARCHAR( 100 ) NOT NULL ,
39
  `form_title` VARCHAR( 200 ) NOT NULL ,
@@ -45,8 +22,18 @@ if (!class_exists('CustomContactFormsDB')) {
45
  PRIMARY KEY ( `id` )
46
  ) ENGINE = MYISAM AUTO_INCREMENT=1 ";
47
  $wpdb->query($sql1);
 
 
 
 
 
 
 
 
 
 
48
  } if(!$this->fieldOptionsTableExists()) {
49
- $sql5 = " CREATE TABLE `".$this->field_options_table."` (
50
  `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
51
  `option_slug` VARCHAR( 100 ) NOT NULL ,
52
  `option_label` VARCHAR( 200 ) NOT NULL ,
@@ -55,7 +42,7 @@ if (!class_exists('CustomContactFormsDB')) {
55
  ) ENGINE = MYISAM AUTO_INCREMENT=1 ";
56
  $wpdb->query($sql5);
57
  } if(!$this->fieldsTableExists()) {
58
- $sql2 = "CREATE TABLE `".$this->fields_table."` (
59
  `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
60
  `field_slug` VARCHAR( 50 ) NOT NULL ,
61
  `field_label` VARCHAR( 100 ) NOT NULL ,
@@ -67,30 +54,29 @@ if (!class_exists('CustomContactFormsDB')) {
67
  ) ENGINE = MYISAM AUTO_INCREMENT=1 ";
68
  $wpdb->query($sql2);
69
  } if(!$this->stylesTableExists()) {
70
- // Title, input, textarea, label, form, submit
71
- $sql3 = "CREATE TABLE `".$this->styles_table."` (
72
  `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
73
  `style_slug` VARCHAR( 30 ) NOT NULL ,
74
  `input_width` VARCHAR( 10 ) NOT NULL DEFAULT '200px',
75
  `textarea_width` VARCHAR( 10 ) NOT NULL DEFAULT '200px',
76
  `textarea_height` VARCHAR( 10 ) NOT NULL DEFAULT '100px',
77
  `form_borderwidth` VARCHAR( 10 ) NOT NULL DEFAULT '0px',
78
- `label_width` VARCHAR( 10 ) NOT NULL DEFAULT '110px',
79
- `form_width` VARCHAR( 10 ) NOT NULL DEFAULT '500px',
80
- `submit_width` VARCHAR( 10 ) NOT NULL DEFAULT '80px',
81
- `submit_height` VARCHAR( 10 ) NOT NULL DEFAULT '35px',
82
  `label_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1em',
83
  `title_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1.2em',
84
- `field_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1em',
85
  `submit_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1.1em',
86
- `field_bordercolor` VARCHAR( 10 ) NOT NULL DEFAULT 'blue',
87
- `form_borderstyle` VARCHAR( 30 ) NOT NULL DEFAULT 'dashed',
88
- `form_bordercolor` VARCHAR( 20 ) NOT NULL DEFAULT 'black',
89
- `field_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#000000',
90
- `label_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333',
91
- `title_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333',
92
- `submit_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333',
93
- `form_fontfamily` VARCHAR( 150 ) NOT NULL DEFAULT 'Verdana, Tahoma, Arial',
94
  PRIMARY KEY ( `id` )
95
  ) ENGINE = MYISAM AUTO_INCREMENT=1 ";
96
  $wpdb->query($sql3);
@@ -104,52 +90,63 @@ if (!class_exists('CustomContactFormsDB')) {
104
 
105
  function updateTables() {
106
  global $wpdb;
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))
110
- $wpdb->query("ALTER TABLE `" . $this->forms_table . "` ADD `form_style` INT( 10 ) NOT NULL DEFAULT '0'");
111
- if (!$this->columnExists('form_email', $this->forms_table))
112
- $wpdb->query("ALTER TABLE `" . $this->forms_table . "` ADD `form_email` VARCHAR( 50 ) NOT NULL");
113
- if (!$this->columnExists('form_success_message', $this->forms_table))
114
- $wpdb->query("ALTER TABLE `" . $this->forms_table . "` ADD `form_success_message` TEXT NOT NULL");
115
- if (!$this->columnExists('form_thank_you_page', $this->forms_table))
116
- $wpdb->query("ALTER TABLE `" . $this->forms_table . "` ADD `form_thank_you_page` VARCHAR ( 200 ) NOT NULL");
117
- if (!$this->columnExists('field_backgroundcolor', $this->styles_table))
118
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `field_backgroundcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#efefef'");
119
- if (!$this->columnExists('field_borderstyle', $this->styles_table))
120
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `field_borderstyle` VARCHAR( 20 ) NOT NULL DEFAULT 'solid'");
121
- if (!$this->columnExists('form_success_title', $this->forms_table))
122
- $wpdb->query("ALTER TABLE `" . $this->forms_table . "` ADD `form_success_title` VARCHAR( 150 ) NOT NULL DEFAULT 'Form Success!'");
123
- if (!$this->columnExists('form_padding', $this->styles_table))
124
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `form_padding` VARCHAR( 20 ) NOT NULL DEFAULT '4px'");
125
- if (!$this->columnExists('form_margin', $this->styles_table))
126
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `form_margin` VARCHAR( 20 ) NOT NULL DEFAULT '4px'");
127
- if (!$this->columnExists('title_margin', $this->styles_table))
128
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `title_margin` VARCHAR( 20 ) NOT NULL DEFAULT '2px'");
129
- if (!$this->columnExists('label_margin', $this->styles_table))
130
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `label_margin` VARCHAR( 20 ) NOT NULL DEFAULT '3px'");
131
- if (!$this->columnExists('textarea_backgroundcolor', $this->styles_table))
132
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `textarea_backgroundcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#efefef'");
133
- if (!$this->columnExists('success_popover_bordercolor', $this->styles_table))
134
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_bordercolor` VARCHAR( 20 ) NOT NULL DEFAULT '#efefef'");
135
- if (!$this->columnExists('dropdown_width', $this->styles_table))
136
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `dropdown_width` VARCHAR( 20 ) NOT NULL DEFAULT 'auto'");
137
- if (!$this->columnExists('success_popover_fontsize', $this->styles_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))
146
- $wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_title_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333'");
147
- if (!$this->columnExists('field_instructions', $this->fields_table))
148
- $wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_instructions` TEXT NOT NULL");
149
- if (!$this->columnExists('field_options', $this->fields_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
  }
154
 
155
  function insertFixedFields() {
@@ -157,12 +154,11 @@ if (!class_exists('CustomContactFormsDB')) {
157
  $ishuman = array('field_slug' => 'ishuman', 'field_label' => 'Check if you are human.', 'field_type' => 'Checkbox', 'field_value' => '1', 'field_maxlength' => '0', 'user_field' => 0, 'field_instructions' => 'This helps us prevent spam.');
158
  $fixedEmail = array('field_slug' => 'fixedEmail', 'field_label' => 'Your Email', 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => 'Please enter your email address.');
159
  if (!$this->fieldSlugExists('captcha'))
160
- $this->insertField($captcha);
161
  if (!$this->fieldSlugExists('ishuman'))
162
- $this->insertField($ishuman);
163
  if (!$this->fieldSlugExists('fixedEmail'))
164
- $this->insertField($fixedEmail);
165
-
166
  }
167
 
168
  /*function columnExists($column, $table) {
@@ -189,20 +185,20 @@ if (!class_exists('CustomContactFormsDB')) {
189
  global $wpdb;
190
  if (empty($form) or empty($form[form_slug]) or $this->formSlugExists($this->formatSlug($form[form_slug]))) return false;
191
  $form[form_slug] = $this->formatSlug($form[form_slug]);
192
- $form = array_map(array(&$this, 'encodeOption'), $form);
193
- $wpdb->insert($this->forms_table, $form);
 
194
  return $wpdb->insert_id;
195
  }
196
 
197
- function insertField($field) {
198
  global $wpdb;
199
- if (empty($field) or empty($field[field_slug]) or $this->fieldSlugExists($this->formatSlug($field[field_slug]))) return false;
 
200
  $field[field_slug] = $this->formatSlug($field[field_slug]);
201
- foreach ($field as $key => $value) {
202
- if ($key != 'field_slug')
203
- $field[$key] = $this->encodeOption($value);
204
- }
205
- $wpdb->insert($this->fields_table, $field);
206
  return $wpdb->insert_id;
207
  }
208
 
@@ -210,8 +206,9 @@ if (!class_exists('CustomContactFormsDB')) {
210
  global $wpdb;
211
  if (empty($option) or empty($option[option_slug]) or $this->fieldOptionsSlugExists($this->formatSlug($option[option_slug]))) return false;
212
  $option[option_slug] = $this->formatSlug($option[option_slug]);
213
- $option = array_map(array(&$this, 'encodeOption'), $option);
214
- $wpdb->insert($this->field_options_table, $option);
 
215
  return $wpdb->insert_id;
216
  }
217
 
@@ -219,33 +216,36 @@ if (!class_exists('CustomContactFormsDB')) {
219
  global $wpdb;
220
  if (empty($style) or empty($style[style_slug]) or $this->styleSlugExists($this->formatSlug($style[style_slug]))) return false;
221
  $style[style_slug] = $this->formatSlug($style[style_slug]);
222
- foreach ($style as $key => $value) {
223
- if ($key != 'style_slug')
224
- $style[$key] = $this->formatStyle($this->encodeOption($value));
225
- }
226
- $wpdb->insert($this->styles_table, $style);
227
  return $wpdb->insert_id;
228
  }
229
 
230
 
231
  function fieldsTableExists() {
232
  global $wpdb;
233
- return ($wpdb->get_var("show tables like '". $this->fields_table . "'") == $this->fields_table);
234
  }
235
 
236
  function formsTableExists() {
237
  global $wpdb;
238
- return ($wpdb->get_var("show tables like '". $this->forms_table . "'") == $this->forms_table);
239
  }
240
 
241
  function stylesTableExists() {
242
  global $wpdb;
243
- return ($wpdb->get_var("show tables like '". $this->styles_table . "'") == $this->styles_table);
244
  }
245
 
246
  function fieldOptionsTableExists() {
247
  global $wpdb;
248
- return ($wpdb->get_var("show tables like '". $this->field_options_table . "'") == $this->field_options_table);
 
 
 
 
 
249
  }
250
 
251
  function updateForm($form, $fid) {
@@ -255,8 +255,9 @@ if (!class_exists('CustomContactFormsDB')) {
255
  if (!empty($test) and $test->id != $fid) return false;
256
  $form[form_slug] = $this->formatSlug($form[form_slug]);
257
  }
258
- $form = array_map(array(&$this, 'encodeOption'), $form);
259
- $wpdb->update($this->forms_table, $form, array('id' => $fid));
 
260
  return true;
261
  }
262
 
@@ -264,12 +265,13 @@ if (!class_exists('CustomContactFormsDB')) {
264
  global $wpdb;
265
  if (!empty($field[field_slug])) {
266
  $test = $this->selectField('', $this->formatSlug($field[field_slug]));
267
- if (!empty($test) and $test->id != $fid)
268
  return false;
269
  $field[field_slug] = $this->formatSlug($field[field_slug]);
270
  }
271
- $field = array_map(array(&$this, 'encodeOption'), $field);
272
- $wpdb->update($this->fields_table, $field, array('id' => $fid));
 
273
  return true;
274
  }
275
 
@@ -281,8 +283,9 @@ if (!class_exists('CustomContactFormsDB')) {
281
  return false;
282
  $option[option_slug] = $this->formatSlug($option[option_slug]);
283
  }
284
- $option = array_map(array(&$this, 'encodeOption'), $option);
285
- $wpdb->update($this->field_options_table, $option, array('id' => $oid));
 
286
  return true;
287
  }
288
 
@@ -293,18 +296,16 @@ if (!class_exists('CustomContactFormsDB')) {
293
  if (!empty($test) and $test->id != $sid) // if style_slug is different then make sure it is unique
294
  return false;
295
  $style[style_slug] = $this->formatSlug($style[style_slug]);
296
- foreach ($style as $key => $value) {
297
- if ($key != 'style_slug')
298
- $style[$key] = $this->formatStyle($this->encodeOption($value));
299
- }
300
- $wpdb->update($this->styles_table, $style, array('id' => $sid));
301
  return true;
302
  }
303
 
304
  function deleteForm($fid, $slug = NULL) {
305
  global $wpdb;
306
  $where_params = ($slug == NULL) ? "id='$fid'" : "form_slug='$slug'";
307
- $wpdb->query("DELETE FROM " . $this->forms_table . ' WHERE ' . $where_params);
308
  return true;
309
  }
310
 
@@ -312,15 +313,21 @@ if (!class_exists('CustomContactFormsDB')) {
312
  global $wpdb;
313
  $this->dettachFieldAll($fid);
314
  $where_params = ($slug == NULL) ? "id='$fid'" : "field_slug='$slug'";
315
- $wpdb->query("DELETE FROM " . $this->fields_table . ' WHERE ' . $where_params);
316
  return false;
317
  }
318
 
 
 
 
 
 
 
319
  function deleteStyle($sid, $slug = NULL) {
320
  global $wpdb;
321
  $this->dettachStyleAll($sid);
322
  $where_params = ($slug == NULL) ? "id='$sid'" : "style_slug='$slug'";
323
- $wpdb->query("DELETE FROM " . $this->styles_table . ' WHERE ' . $where_params);
324
  return true;
325
  }
326
 
@@ -328,56 +335,80 @@ if (!class_exists('CustomContactFormsDB')) {
328
  global $wpdb;
329
  $this->dettachFieldOptionAll($oid);
330
  $where_params = ($slug == NULL) ? "id='$oid'" : "option_slug='$slug'";
331
- $wpdb->query("DELETE FROM " . $this->field_options_table . ' WHERE ' . $where_params);
 
 
 
 
 
 
332
  return true;
333
  }
334
 
 
 
 
 
 
335
  function selectAllForms() {
336
  global $wpdb;
337
- return $wpdb->get_results("SELECT * FROM " . $this->forms_table . " ORDER BY form_slug ASC");
338
  }
339
 
340
  function selectAllFields() {
341
  global $wpdb;
342
- return $wpdb->get_results("SELECT * FROM " . $this->fields_table . " ORDER BY field_slug ASC");
343
  }
344
 
345
  function selectAllFieldOptions() {
346
  global $wpdb;
347
- return $wpdb->get_results("SELECT * FROM " . $this->field_options_table . " ORDER BY option_slug ASC");
348
  }
349
 
350
  function selectAllStyles() {
351
  global $wpdb;
352
- return $wpdb->get_results("SELECT * FROM " . $this->styles_table . " ORDER BY style_slug ASC");
 
 
 
 
 
353
  }
354
 
355
  function selectForm($fid, $form_slug = '') {
356
  global $wpdb;
357
  $extra = (!empty($form_slug)) ? " or form_slug = '$form_slug'" : '';
358
- return $wpdb->get_row("SELECT * FROM " . $this->forms_table . " WHERE id='$fid' $extra");
359
  }
360
 
361
  function selectStyle($sid, $style_slug = '') {
362
  global $wpdb;
363
  $extra = (!empty($style_slug)) ? " or style_slug = '$style_slug'" : '';
364
- return $wpdb->get_row("SELECT * FROM " . $this->styles_table . " WHERE id='$sid' $extra");
365
  }
366
 
367
  function selectField($fid, $field_slug = '') {
368
  global $wpdb;
369
  $extra = (!empty($field_slug)) ? " or field_slug = '$field_slug'" : '';
370
- return $wpdb->get_row("SELECT * FROM " . $this->fields_table . " WHERE id='$fid'" . $extra);
371
  }
372
 
373
  function selectFieldOption($oid, $option_slug = '') {
374
  global $wpdb;
375
  $extra = (!empty($option_slug)) ? " or option_slug = '$option_slug'" : '';
376
- return $wpdb->get_row("SELECT * FROM " . $this->field_options_table . " WHERE id='$oid'" . $extra);
 
 
 
 
 
377
  }
378
 
379
  function addFieldToForm($field_id, $form_id) {
380
- $form = $this->selectForm($form_id, '');
 
 
 
381
  $fields = $this->getAttachedFieldsArray($form_id);
382
  if (!in_array($field_id, $fields)) {
383
  $new_fields = $form->form_fields . $field_id . ',';
@@ -388,7 +419,10 @@ if (!class_exists('CustomContactFormsDB')) {
388
  }
389
 
390
  function addFieldOptionToField($option_id, $field_id) {
 
 
391
  $field = $this->selectField($field_id);
 
392
  $options = $this->getAttachedFieldOptionsArray($field_id);
393
  if (!in_array($option_id, $options)) {
394
  $new_options = $field->field_options . $option_id . ',';
@@ -480,6 +514,14 @@ if (!class_exists('CustomContactFormsDB')) {
480
  return (!empty($test));
481
  }
482
 
 
 
 
 
 
 
 
 
483
  function insertDefaultContent($overwrite = false) {
484
  $field_slugs = array('name' => 'ccf_name', 'message' => 'ccf_message',
485
  'website' => 'ccf_website', 'phone' => 'ccf_phone', 'google' => 'ccf_google',
@@ -505,7 +547,7 @@ if (!class_exists('CustomContactFormsDB')) {
505
  'field_maxlength' => 30, 'field_type' => 'Text');
506
  $google_field = array('field_slug' => $field_slugs[google], 'field_label' => 'Did you find my website through Google?',
507
  'field_required' => 0, 'field_instructions' => 'If you found my website through Google, check this box.',
508
- 'field_maxlength' => 0, 'field_type' => 'Checkbox');
509
  $contact_method_field = array('field_slug' => $field_slugs[contact_method], 'field_label' => 'How should we contact you?',
510
  'field_required' => 1, 'field_instructions' => 'By which method we should contact you?',
511
  'field_maxlength' => 0, 'field_type' => 'Dropdown');
6
  */
7
  if (!class_exists('CustomContactFormsDB')) {
8
  class CustomContactFormsDB {
 
 
 
 
9
  var $cache = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  function createTables() {
11
  global $wpdb;
12
  if(!$this->formsTableExists()) {
13
+ $sql1 = " CREATE TABLE `".CCF_FORMS_TABLE."` (
14
  `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
15
  `form_slug` VARCHAR( 100 ) NOT NULL ,
16
  `form_title` VARCHAR( 200 ) NOT NULL ,
22
  PRIMARY KEY ( `id` )
23
  ) ENGINE = MYISAM AUTO_INCREMENT=1 ";
24
  $wpdb->query($sql1);
25
+ } if(!$this->userDataTableExists()) {
26
+ $sql7 = " CREATE TABLE `".CCF_USER_DATA_TABLE."` (
27
+ `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
28
+ `data_time` INT( 11 ) NOT NULL DEFAULT '0',
29
+ `data_formid` INT( 11 ) NOT NULL ,
30
+ `data_formpage` VARCHAR ( 250 ) NOT NULL ,
31
+ `data_value` LONGTEXT NOT NULL ,
32
+ PRIMARY KEY ( `id` )
33
+ ) ENGINE = MYISAM AUTO_INCREMENT=1 ";
34
+ $wpdb->query($sql7);
35
  } if(!$this->fieldOptionsTableExists()) {
36
+ $sql5 = " CREATE TABLE `".CCF_FIELD_OPTIONS_TABLE."` (
37
  `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
38
  `option_slug` VARCHAR( 100 ) NOT NULL ,
39
  `option_label` VARCHAR( 200 ) NOT NULL ,
42
  ) ENGINE = MYISAM AUTO_INCREMENT=1 ";
43
  $wpdb->query($sql5);
44
  } if(!$this->fieldsTableExists()) {
45
+ $sql2 = "CREATE TABLE `".CCF_FIELDS_TABLE."` (
46
  `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
47
  `field_slug` VARCHAR( 50 ) NOT NULL ,
48
  `field_label` VARCHAR( 100 ) NOT NULL ,
54
  ) ENGINE = MYISAM AUTO_INCREMENT=1 ";
55
  $wpdb->query($sql2);
56
  } if(!$this->stylesTableExists()) {
57
+ $sql3 = "CREATE TABLE `".CCF_STYLES_TABLE."` (
 
58
  `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
59
  `style_slug` VARCHAR( 30 ) NOT NULL ,
60
  `input_width` VARCHAR( 10 ) NOT NULL DEFAULT '200px',
61
  `textarea_width` VARCHAR( 10 ) NOT NULL DEFAULT '200px',
62
  `textarea_height` VARCHAR( 10 ) NOT NULL DEFAULT '100px',
63
  `form_borderwidth` VARCHAR( 10 ) NOT NULL DEFAULT '0px',
64
+ `label_width` VARCHAR( 10 ) NOT NULL DEFAULT '200px',
65
+ `form_width` VARCHAR( 10 ) NOT NULL DEFAULT '100%',
66
+ `submit_width` VARCHAR( 10 ) NOT NULL DEFAULT 'auto',
67
+ `submit_height` VARCHAR( 10 ) NOT NULL DEFAULT '30px',
68
  `label_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1em',
69
  `title_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1.2em',
70
+ `field_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1.3em',
71
  `submit_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1.1em',
72
+ `field_bordercolor` VARCHAR( 10 ) NOT NULL DEFAULT '999999',
73
+ `form_borderstyle` VARCHAR( 30 ) NOT NULL DEFAULT 'none',
74
+ `form_bordercolor` VARCHAR( 20 ) NOT NULL DEFAULT '',
75
+ `field_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '333333',
76
+ `label_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '333333',
77
+ `title_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '333333',
78
+ `submit_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '333333',
79
+ `form_fontfamily` VARCHAR( 150 ) NOT NULL DEFAULT 'Tahoma, Verdana, Arial',
80
  PRIMARY KEY ( `id` )
81
  ) ENGINE = MYISAM AUTO_INCREMENT=1 ";
82
  $wpdb->query($sql3);
90
 
91
  function updateTables() {
92
  global $wpdb;
93
+ if (!$this->columnExists('user_field', CCF_FIELDS_TABLE))
94
+ $wpdb->query("ALTER TABLE `" . CCF_FIELDS_TABLE . "` ADD `user_field` INT( 1 ) NOT NULL DEFAULT '1'");
95
+ if (!$this->columnExists('form_style', CCF_FORMS_TABLE))
96
+ $wpdb->query("ALTER TABLE `" . CCF_FORMS_TABLE . "` ADD `form_style` INT( 10 ) NOT NULL DEFAULT '0'");
97
+ if (!$this->columnExists('form_email', CCF_FORMS_TABLE))
98
+ $wpdb->query("ALTER TABLE `" . CCF_FORMS_TABLE . "` ADD `form_email` VARCHAR( 50 ) NOT NULL");
99
+ if (!$this->columnExists('form_success_message', CCF_FORMS_TABLE))
100
+ $wpdb->query("ALTER TABLE `" . CCF_FORMS_TABLE . "` ADD `form_success_message` TEXT NOT NULL");
101
+ if (!$this->columnExists('form_thank_you_page', CCF_FORMS_TABLE))
102
+ $wpdb->query("ALTER TABLE `" . CCF_FORMS_TABLE . "` ADD `form_thank_you_page` VARCHAR ( 200 ) NOT NULL");
103
+ if (!$this->columnExists('field_backgroundcolor', CCF_STYLES_TABLE))
104
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `field_backgroundcolor` VARCHAR( 20 ) NOT NULL DEFAULT 'f5f5f5'");
105
+ if (!$this->columnExists('field_borderstyle', CCF_STYLES_TABLE))
106
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `field_borderstyle` VARCHAR( 20 ) NOT NULL DEFAULT 'solid'");
107
+ if (!$this->columnExists('form_success_title', CCF_FORMS_TABLE))
108
+ $wpdb->query("ALTER TABLE `" . CCF_FORMS_TABLE . "` ADD `form_success_title` VARCHAR( 150 ) NOT NULL DEFAULT 'Form Success!'");
109
+ if (!$this->columnExists('form_padding', CCF_STYLES_TABLE))
110
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `form_padding` VARCHAR( 20 ) NOT NULL DEFAULT '8px'");
111
+ if (!$this->columnExists('form_margin', CCF_STYLES_TABLE))
112
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `form_margin` VARCHAR( 20 ) NOT NULL DEFAULT '7px'");
113
+ if (!$this->columnExists('title_margin', CCF_STYLES_TABLE))
114
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `title_margin` VARCHAR( 20 ) NOT NULL DEFAULT '4px'");
115
+ if (!$this->columnExists('label_margin', CCF_STYLES_TABLE))
116
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `label_margin` VARCHAR( 20 ) NOT NULL DEFAULT '6px'");
117
+ if (!$this->columnExists('textarea_backgroundcolor', CCF_STYLES_TABLE))
118
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `textarea_backgroundcolor` VARCHAR( 20 ) NOT NULL DEFAULT 'f5f5f5'");
119
+ if (!$this->columnExists('success_popover_bordercolor', CCF_STYLES_TABLE))
120
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_bordercolor` VARCHAR( 20 ) NOT NULL DEFAULT 'efefef'");
121
+ if (!$this->columnExists('dropdown_width', CCF_STYLES_TABLE))
122
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `dropdown_width` VARCHAR( 20 ) NOT NULL DEFAULT 'auto'");
123
+ if (!$this->columnExists('success_popover_fontsize', CCF_STYLES_TABLE))
124
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '12px'");
125
+ if (!$this->columnExists('success_popover_title_fontsize', CCF_STYLES_TABLE))
126
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_title_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '1.3em'");
127
+ if (!$this->columnExists('success_popover_height', CCF_STYLES_TABLE))
128
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_height` VARCHAR( 20 ) NOT NULL DEFAULT '200px'");
129
+ if (!$this->columnExists('success_popover_fontcolor', CCF_STYLES_TABLE))
130
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '333333'");
131
+ if (!$this->columnExists('success_popover_title_fontcolor', CCF_STYLES_TABLE))
132
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_title_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '333333'");
133
+ if (!$this->columnExists('field_instructions', CCF_FIELDS_TABLE))
134
+ $wpdb->query("ALTER TABLE `" . CCF_FIELDS_TABLE . "` ADD `field_instructions` TEXT NOT NULL");
135
+ if (!$this->columnExists('field_options', CCF_FIELDS_TABLE))
136
+ $wpdb->query("ALTER TABLE `" . CCF_FIELDS_TABLE . "` ADD `field_options` VARCHAR( 300 ) NOT NULL");
137
+ if (!$this->columnExists('field_required', CCF_FIELDS_TABLE))
138
+ $wpdb->query("ALTER TABLE `" . CCF_FIELDS_TABLE . "` ADD `field_required` INT( 1 ) NOT NULL DEFAULT '0'");
139
+ if (!$this->columnExists('form_backgroundcolor', CCF_STYLES_TABLE))
140
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `form_backgroundcolor` VARCHAR( 20 ) NOT NULL DEFAULT 'ffffff'");
141
+ if (!$this->columnExists('field_borderround', CCF_STYLES_TABLE))
142
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `field_borderround` VARCHAR( 20 ) NOT NULL DEFAULT '6px'");
143
+ if (!$this->columnExists('tooltip_backgroundcolor', CCF_STYLES_TABLE))
144
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `tooltip_backgroundcolor` VARCHAR( 20 ) NOT NULL DEFAULT '000000'");
145
+ if (!$this->columnExists('tooltip_fontsize', CCF_STYLES_TABLE))
146
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `tooltip_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '12px'");
147
+ if (!$this->columnExists('tooltip_fontcolor', CCF_STYLES_TABLE))
148
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `tooltip_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT 'ffffff'");
149
+
150
  }
151
 
152
  function insertFixedFields() {
154
  $ishuman = array('field_slug' => 'ishuman', 'field_label' => 'Check if you are human.', 'field_type' => 'Checkbox', 'field_value' => '1', 'field_maxlength' => '0', 'user_field' => 0, 'field_instructions' => 'This helps us prevent spam.');
155
  $fixedEmail = array('field_slug' => 'fixedEmail', 'field_label' => 'Your Email', 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => 'Please enter your email address.');
156
  if (!$this->fieldSlugExists('captcha'))
157
+ $this->insertField($captcha, true);
158
  if (!$this->fieldSlugExists('ishuman'))
159
+ $this->insertField($ishuman, true);
160
  if (!$this->fieldSlugExists('fixedEmail'))
161
+ $this->insertField($fixedEmail, true);
 
162
  }
163
 
164
  /*function columnExists($column, $table) {
185
  global $wpdb;
186
  if (empty($form) or empty($form[form_slug]) or $this->formSlugExists($this->formatSlug($form[form_slug]))) return false;
187
  $form[form_slug] = $this->formatSlug($form[form_slug]);
188
+ foreach ($form as $key => $value)
189
+ $form[$key] = CustomContactFormsStatic::encodeOption($value);
190
+ $wpdb->insert(CCF_FORMS_TABLE, $form);
191
  return $wpdb->insert_id;
192
  }
193
 
194
+ function insertField($field, $fixed = false) {
195
  global $wpdb;
196
+ if (empty($field) or empty($field[field_slug]) or (array_key_exists($this->formatSlug($field[field_slug]), $GLOBALS[ccf_fixed_fields]) && !$fixed) or $this->fieldSlugExists($this->formatSlug($field[field_slug])))
197
+ return false;
198
  $field[field_slug] = $this->formatSlug($field[field_slug]);
199
+ foreach ($field as $key => $value)
200
+ $field[$key] = CustomContactFormsStatic::encodeOption($value);
201
+ $wpdb->insert(CCF_FIELDS_TABLE, $field);
 
 
202
  return $wpdb->insert_id;
203
  }
204
 
206
  global $wpdb;
207
  if (empty($option) or empty($option[option_slug]) or $this->fieldOptionsSlugExists($this->formatSlug($option[option_slug]))) return false;
208
  $option[option_slug] = $this->formatSlug($option[option_slug]);
209
+ foreach ($option as $key => $value)
210
+ $option[$key] = CustomContactFormsStatic::encodeOption($value);
211
+ $wpdb->insert(CCF_FIELD_OPTIONS_TABLE, $option);
212
  return $wpdb->insert_id;
213
  }
214
 
216
  global $wpdb;
217
  if (empty($style) or empty($style[style_slug]) or $this->styleSlugExists($this->formatSlug($style[style_slug]))) return false;
218
  $style[style_slug] = $this->formatSlug($style[style_slug]);
219
+ foreach ($style as $key => $value)
220
+ $style[$key] = CustomContactFormsStatic::encodeOption($value);
221
+ $wpdb->insert(CCF_STYLES_TABLE, $style);
 
 
222
  return $wpdb->insert_id;
223
  }
224
 
225
 
226
  function fieldsTableExists() {
227
  global $wpdb;
228
+ return ($wpdb->get_var("show tables like '". CCF_FIELDS_TABLE . "'") == CCF_FIELDS_TABLE);
229
  }
230
 
231
  function formsTableExists() {
232
  global $wpdb;
233
+ return ($wpdb->get_var("show tables like '". CCF_FORMS_TABLE . "'") == CCF_FORMS_TABLE);
234
  }
235
 
236
  function stylesTableExists() {
237
  global $wpdb;
238
+ return ($wpdb->get_var("show tables like '". CCF_STYLES_TABLE . "'") == CCF_STYLES_TABLE);
239
  }
240
 
241
  function fieldOptionsTableExists() {
242
  global $wpdb;
243
+ return ($wpdb->get_var("show tables like '". CCF_FIELD_OPTIONS_TABLE . "'") == CCF_FIELD_OPTIONS_TABLE);
244
+ }
245
+
246
+ function userDataTableExists() {
247
+ global $wpdb;
248
+ return ($wpdb->get_var("show tables like '". CCF_USER_DATA_TABLE . "'") == CCF_USER_DATA_TABLE);
249
  }
250
 
251
  function updateForm($form, $fid) {
255
  if (!empty($test) and $test->id != $fid) return false;
256
  $form[form_slug] = $this->formatSlug($form[form_slug]);
257
  }
258
+ foreach ($form as $key => $value)
259
+ $form[$key] = CustomContactFormsStatic::encodeOption($value);
260
+ $wpdb->update(CCF_FORMS_TABLE, $form, array('id' => $fid));
261
  return true;
262
  }
263
 
265
  global $wpdb;
266
  if (!empty($field[field_slug])) {
267
  $test = $this->selectField('', $this->formatSlug($field[field_slug]));
268
+ if ((!empty($test) and $test->id != $fid) or array_key_exists($this->formatSlug($field[field_slug]), $GLOBALS[ccf_fixed_fields]))
269
  return false;
270
  $field[field_slug] = $this->formatSlug($field[field_slug]);
271
  }
272
+ foreach ($field as $key => $value)
273
+ $field[$key] = CustomContactFormsStatic::encodeOption($value);
274
+ $wpdb->update(CCF_FIELDS_TABLE, $field, array('id' => $fid));
275
  return true;
276
  }
277
 
283
  return false;
284
  $option[option_slug] = $this->formatSlug($option[option_slug]);
285
  }
286
+ foreach ($option as $key => $value)
287
+ $option[$key] = CustomContactFormsStatic::encodeOption($value);
288
+ $wpdb->update(CCF_FIELD_OPTIONS_TABLE, $option, array('id' => $oid));
289
  return true;
290
  }
291
 
296
  if (!empty($test) and $test->id != $sid) // if style_slug is different then make sure it is unique
297
  return false;
298
  $style[style_slug] = $this->formatSlug($style[style_slug]);
299
+ foreach ($style as $key => $value)
300
+ $style[$key] = CustomContactFormsStatic::encodeOption($value);
301
+ $wpdb->update(CCF_STYLES_TABLE, $style, array('id' => $sid));
 
 
302
  return true;
303
  }
304
 
305
  function deleteForm($fid, $slug = NULL) {
306
  global $wpdb;
307
  $where_params = ($slug == NULL) ? "id='$fid'" : "form_slug='$slug'";
308
+ $wpdb->query("DELETE FROM " . CCF_FORMS_TABLE . ' WHERE ' . $where_params);
309
  return true;
310
  }
311
 
313
  global $wpdb;
314
  $this->dettachFieldAll($fid);
315
  $where_params = ($slug == NULL) ? "id='$fid'" : "field_slug='$slug'";
316
+ $wpdb->query("DELETE FROM " . CCF_FIELDS_TABLE . ' WHERE ' . $where_params);
317
  return false;
318
  }
319
 
320
+ function query($query) {
321
+ global $wpdb;
322
+ if (empty($query)) return false;
323
+ return ($wpdb->query($query) != false) ? $wpdb->insert_id : false;
324
+ }
325
+
326
  function deleteStyle($sid, $slug = NULL) {
327
  global $wpdb;
328
  $this->dettachStyleAll($sid);
329
  $where_params = ($slug == NULL) ? "id='$sid'" : "style_slug='$slug'";
330
+ $wpdb->query("DELETE FROM " . CCF_STYLES_TABLE . ' WHERE ' . $where_params);
331
  return true;
332
  }
333
 
335
  global $wpdb;
336
  $this->dettachFieldOptionAll($oid);
337
  $where_params = ($slug == NULL) ? "id='$oid'" : "option_slug='$slug'";
338
+ $wpdb->query("DELETE FROM " . CCF_FIELD_OPTIONS_TABLE . ' WHERE ' . $where_params);
339
+ return true;
340
+ }
341
+
342
+ function deleteUserData($uid) {
343
+ global $wpdb;
344
+ $wpdb->query("DELETE FROM " . CCF_USER_DATA_TABLE . " WHERE id='$uid'");
345
  return true;
346
  }
347
 
348
+ function selectAllFromTable($table, $output_type = OBJECT) {
349
+ global $wpdb;
350
+ return $wpdb->get_results('SELECT * FROM ' . $table, $output_type);
351
+ }
352
+
353
  function selectAllForms() {
354
  global $wpdb;
355
+ return $wpdb->get_results("SELECT * FROM " . CCF_FORMS_TABLE . " ORDER BY form_slug ASC");
356
  }
357
 
358
  function selectAllFields() {
359
  global $wpdb;
360
+ return $wpdb->get_results("SELECT * FROM " . CCF_FIELDS_TABLE . " ORDER BY field_slug ASC");
361
  }
362
 
363
  function selectAllFieldOptions() {
364
  global $wpdb;
365
+ return $wpdb->get_results("SELECT * FROM " . CCF_FIELD_OPTIONS_TABLE . " ORDER BY option_slug ASC");
366
  }
367
 
368
  function selectAllStyles() {
369
  global $wpdb;
370
+ return $wpdb->get_results("SELECT * FROM " . CCF_STYLES_TABLE . " ORDER BY style_slug ASC");
371
+ }
372
+
373
+ function selectAllUserData() {
374
+ global $wpdb;
375
+ return $wpdb->get_results("SELECT * FROM " . CCF_USER_DATA_TABLE . " ORDER BY data_time DESC");
376
  }
377
 
378
  function selectForm($fid, $form_slug = '') {
379
  global $wpdb;
380
  $extra = (!empty($form_slug)) ? " or form_slug = '$form_slug'" : '';
381
+ return $wpdb->get_row("SELECT * FROM " . CCF_FORMS_TABLE . " WHERE id='$fid' $extra");
382
  }
383
 
384
  function selectStyle($sid, $style_slug = '') {
385
  global $wpdb;
386
  $extra = (!empty($style_slug)) ? " or style_slug = '$style_slug'" : '';
387
+ return $wpdb->get_row("SELECT * FROM " . CCF_STYLES_TABLE . " WHERE id='$sid' $extra");
388
  }
389
 
390
  function selectField($fid, $field_slug = '') {
391
  global $wpdb;
392
  $extra = (!empty($field_slug)) ? " or field_slug = '$field_slug'" : '';
393
+ return $wpdb->get_row("SELECT * FROM " . CCF_FIELDS_TABLE . " WHERE id='$fid'" . $extra);
394
  }
395
 
396
  function selectFieldOption($oid, $option_slug = '') {
397
  global $wpdb;
398
  $extra = (!empty($option_slug)) ? " or option_slug = '$option_slug'" : '';
399
+ return $wpdb->get_row("SELECT * FROM " . CCF_FIELD_OPTIONS_TABLE . " WHERE id='$oid'" . $extra);
400
+ }
401
+
402
+ function selectUserData($uid) {
403
+ global $wpdb;
404
+ return $wpdb->get_row("SELECT * FROM " . CCF_USER_DATA_TABLE . " WHERE id='$uid'");
405
  }
406
 
407
  function addFieldToForm($field_id, $form_id) {
408
+ $field = $this->selectField($field_id);
409
+ if (empty($field)) return false;
410
+ $form = $this->selectForm($form_id);
411
+ if (empty($form)) return false;
412
  $fields = $this->getAttachedFieldsArray($form_id);
413
  if (!in_array($field_id, $fields)) {
414
  $new_fields = $form->form_fields . $field_id . ',';
419
  }
420
 
421
  function addFieldOptionToField($option_id, $field_id) {
422
+ $option = $this->selectFieldOption($option_id);
423
+ if (empty($option)) return false;
424
  $field = $this->selectField($field_id);
425
+ if (empty($field)) return false;
426
  $options = $this->getAttachedFieldOptionsArray($field_id);
427
  if (!in_array($option_id, $options)) {
428
  $new_options = $field->field_options . $option_id . ',';
514
  return (!empty($test));
515
  }
516
 
517
+ function insertUserData($data_object) {
518
+ global $wpdb;
519
+ //$wpdb->show_errors();
520
+ $wpdb->insert(CCF_USER_DATA_TABLE, array('data_time' => $data_object->getDataTime(), 'data_formid' => $data_object->getFormID(), 'data_formpage' => $data_object->getFormPage(), 'data_value' => $data_object->getEncodedData()));
521
+ //$wpdb->print_error();
522
+ return $wpdb->insert_id;
523
+ }
524
+
525
  function insertDefaultContent($overwrite = false) {
526
  $field_slugs = array('name' => 'ccf_name', 'message' => 'ccf_message',
527
  'website' => 'ccf_website', 'phone' => 'ccf_phone', 'google' => 'ccf_google',
547
  'field_maxlength' => 30, 'field_type' => 'Text');
548
  $google_field = array('field_slug' => $field_slugs[google], 'field_label' => 'Did you find my website through Google?',
549
  'field_required' => 0, 'field_instructions' => 'If you found my website through Google, check this box.',
550
+ 'field_maxlength' => 0, 'field_type' => 'Checkbox', 'field_value' => 'Yes');
551
  $contact_method_field = array('field_slug' => $field_slugs[contact_method], 'field_label' => 'How should we contact you?',
552
  'field_required' => 1, 'field_instructions' => 'By which method we should contact you?',
553
  'field_maxlength' => 0, 'field_type' => 'Dropdown');
custom-contact-forms-export.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Custom Contact Forms Plugin
4
+ By Taylor Lovett - http://www.taylorlovett.com
5
+ Plugin URL: http://www.taylorlovett.com/wordpress-plugins
6
+ */
7
+ class CustomContactFormsExport extends CustomContactFormsDB {
8
+
9
+ var $last_export_content;
10
+ var $last_export_file;
11
+ var $exports_path;
12
+ var $option_name;
13
+
14
+ function CustomContactFormsExport($option_name) {
15
+ $this->exports_path = CCF_BASE_PATH . 'export/';
16
+ $this->option_name = $option_name;
17
+ }
18
+
19
+ function exportAll($backup_options = true) {
20
+ $out = '';
21
+ foreach ($GLOBALS[ccf_tables_array] as $table)
22
+ $out .= $this->exportTable($table);
23
+ if ($backup_options) {
24
+ $out .= "\n\n### BEGIN WP Options Table Query\n\n" . $this->generateOptionsUpdateQuery();
25
+ $out .= "\n\n### END WP Options Table Query\n";
26
+ }
27
+ $this->last_export_content = $out;
28
+ return $out;
29
+ }
30
+
31
+ function exportTable($table) {
32
+ $out = '';
33
+ $data = parent::selectAllFromTable($table, ARRAY_A);
34
+ foreach ($data as $row) {
35
+ $no_insert = 0;
36
+ $cols = '';
37
+ $vals = '';
38
+ foreach ($row as $k => $v) {
39
+ if (array_key_exists($k, $GLOBALS[ccf_fixed_fields])) {
40
+ $no_insert = 1;
41
+ break;
42
+ }
43
+ $v = str_replace(';', '\;', $v);
44
+ $cols .= "$k, ";
45
+ $vals .= "'$v', ";
46
+ } if ($no_insert != 1) {
47
+ $vals = substr($vals, 0, strlen($vals) - 2);
48
+ $cols = substr($cols, 0, strlen($cols) - 2);
49
+ $statement = 'INSERT INTO `' . $table . '` (' . $cols . ') VALUES (' . CustomContactFormsStatic::escapeSemiColons($vals) . ');';
50
+ $statement = $statement . "\n\n";
51
+ $out .= $statement;
52
+ }
53
+ }
54
+ return $out;
55
+ }
56
+
57
+ function exportToFile($export_content = NULL) {
58
+ if ($export_content == NULL) $export_content = $this->getLastExportContent();
59
+ $export_file = "ccf-export-" . strtolower(date('j-M-Y--h-i-s')) . '.sql';
60
+ if (($export_handle = @fopen($this->getExportsPath() . $export_file, 'w')) == false)
61
+ return false;
62
+ fwrite($export_handle, $export_content);
63
+ fclose($export_handle);
64
+ $this->last_export_file = $export_file;
65
+ return $export_file;
66
+ }
67
+
68
+ function getExportsPath() {
69
+ return $this->exports_path;
70
+ }
71
+
72
+ function getLastExportContent() {
73
+ return $this->last_export_content;
74
+ }
75
+
76
+ function importFromFile($file) {
77
+ $path = CCF_BASE_PATH. 'import/';
78
+ $file_name = basename(time() . $file['name']);
79
+ if (move_uploaded_file($file['tmp_name'], $path . $file_name)) {
80
+ $data = file_get_contents($path . $file_name);
81
+ $commands = $this->parseMultiQuery($data);
82
+ $errors = 0;
83
+ foreach($commands as $command) {
84
+ if (!parent::query($command)) $errors++;
85
+ }
86
+ return ($errors == 0) ? true : $errors;
87
+ }
88
+ return false;
89
+ }
90
+
91
+ function parseMultiQuery($sql, $unescape_semicolons = true, $replace_table_prefix = true) {
92
+ if (empty($sql)) return false;
93
+ $prefix = CustomContactFormsStatic::getWPTablePrefix();
94
+ $commands = preg_split('/\);[\n\r]*/ims', $sql);
95
+ foreach ($commands as $k => $v) {
96
+ $commands[$k] = $v . ')';
97
+ if ($unescape_semicolons)
98
+ $commands[$k] = CustomContactFormsStatic::unescapeSemiColons($commands[$k]);
99
+ if ($replace_table_prefix)
100
+ $commands[$k] = preg_replace('/^INSERT INTO `.+?customcontactforms_(.+?)`/is', 'INSERT INTO `' . $prefix . 'customcontactforms_$1`', $commands[$k]);
101
+ }
102
+ array_pop($commands);
103
+ return $commands;
104
+ }
105
+
106
+ function generateOptionsUpdateQuery($option_name = NULL) {
107
+ if ($option_name == NULL) $option_name = $this->option_name;
108
+ $prefix = CustomContactFormsStatic::getWPTablePrefix();
109
+ $options = serialize(get_option($option_name));
110
+ return 'UPDATE `' . $prefix . "options` SET `option_value`='$options' WHERE `option_name`='$option_name';";
111
+ }
112
+ }
113
+ ?>
custom-contact-forms-mailer.php CHANGED
@@ -24,7 +24,7 @@ if (!class_exists('CustomContactFormsMailer')) {
24
  }
25
 
26
  function send(){
27
- $reply = ($this->reply_to != NULL) ? $this->reply_to : $this->from;
28
  $this->addHeader('From: '.$this->from."\r\n");
29
  $this->addHeader('Reply-To: '.$reply."\r\n");
30
  $this->addHeader('Return-Path: '.$this->from."\r\n");
24
  }
25
 
26
  function send(){
27
+ $reply = ($this->reply_to != NULL) ? $this->reply_to : $this->from;
28
  $this->addHeader('From: '.$this->from."\r\n");
29
  $this->addHeader('Reply-To: '.$reply."\r\n");
30
  $this->addHeader('Return-Path: '.$this->from."\r\n");
custom-contact-forms-popover.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- require_once('custom-contact-forms.php');
3
- $customcontact = new CustomContactForms();
4
- ?>
5
- <html>
6
- <body>
7
- test
8
- </body>
9
- </html>
 
 
 
 
 
 
 
 
 
custom-contact-forms-static.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Custom Contact Forms Plugin
4
+ By Taylor Lovett - http://www.taylorlovett.com
5
+ Plugin URL: http://www.taylorlovett.com/wordpress-plugins
6
+ */
7
+ if (!class_exists('CustomContactFormsStatic')) {
8
+ class CustomContactFormsStatic {
9
+ function encodeOption($option) {
10
+ return htmlspecialchars(stripslashes($option), ENT_QUOTES);
11
+ }
12
+
13
+ function getWPTablePrefix() {
14
+ global $wpdb;
15
+ return $wpdb->prefix;
16
+ }
17
+
18
+ function encodeOptionArray($option_array) {
19
+ foreach ($option_array as $option) {
20
+ if (is_array($option))
21
+ $option = CustomContactFormsStatic::encodeOptionArray($option);
22
+ else
23
+ $option = CustomContactFormsStatic::encodeOption($option);
24
+ }
25
+ return $option_array;
26
+ }
27
+
28
+ function decodeOption($option, $strip_slashes = 1, $decode_html_chars = 1) {
29
+ if ($strip_slashes == 1) $option = stripslashes($option);
30
+ if ($decode_html_chars == 1) $option = html_entity_decode($option);
31
+ return $option;
32
+ }
33
+
34
+ function strstrb($h, $n){
35
+ return array_shift(explode($n, $h, 2));
36
+ }
37
+
38
+ function redirect($url) {
39
+ header('Location: ' . $url);
40
+ }
41
+
42
+ function definePluginConstants() {
43
+ $prefix = CustomContactFormsStatic::getWPTablePrefix();
44
+ define('CCF_FORMS_TABLE', $prefix . 'customcontactforms_forms');
45
+ define('CCF_FIELDS_TABLE', $prefix . 'customcontactforms_fields');
46
+ define('CCF_STYLES_TABLE', $prefix . 'customcontactforms_styles');
47
+ define('CCF_USER_DATA_TABLE', $prefix . 'customcontactforms_user_data');
48
+ define('CCF_FIELD_OPTIONS_TABLE', $prefix . 'customcontactforms_field_options');
49
+ define('CCF_BASE_PATH', ABSPATH . 'wp-content/plugins/custom-contact-forms/');
50
+ $GLOBALS[ccf_tables_array] = array(CCF_FORMS_TABLE, CCF_FIELDS_TABLE, CCF_STYLES_TABLE, CCF_USER_DATA_TABLE, CCF_FIELD_OPTIONS_TABLE);
51
+ $GLOBALS[ccf_fixed_fields] = array('customcontactforms_submit' => '',
52
+ 'fid' => '',
53
+ 'fixedEmail' => 'Use this field if you want the plugin to throw an error on fake emails.',
54
+ 'form_page' => '',
55
+ 'captcha' => 'This field requires users to type numbers in an image preventing spam.',
56
+ 'ishuman' => 'This field requires users to check a box to prove they aren\'t a spam bot.'
57
+ );
58
+ }
59
+
60
+ function escapeSemiColons($value) {
61
+ return str_replace(';', '\;', $value);
62
+ }
63
+
64
+ function unescapeSemiColons($value) {
65
+ return str_replace('\;', ';', $value);
66
+ }
67
+ }
68
+ }
69
+ ?>
custom-contact-forms-user-data.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Custom Contact Forms Plugin
4
+ By Taylor Lovett - http://www.taylorlovett.com
5
+ Plugin URL: http://www.taylorlovett.com/wordpress-plugins
6
+ */
7
+ if (!class_exists('CustomContactFormsUserData')) {
8
+ class CustomContactFormsUserData {
9
+ var $form_id = NULL;
10
+ var $data_time = NULL;
11
+ var $data_array = NULL;
12
+ var $encoded_data = NULL;
13
+ var $form_page = NULL;
14
+ function CustomContactFormsUserData($param_array) {
15
+ if (isset($param_array[form_id]))
16
+ $this->setFormID($param_array[form_id]);
17
+
18
+ if (isset($param_array[data_time]))
19
+ $this->setDataTime($param_array[data_time]);
20
+
21
+ if (isset($param_array[form_page]))
22
+ $this->setFormPage($param_array[form_page]);
23
+
24
+ if (isset($param_array[data_array])) {
25
+ $this->setDataArray($param_array[data_array]);
26
+ $this->encodeData();
27
+ }
28
+
29
+ if (isset($param_array[encoded_data])) {
30
+ $this->setEncodedData($param_array[encoded_data]);
31
+ $this->decodeData();
32
+ }
33
+ }
34
+
35
+ function encodeData() {
36
+ $data_array = $this->getDataArray();
37
+ $encoded_data = '';
38
+ foreach ($data_array as $key => $value) {
39
+ $key = CustomContactFormsStatic::encodeOption($key);
40
+ $value = CustomContactFormsStatic::encodeOption($value);
41
+ $encoded_data .= 's:'.strlen($key).':"'.$key.'";';
42
+ $encoded_data .= 's:'.strlen($value).':"'.$value.'";';
43
+ }
44
+ $this->setEncodedData($encoded_data);
45
+ }
46
+
47
+
48
+ function decodeData() {
49
+ $data = $this->getEncodedData();
50
+ $data_array = array();
51
+ while (!empty($data)) {
52
+ $key_length = CustomContactFormsStatic::strstrb($data, ':"');
53
+ $key_length = str_replace('s:', '', $key_length);
54
+ $piece_length = 6 + strlen($key_length) + (int) $key_length;
55
+ $key = substr($data, (4 + strlen($key_length)), (int) $key_length);
56
+ $data = substr($data, $piece_length);
57
+ $value_length = CustomContactFormsStatic::strstrb($data, ':"');
58
+ $value_length = str_replace('s:', '', $value_length);
59
+ $piece_length = 6 + strlen($value_length) + (int) $value_length;
60
+ $value = substr($data, (4 + strlen($value_length)), (int) $value_length);
61
+ $data = substr($data, $piece_length);
62
+ $data_array[$key] = $value;
63
+ }
64
+ $this->setDataArray($data_array);
65
+ }
66
+
67
+ /* Getters and Setters */
68
+ function setFormID($form_id) { $this->form_id = $form_id; }
69
+ function setFormPage($form_page) { $this->form_page = $form_page; }
70
+ function setDataTime($data_time) { $this->data_time = $data_time; }
71
+ function setDataArray($data_array) { $this->data_array = $data_array; }
72
+ function setEncodedData($encoded_data) { $this->encoded_data = $encoded_data; }
73
+ function getFormID() { return $this->form_id; }
74
+ function getFormPage() { return $this->form_page; }
75
+ function getDataTime() { return $this->data_time; }
76
+ function getDataArray() { return $this->data_array; }
77
+ function getEncodedData() { return $this->encoded_data; }
78
+
79
+ /* Debug function */
80
+
81
+ function printAll() {
82
+ ?><div style="margin-left:30px;">
83
+ <b>BEGIN User Data Object</b><br />
84
+ ---------------------------------<br />
85
+ Form ID: <?php echo $this->getFormID(); ?><br />
86
+ Form Page: <?php echo $this->getFormPage(); ?><br />
87
+ Data Time: <?php echo $this->getDataTime(); ?><br />
88
+ Data Array: <?php print_r($this->getDataArray()); ?><br />
89
+ Encoded Array: <?php print_r($this->getEncodedData()); ?><br />
90
+ ---------------------------------<br />
91
+ <b>END User Data Object</b></div>
92
+ <?php
93
+ }
94
+ }
95
+ }
96
+ ?>
custom-contact-forms.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
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.9
7
  Author: Taylor Lovett
8
  Author URI: http://www.taylorlovett.com
9
  */
@@ -21,26 +21,25 @@
21
  You should have received a copy of the GNU General Public License
22
  along with this program. If not, see <http://www.gnu.org/licenses/>.
23
  */
 
 
24
  require_once('custom-contact-forms-db.php');
25
  if (!class_exists('CustomContactForms')) {
26
  class CustomContactForms extends CustomContactFormsDB {
27
  var $adminOptionsName = 'customContactFormsAdminOptions';
28
- var $version = '3.5.1';
29
- var $form_errors;
30
  var $error_return;
31
  var $current_form;
32
  var $current_thank_you_message;
33
- var $fixed_fields = array('customcontactforms_submit' => '',
34
- 'fid' => '',
35
- 'fixedEmail' => 'Use this field if you want the plugin to throw an error on fake emails.',
36
- 'form_page' => '',
37
- 'captcha' => 'This field requires users to type numbers in an image preventing spam.',
38
- 'ishuman' => 'This field requires users to check a box to prove they aren\'t a spam bot.'
39
- );
40
 
41
  function CustomContactForms() {
42
- parent::CustomContactFormsDB();
43
- $this->form_errors = array();
 
 
 
 
44
  }
45
 
46
  function activatePlugin() {
@@ -56,7 +55,7 @@ if (!class_exists('CustomContactForms')) {
56
  $admin_email = get_option('admin_email');
57
  $customcontactAdminOptions = array('show_widget_home' => 1, 'show_widget_pages' => 1, 'show_widget_singles' => 1, 'show_widget_categories' => 1, 'show_widget_archives' => 1, 'default_to_email' => $admin_email, 'default_from_email' => $admin_email, 'default_form_subject' => 'Someone Filled Out Your Contact Form!',
58
  'remember_field_values' => 0, 'author_link' => 1, 'enable_widget_tooltips' => 1, 'wp_mail_function' => 1, 'form_success_message_title' => 'Form Success!', 'form_success_message' => 'Thank you for filling out our web form. We will get back to you ASAP.', 'enable_jquery' => 1, 'code_type' => 'XHTML',
59
- 'show_install_popover' => 0); // default general settings
60
  $customcontactOptions = get_option($this->adminOptionsName);
61
  if (!empty($customcontactOptions)) {
62
  foreach ($customcontactOptions as $key => $option)
@@ -69,33 +68,57 @@ if (!class_exists('CustomContactForms')) {
69
  if (!is_admin()) {
70
  $this->startSession();
71
  $this->processForms();
 
 
72
  }
73
  }
74
 
75
- function insertFrontEndStyles() {
76
- if (!is_admin()) {
77
- wp_register_style('CCFStandardsCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/custom-contact-forms-standards.css');
78
- wp_register_style('CCFFormsCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/custom-contact-forms.css');
79
- wp_enqueue_style('CCFStandardsCSS');
80
- wp_enqueue_style('CCFFormsCSS');
 
81
  }
82
  }
83
 
 
 
 
 
 
 
 
84
  function insertBackEndStyles() {
85
- wp_register_style('CCFStandardsCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/custom-contact-forms-standards.css');
86
- wp_register_style('CCFAdminCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/custom-contact-forms-admin.css');
87
- wp_register_style('CCFColorPickerCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/colorpicker.css');
88
  wp_enqueue_style('CCFStandardsCSS');
89
  wp_enqueue_style('CCFAdminCSS');
90
  wp_enqueue_style('CCFColorPickerCSS');
91
  }
92
 
93
  function insertAdminScripts() {
94
- wp_enqueue_script('ccf-main', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/custom-contact-forms-admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'/*, 'jquery-ui-draggable', 'jquery-ui-resizable', 'jquery-ui-dialog'*/), '1.0');
95
- wp_enqueue_script('ccf-colorpicker', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/colorpicker.js');
96
- wp_enqueue_script('ccf-eye', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/eye.js');
97
- wp_enqueue_script('ccf-utils', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/utils.js');
98
- wp_enqueue_script('ccf-layout', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/layout.js?ver=1.0.2');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
 
101
  function insertFrontEndScripts() {
@@ -103,12 +126,8 @@ if (!class_exists('CustomContactForms')) {
103
  $admin_options = $this->getAdminOptions();
104
  if ($admin_options[enable_jquery] == 1) {
105
  wp_enqueue_script('jquery');
106
- wp_enqueue_script('jquery-tools', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/jquery.tools.min.js');
107
- //wp_enqueue_script('jquery-ui-position', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/jquery.ui.position.js');
108
- //wp_enqueue_script('jquery-ui-widget', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/jquery.ui.widget.js');
109
- //wp_enqueue_script('jquery-bgiframe', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/jquery.bgiframe-2.1.1.js');
110
- wp_enqueue_script('ccf-main', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/custom-contact-forms.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs', 'jquery-ui-resizable'/*, 'jquery-ui-draggable', 'jquery-ui-dialog'*/), '1.0');
111
- //jquery-ui-position
112
  }
113
  }
114
  }
@@ -133,15 +152,25 @@ 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 imagine. CCF is very user friendly but with possibilities comes complexity. It is recommend that you click the button below to create 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 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" />
140
  </form>
141
- <p>Below is a basic usage outline of the four pillars of this plugin: fields, field options, styles, and forms. Also explained below is the Custom HTML Feature which allows you to write the form HTML yourself using the plugin simply as a form processor; this is great if you are a web developer with HTML experience.</p>
142
  <ul>
143
  <li>
144
- <h3>Fields</h3>
145
  <p>Fields are the actual input boxes in which users enter their information. There are six types of fields that you can attach to your forms.</p>
146
  <ul>
147
  <li><span>Text:</span>
@@ -170,7 +199,7 @@ if (!class_exists('CustomContactForms')) {
170
  <p>The last important thing related to fields are <span>Fixed Fields</span>. Fixed Fields are special fields that come already created within the plugin such as the captcha spam blocker and email field. Fixed Fields do special things that you wouldn't be able to accomplish with normally; they cannot be deleted or created. If you use the fixedEmail field, as opposed to creating your own email field. the users email will be checked to make sure it is valid, if it isn't a form error will be displayed.</p>
171
  </li>
172
  <li>
173
- <h3>Field Options</h3>
174
  <p>In the field section above, look at the radio or dropdown fields. See how they have multiple options within the field? Those are called Field Options. Field Options have their own manager. There are only three things you must fill in to create a field option.</p>
175
  <ul>
176
  <li><span class="red">*</span> <span>Slug:</span> Used to identify the field option, solely for admin purposes; must be unique, and contain only letters, numbers, and underscores. Example: "slug_one".</li>
@@ -180,7 +209,7 @@ if (!class_exists('CustomContactForms')) {
180
  <p>Once you create field options, you can attach them (in the field manager) to radio and dropdown fields (that are already created). It is important to remember that after you create a dropdown or radio field, they will not work until you attach one or more field options.</p>
181
  </li>
182
  <li>
183
- <h3>Forms</h3>
184
  <p>Forms bring everything together. Each form you create in the form manager shows a code to display that form in posts/pages as well as theme files. The post/page form display code looks like: [customcontact id=FORMID]. There are a number of parameters that you can fill out when creating and managing each of your forms.</p>
185
  <ul>
186
  <li><span class="red">*</span> <span>Slug:</span> A slug is simply a way to identify your form. It can only contain underscores, letters, and numbers and must be unique. Example "my_contact_form"</li>
@@ -200,13 +229,13 @@ if (!class_exists('CustomContactForms')) {
200
  <div class="ccf-success-popover-example"></div>
201
  </li>
202
  <li>
203
- <h3>Style Manager</h3>
204
  <p>The style manager allows you to customize the appearance of forms without any knowledge of CSS. There are a ton of parameters you can fill out with each style and all of them are pretty self-explanitory. After you create a style, you need to go to the form manager and set the form style to the new style you created (the slug will be what shows in the "Form Style" dropdown).</p>
205
  <p>The image below will help you better understand how each style option will change your forms.</p>
206
  <div class="ccf-style-example"></div>
207
  </li>
208
  <li>
209
- <h3>Custom HTML Forms Feature (advanced)</h3>
210
  <p>If you know HTML and simply want to use this plugin to process form requests, this feature is for you. The following HTML is a the framework to which you must adhere. In order for your form to work you MUST do the following:</p>
211
  <ul>
212
  <li>Keep the form action/method the same (yes the action is supposed to be empty).</li>
@@ -215,6 +244,17 @@ if (!class_exists('CustomContactForms')) {
215
  </ul>
216
  <p>Just to be clear, you don't edit the code in the Custom HTML Forms feature within the admin panel. Instead, you copy the code in to the page, post, or theme file you want to display a form, then edit the code to look how you want following the guidelines provided above.</p>
217
  </li>
 
 
 
 
 
 
 
 
 
 
 
218
  </ul>
219
  </div>
220
  </div>
@@ -247,7 +287,9 @@ if (!class_exists('CustomContactForms')) {
247
  $admin_options[show_widget_archives] = $_POST[show_widget_archives];
248
  $admin_options[show_widget_home] = $_POST[show_widget_home];
249
  $admin_options[custom_thank_you] = $_POST[custom_thank_you];
 
250
  $admin_options[author_link] = $_POST[author_link];
 
251
  $admin_options[enable_jquery] = $_POST[enable_jquery];
252
  $admin_options[code_type] = $_POST[code_type];
253
  $admin_options[form_success_message] = $_POST[form_success_message];
@@ -267,13 +309,13 @@ if (!class_exists('CustomContactForms')) {
267
  } elseif ($_POST[form_edit]) {
268
  parent::updateForm($_POST[form], $_POST[fid]);
269
  } elseif ($_POST[form_add_field]) {
270
- parent::addFieldToForm($_POST[field_id], $_POST[fid]);
271
  } elseif ($_POST[attach_field_option]) {
272
- parent::addFieldOptionToField($_POST[attach_option_id], $_POST[fid]);
273
  } elseif ($_POST[dettach_field]) {
274
- parent::dettachField($_POST[dettach_field_id], $_POST[fid]);
275
  } elseif ($_POST[dettach_field_option]) {
276
- parent::dettachFieldOption($_POST[dettach_option_id], $_POST[fid]);
277
  } elseif ($_POST[style_create]) {
278
  parent::insertStyle($_POST[style]);
279
  } elseif ($_POST[style_edit]) {
@@ -289,7 +331,74 @@ if (!class_exists('CustomContactForms')) {
289
  parent::updateFieldOption($_POST[option], $_POST[oid]);
290
  } elseif ($_POST[create_field_option]) {
291
  parent::insertFieldOption($_POST[option]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  }
 
293
  $styles = parent::selectAllStyles();
294
  $style_options = '<option value="0">Default</option>';
295
  foreach ($styles as $style)
@@ -306,16 +415,17 @@ if (!class_exists('CustomContactForms')) {
306
  <li><a href="#manage-fields">Manage Fields</a></li>
307
  <li><a href="#manage-fixed-fields">Manage Fixed Fields</a></li>
308
  <li><a href="#manage-forms">Manage Forms</a></li>
 
309
  <li><a href="#create-styles">Create Styles</a></li>
310
  <li><a href="#manage-styles">Manage Styles</a></li>
311
  <li><a href="#manage-field-options">Manage Field Options</a></li>
312
  <li><a href="#contact-author">Suggest a Feature</a></li>
313
  <li><a href="#contact-author">Bug Report</a></li>
314
- <li><a href="#custom-html">Custom HTML Forms (New!)</a></li>
 
315
  <li class="last"><a href="#plugin-news">Plugin News</a></li>
316
  </ul>
317
  <a class="rate-me" href="http://wordpress.org/extend/plugins/custom-contact-forms" title="Rate This Plugin">We need your help to continue development! Please <span>rate this plugin</span> to show your support.</a>
318
-
319
  <a name="create-fields"></a>
320
  <div id="create-fields" class="postbox">
321
  <h3 class="hndle"><span>Create A Form Field</span></h3>
@@ -324,7 +434,7 @@ if (!class_exists('CustomContactForms')) {
324
  <ul>
325
  <li>
326
  <label for="field_slug">* Slug (Name):</label>
327
- <input name="field[field_slug]" type="text" maxlength="50" /><br />
328
  (A slug is simply a way to identify your field. It can only contain underscores, letters, and numbers and must be unique.)</li>
329
  <li>
330
  <label for="field_label">Field Label:</label>
@@ -452,7 +562,7 @@ if (!class_exists('CustomContactForms')) {
452
 
453
  ?>
454
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
455
- <tr<?php if ($z % 2 == 1) echo ' class="evenrow"'; ?> style="border-bottom">
456
 
457
  <td><input type="text" name="field[field_slug]" class="width100" maxlength="50" value="<?php echo $fields[$i]->field_slug; ?>" /></td>
458
  <td><input type="text" name="field[field_label]" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" /></td>
@@ -468,14 +578,15 @@ if (!class_exists('CustomContactForms')) {
468
  <input type="text" class="width50" name="field[field_maxlength]" value="<?php echo $fields[$i]->field_maxlength; ?>" />
469
  <?php } ?>
470
  </td>
471
- <td><input type="hidden" name="fid" value="<?php echo $fields[$i]->id; ?>" />
 
472
  <span class="fields-options-expand"></span>
473
- <input type="submit" name="field_edit" value="Save" />
474
- <input type="submit" name="field_delete" class="delete_button" value="Delete" /></td>
475
 
476
  </tr>
477
  <tr<?php if ($z % 2 == 1) echo ' class="evenrow"'; ?>>
478
- <td class="fields-extra-options" colspan="7" style="border-top:0; border-bottom:1px solid black;">
479
  <div class="field-instructions">
480
  <label for="field_instructions">Field Instructions:</label>
481
  <input type="text" class="width150" name="field[field_instructions]" value="<?php echo $fields[$i]->field_instructions; ?>" />
@@ -484,9 +595,9 @@ if (!class_exists('CustomContactForms')) {
484
  if ($fields[$i]->field_type == 'Radio' || $fields[$i]->field_type == 'Dropdown') { ?>
485
  <div class="dettach-field-options">
486
  <?php if (empty($attached_options)) { ?>
487
- <b>No Attached Options</b>
488
  <?php } else { ?>
489
- <select name="dettach_option_id">
490
  <?php
491
  foreach ($attached_options as $option_id) {
492
  $option = parent::selectFieldOption($option_id);
@@ -496,7 +607,7 @@ if (!class_exists('CustomContactForms')) {
496
  }
497
  ?>
498
  </select>
499
- <input type="submit" name="dettach_field_option" value="Dettach Field Option" />
500
  <?php } ?>
501
  <br /><span class="red bold">*</span> Dettach field options you <a href="#create-field-options">create</a>.
502
  </div>
@@ -505,9 +616,9 @@ if (!class_exists('CustomContactForms')) {
505
  <?php if (empty($all_options)) { ?>
506
  <b>No Field Options to Attach</b>
507
  <?php } else { ?>
508
- <select name="attach_option_id">
509
  <?php echo $all_options; ?>
510
- </select> <input type="submit" name="attach_field_option" value="Attach Field Option" />
511
  <?php } ?>
512
  <br /><span class="red bold">*</span> Attach field options in the order you want them to display.
513
  </div>
@@ -554,7 +665,7 @@ if (!class_exists('CustomContactForms')) {
554
 
555
  ?>
556
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
557
- <tr <?php if ($z % 2 == 0) echo ' class="evenrow"'; ?> style="border:none;">
558
 
559
  <td><?php echo $fields[$i]->field_slug; ?></td>
560
  <td><input type="text" name="field[field_label]" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" /></td>
@@ -580,12 +691,13 @@ if (!class_exists('CustomContactForms')) {
580
  <?php } ?>
581
  </td>
582
 
583
- <td><input type="hidden" name="fid" value="<?php echo $fields[$i]->id; ?>" />
 
584
  <span class="fixed-fields-options-expand"></span>
585
- <input type="submit" name="field_edit" value="Save" /></td>
586
  </tr>
587
- <tr <?php if ($z % 2 == 0) echo ' class="evenrow"'; ?> style="border:none;">
588
- <td class="fixed-fields-extra-options" colspan="7" style="border-bottom:1px solid black;">Field Instructions: <input type="text" name="field[field_instructions]" class="width200" value="<?php echo $fields[$i]->field_instructions; ?>" /> - <?php echo $this->fixed_fields[$fields[$i]->field_slug]; ?></td>
589
  </tr>
590
  </form>
591
  <?php
@@ -625,10 +737,11 @@ if (!class_exists('CustomContactForms')) {
625
  <td class="label"><input type="text" name="option[option_label]" value="<?php echo $option->option_label; ?>" class="width100" /></td>
626
  <td class="option-value"><input type="text" name="option[option_value]" value="<?php echo $option->option_value; ?>" class="width100" /></td>
627
  <td class="action">
628
- <input type="submit" value="Save" name="edit_field_option" />
629
- <input type="submit"class="delete_button" value="Delete" name="delete_field_option" />
630
  </td>
631
- <input type="hidden" name="oid" value="<?php echo $option->id; ?>" />
 
632
  </form>
633
  </tr>
634
  <?php
@@ -647,6 +760,7 @@ if (!class_exists('CustomContactForms')) {
647
  <div class="action">Action</div>
648
  </div>
649
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']?>">
 
650
  <div class="create-field-options-header">Create a Field Option</div>
651
  <ul id="create-field-options">
652
  <li><label for="option[option_slug]">* Option Slug:</label> <input maxlength="20" type="text" name="option[option_slug]" /><br />
@@ -655,7 +769,7 @@ if (!class_exists('CustomContactForms')) {
655
  (This is what is shown to the user in the dropdown or radio field. Example:)</li>
656
  <li><label for="option[option_value]">Option Value:</label> <input type="text" name="option[option_value]" /><br />
657
  (This is the actual value of the option which isn't shown to the user. This can be the same thing as the label. An example pairing of label => value is: "The color green" => "green" or "Yes" => "1".)</li>
658
- <li><input type="submit" name="create_field_option" value="Create Field Option" /></li>
659
  </ul>
660
  <p id="edit-field-comments"><b>*</b> The option value is behind the scences; unseen by the user, but when a user fills out the form, the option value is what is actually sent in the email to you. For dropdown fields the option value is optional, for radio fields it is required.</p>
661
  </form>
@@ -691,14 +805,15 @@ if (!class_exists('CustomContactForms')) {
691
  <td><input type="text" class="width125" name="form[form_title]" value="<?php echo $forms[$i]->form_title; ?>" /></td>
692
  <td><input class="width100" type="text" name="form[submit_button_text]" value="<?php echo $forms[$i]->submit_button_text; ?>" /></td>
693
  <td><select name="form[form_style]"><?php echo $sty_opt; ?></select></td>
694
- <td><input type="hidden" name="fid" value="<?php echo $forms[$i]->id; ?>" />
 
695
  <span class="form-options-expand"></span>
696
- <input type="submit" name="form_edit" value="Save" />
697
- <input type="submit" name="form_delete" class="delete_button" value="Delete" />
698
  </td>
699
  </tr>
700
  <tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
701
- <td class="form-extra-options textcenter" colspan="8" style="border-bottom:1px solid black;">
702
  <table class="form-extra-options-table">
703
  <tbody>
704
  <tr>
@@ -710,38 +825,38 @@ if (!class_exists('CustomContactForms')) {
710
  <td class="bold">Custom Success URL</td>
711
  </tr>
712
  <tr>
713
- <td><select name="form[form_method]"><?php echo $form_methods; ?></select></td>
714
- <td><input class="width100" type="text" name="form[form_action]" value="<?php echo $forms[$i]->form_action; ?>" /></td>
715
- <td><input class="width100" type="text" name="form[form_email]" value="<?php echo $forms[$i]->form_email; ?>" /></td>
716
- <td><input type="text" name="form[form_success_title]" value="<?php echo $forms[$i]->form_success_title; ?>" /></td>
717
- <td><input type="text" name="form[form_success_message]" value="<?php echo $forms[$i]->form_success_message; ?>" /></td>
718
- <td><input type="text" class="width125" name="form[form_thank_you_page]" value="<?php echo $forms[$i]->form_thank_you_page; ?>" /></td>
719
  </tr>
720
  <tr>
721
  <td colspan="3">
722
- <label for="dettach_field_id"><span>Attached Fields:</span></label>
723
  <?php
724
  $attached_fields = parent::getAttachedFieldsArray($forms[$i]->id);
725
- if (empty($attached_fields)) echo 'None ';
726
  else {
727
- echo '<select name="dettach_field_id">';
728
  foreach($attached_fields as $attached_field) {
729
  $this_field = parent::selectField($attached_field, '');
730
  echo $this_field->field_slug . ' <option value="'.$this_field->id.'">'.$this_field->field_slug.'</option>';
731
  }
732
- echo '</select> <input type="submit" value="Dettach Field" name="dettach_field" />';
733
  }
734
  ?><br />
735
  <span class="red bold">*</span> Attach fields in the order you want them displayed.
736
  </td>
737
  <td colspan="3">
738
  <label for="field_id"><span>Attach Field:</span></label>
739
- <select name="field_id"><?php echo $add_fields; ?></select> <input type="submit" name="form_add_field" value="Attach Field" />
740
  <br /><span class="red bold">*</span> Attach fixed fields or ones you <a href="#create-fields">create</a>.
741
  </td>
742
  </tr>
743
  <tr>
744
- <td colspan="6"><label for="theme_code_<?php echo $forms[$i]->id; ?>"><span>Code to Display Form in Theme Files:</span></label> <input type="text" class="width225" value="&lt;?php if (function_exists('serveCustomContactForm')) { serveCustomContactForm(<?php echo $forms[$i]->id; ?>); } ?&gt;" name="theme_code_<?php echo $forms[$i]->id; ?>" /> <label for="form[custom_code]">Custom Code</label> <input name="form[custom_code]" type="text" value="<?php echo $forms[$i]->custom_code; ?>" /></td>
745
  </tr>
746
  </tbody>
747
  </table>
@@ -771,12 +886,95 @@ if (!class_exists('CustomContactForms')) {
771
  </tr>
772
 
773
  </tfoot>
774
- </table><a name="general-settings"></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
775
  <div id="general-settings" class="postbox">
776
  <h3 class="hndle"><span>General Settings</span></h3>
777
  <div class="inside">
778
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
779
  <ul>
 
 
 
 
 
 
780
  <li>
781
  <label for="default_to_email">Default Email:</label>
782
  <input name="default_to_email" value="<?php echo $admin_options[default_to_email]; ?>" type="text" maxlength="100" />
@@ -784,8 +982,8 @@ if (!class_exists('CustomContactForms')) {
784
  <li class="descrip">Form emails will be sent <span>to</span> this address, if no destination email is specified by the form.</li>
785
 
786
  <li>
787
- <label for="enable_jquery">Enable JQuery:</label>
788
- <select name="enable_jquery"><option value="1">Yes</option><option <?php if ($admin_options[enable_jquery] != 1) echo 'selected="selected"'; ?> value="0">No</option></select>
789
  </li>
790
  <li class="descrip">Some plugins don't setup JQuery correctly, so when any other plugin uses JQuery (whether correctly or not), JQuery works for neither plugin. This plugin uses JQuery correctly. If another plugin isn't using JQuery correctly but is more important to you than this one: disable this option. 99% of this plugin's functionality will work without JQuery, just no field instruction tooltips.</li>
791
 
@@ -817,8 +1015,8 @@ if (!class_exists('CustomContactForms')) {
817
  </li>
818
  <li class="descrip">Selecting yes will make form fields remember how they were last filled out.</li>
819
  <li>
820
- <label for="enable_widget_tooltips">Enable Tooltips in Widget:</label>
821
- <select name="enable_widget_tooltips"><option value="1">Yes</option><option <?php if ($admin_options[enable_widget_tooltips] == 0) echo 'selected="selected"'; ?> value="0">No</option></select>
822
  </li>
823
  <li class="descrip">Enabling this shows tooltips containing field instructions on forms in the widget.</li>
824
  <li>
@@ -830,6 +1028,11 @@ if (!class_exists('CustomContactForms')) {
830
  <select name="code_type"><option>XHTML</option><option <?php if ($admin_options[code_type] == 'HTML') echo 'selected="selected"'; ?>>HTML</option></select>
831
  </li>
832
  <li class="descrip">This lets you switch the form code between HTML and XHTML.</li>
 
 
 
 
 
833
  <li>
834
  <label for="wp_mail_function">Use Wordpress Mail Function:</label>
835
  <select name="wp_mail_function"><option value="1">Yes</option><option <?php if ($admin_options[wp_mail_function] == 0) echo 'selected="selected"'; ?> value="0">No</option></select>
@@ -839,30 +1042,22 @@ if (!class_exists('CustomContactForms')) {
839
  <li>
840
  <label>
841
  <input value="1" type="checkbox" name="show_widget_home" <?php if ($admin_options[show_widget_home] == 1) echo 'checked="checked"'; ?> />
842
- On Homepage</label>
843
- </li>
844
- <li>
845
  <label>
846
  <input value="1" type="checkbox" name="show_widget_pages" <?php if ($admin_options[show_widget_pages] == 1) echo 'checked="checked"'; ?> />
847
- On Pages</label>
848
- </li>
849
- <li>
850
  <label>
851
  <input value="1" type="checkbox" name="show_widget_singles" <?php if ($admin_options[show_widget_singles] == 1) echo 'checked="checked"'; ?> />
852
- On Single Posts</label>
853
- </li>
854
- <li>
855
  <label>
856
  <input value="1" type="checkbox" name="show_widget_categories" <?php if ($admin_options[show_widget_categories] == 1) echo 'checked="checked"'; ?> />
857
- On Categories</label>
858
- </li>
859
- <li>
860
  <label>
861
  <input value="1" type="checkbox" name="show_widget_archives" <?php if ($admin_options[show_widget_archives] == 1) echo 'checked="checked"'; ?> />
862
  On Archives</label>
863
  </li>
864
  <li>
865
- <input type="submit" value="Save Settings" name="general_settings" />
866
  </li>
867
  </ul>
868
  </form>
@@ -897,8 +1092,9 @@ if (!class_exists('CustomContactForms')) {
897
  <div id="create-styles" class="postbox">
898
  <h3 class="hndle"><span>Create A Style for Your Forms</span></h3>
899
  <div class="inside">
 
900
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
901
- <ul class="style_left">
902
  <li>
903
  <label for="style_slug">* Style Slug:</label>
904
  <input type="text" maxlength="30" class="width75" name="style[style_slug]" />
@@ -913,7 +1109,7 @@ if (!class_exists('CustomContactForms')) {
913
  (ex: FF0000)</li>
914
  <li>
915
  <label for="label_width">Label Width:</label>
916
- <input type="text" maxlength="20" value="110px" class="width75" name="style[label_width]" />
917
  (ex: 100px or 20%)</li>
918
  <li>
919
  <label for="label_fontsize">Label Font Size:</label>
@@ -933,11 +1129,11 @@ if (!class_exists('CustomContactForms')) {
933
  (ex: 100px or 100%)</li>
934
  <li>
935
  <label for="textarea_height">Textarea Field Height:</label>
936
- <input type="text" maxlength="20" value="100px" class="width75" name="style[textarea_height]" />
937
  (ex: 100px or 100%)</li>
938
  <li>
939
  <label for="field_fontsize">Field Font Size:</label>
940
- <input type="text" maxlength="20" value="1em" class="width75" name="style[field_fontsize]" />
941
  (ex: 10px, 10pt, 1em</li>
942
  <li>
943
  <label for="field_fontcolor">Field Font Color:</label>
@@ -949,15 +1145,15 @@ if (!class_exists('CustomContactForms')) {
949
  </li>
950
  <li>
951
  <label for="form_margin">Form Margin:</label>
952
- <input type="text" maxlength="20" value="5px" class="width75" name="style[form_margin]" />
953
  (ex: 5px or 1em)</li>
954
  <li>
955
  <label for="label_margin">Label Margin:</label>
956
- <input type="text" maxlength="20" value="4px" class="width75" name="style[label_margin]" />
957
  (ex: 5px or 1em)</li>
958
  <li>
959
  <label for="textarea_backgroundcolor">Textarea Background Color:</label>
960
- <input type="text" maxlength="20" value="ffffff" class="width75 colorfield" name="style[textarea_backgroundcolor]" />
961
  (ex: FF0000)</li>
962
  <li>
963
  <label for="success_popover_fontcolor">Success Popover Font Color:</label>
@@ -965,41 +1161,49 @@ if (!class_exists('CustomContactForms')) {
965
  (ex: 333333)</li>
966
  <li>
967
  <label for="success_popover_title_fontsize">Success Popover Title Font Size:</label>
968
- <input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_title_fontsize]" />
 
 
 
 
969
  (ex: 12px, 1em, 100%)</li>
 
 
 
 
970
  </ul>
971
  <ul class="style_right">
972
  <li>
973
  <label for="input_width">Field Border Color:</label>
974
- <input type="text" maxlength="20" value="333333" class="width75 colorfield" name="style[field_bordercolor]" />
975
  (ex: 100px or 100%)</li>
976
  <li>
977
  <label for="form_borderstyle">Form Border Style:</label>
978
- <select class="width75" name="style[form_borderstyle]"><?php echo str_replace('<option>solid</option>', '<option selected="selected">solid</option>', $border_style_options); ?></select>
979
  </li>
980
  <li>
981
  <label for="form_bordercolor">Form Border Color:</label>
982
- <input type="text" maxlength="20" value="333333" class="width75 colorfield" name="style[form_bordercolor]" />
983
  (ex: 000000)</li>
984
  <li>
985
  <label for="form_borderwidth">Form Border Width:</label>
986
- <input type="text" maxlength="20" value="1px" class="width75" name="style[form_borderwidth]" />
987
  (ex: 1px)</li>
988
  <li>
989
  <label for="form_borderwidth">Form Width:</label>
990
- <input type="text" maxlength="20" value="500px" class="width75" name="style[form_width]" />
991
  (ex: 100px or 50%)</li>
992
  <li>
993
  <label for="form_borderwidth">Form Font Family:</label>
994
- <input type="text" maxlength="150" value="Verdana, tahoma, arial" class="width75" name="style[form_fontfamily]" />
995
  (ex: Verdana, Tahoma, Arial)</li>
996
  <li>
997
  <label for="submit_width">Button Width:</label>
998
- <input type="text" maxlength="20" value="80px" class="width75" name="style[submit_width]" />
999
- (ex: 100px or 30%)</li>
1000
  <li>
1001
  <label for="submit_height">Button Height:</label>
1002
- <input type="text" maxlength="20" value="35px" class="width75" name="style[submit_height]" />
1003
  (ex: 100px or 30%)</li>
1004
  <li>
1005
  <label for="submit_fontsize">Button Font Size:</label>
@@ -1011,15 +1215,15 @@ if (!class_exists('CustomContactForms')) {
1011
  (ex: FF0000)</li>
1012
  <li>
1013
  <label for="field_backgroundcolor">Field Background Color:</label>
1014
- <input type="text" maxlength="20" value="efefef" class="width75 colorfield" name="style[field_backgroundcolor]" />
1015
  (ex: FF0000)</li>
1016
  <li>
1017
  <label for="form_padding">Form Padding:</label>
1018
- <input type="text" maxlength="20" value="5px" class="width75" name="style[form_padding]" />
1019
  (ex: 5px or 1em)</li>
1020
  <li>
1021
  <label for="title_margin">Title Margin:</label>
1022
- <input type="text" maxlength="20" value="2px" class="width75" name="style[title_margin]" />
1023
  (ex: 5px or 1em)</li>
1024
  <li>
1025
  <label for="title_margin">Dropdown Width:</label>
@@ -1033,14 +1237,22 @@ if (!class_exists('CustomContactForms')) {
1033
  <label for="success_popover_fontsize">Success Popover Font Size:</label>
1034
  <input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_fontsize]" />
1035
  (ex: 12px, 1em, 100%)</li>
1036
- <li>
1037
- <label for="success_popover_title_fontsize">Success Popover Title Font Size:</label>
1038
- <input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_title_fontsize]" />
1039
- (ex: 12px, 1em, 100%)</li>
1040
  <li>
1041
  <label for="success_popover_height">Success Popover Height:</label>
1042
  <input type="text" maxlength="20" value="200px" class="width75" name="style[success_popover_height]" />
1043
  (ex: 200px, 6em, 50%)</li>
 
 
 
 
 
 
 
 
 
 
 
 
1044
  <li>
1045
  <input type="submit" value="Create Style" name="style_create" />
1046
  </li>
@@ -1069,11 +1281,12 @@ if (!class_exists('CustomContactForms')) {
1069
  <tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
1070
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1071
  <td><label>* Slug:</label> <input type="text" maxlength="30" value="<?php echo $style->style_slug; ?>" name="style[style_slug]" /><br />
1072
- <label>Font Family:</label><input type="text" maxlength="20" value="<?php echo $style->form_fontfamily; ?>" name="style[form_fontfamily]" /><br />
1073
  <label>Textarea Background<br />Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->textarea_backgroundcolor; ?>" name="style[textarea_backgroundcolor]" /><br />
1074
  <label>Success Popover<br />Border Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_bordercolor; ?>" name="style[success_popover_bordercolor]" /><br />
1075
- <input type="submit" class="submit-styles" name="style_edit" value="Save" /><br />
1076
- <input type="submit" class="submit-styles delete_button" name="style_delete" value="Delete Style" />
 
1077
  </td>
1078
 
1079
  <td>
@@ -1092,6 +1305,7 @@ if (!class_exists('CustomContactForms')) {
1092
  <label>Field Background Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_backgroundcolor; ?>" name="style[field_backgroundcolor]" /><br />
1093
  <label>Title Margin:</label><input type="text" maxlength="20" value="<?php echo $style->title_margin; ?>" name="style[title_margin]" /><br />
1094
  <label>Success Popover<br />Title Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->success_popover_title_fontsize; ?>" name="style[success_popover_title_fontsize]" />
 
1095
  </td>
1096
 
1097
  <td>
@@ -1100,7 +1314,8 @@ if (!class_exists('CustomContactForms')) {
1100
  <label>Field Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->field_fontsize; ?>" name="style[field_fontsize]" /><br />
1101
  <label>Button Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->submit_fontsize; ?>" name="style[submit_fontsize]" /><br />
1102
  <label>Form Padding:</label><input type="text" maxlength="20" value="<?php echo $style->form_padding; ?>" name="style[form_padding]" /><br />
1103
- <label>Success Popover<br />Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->success_popover_fontsize; ?>" name="style[success_popover_fontsize]" />
 
1104
  </td>
1105
 
1106
  <td>
@@ -1110,6 +1325,7 @@ if (!class_exists('CustomContactForms')) {
1110
  <label>Button Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->submit_fontcolor; ?>" name="style[submit_fontcolor]" /><br />
1111
  <label>Form Margin:</label><input type="text" maxlength="20" value="<?php echo $style->form_margin; ?>" name="style[form_margin]" /><br />
1112
  <label>Success Popover<br />Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_fontcolor; ?>" name="style[success_popover_fontcolor]" /><br />
 
1113
  </td>
1114
 
1115
  <td><label>Form Border Style:</label><select name="style[form_borderstyle]"><?php echo str_replace('<option>'.$style->form_borderstyle.'</option>', '<option selected="selected">'.$style->form_borderstyle.'</option>', $border_style_options); ?></select><br />
@@ -1118,7 +1334,9 @@ if (!class_exists('CustomContactForms')) {
1118
  <label>Field Border Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_bordercolor; ?>" name="style[field_bordercolor]" /><br />
1119
  <label>Field Border Style:</label><select name="style[field_borderstyle]"><?php echo str_replace('<option>'.$style->field_borderstyle.'</option>', '<option selected="selected">'.$style->field_borderstyle.'</option>', $border_style_options); ?></select><br />
1120
  <label>Success Popover<br />Title Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_title_fontcolor; ?>" name="style[success_popover_title_fontcolor]" /><br />
1121
- <input name="sid" type="hidden" value="<?php echo $style->id; ?>" />
 
 
1122
  </td>
1123
 
1124
  </form>
@@ -1150,7 +1368,7 @@ if (!class_exists('CustomContactForms')) {
1150
  <input id="email" type="text" value="<?php echo get_option('admin_email'); ?>" name="email" maxlength="100" /></li>
1151
  <li><label for="message">* Your Message:</label>
1152
  <textarea id="message" name="message"></textarea></li>
1153
- <li><label for="type">* Purpose of this message:</label> <select id="type" name="type"><option>Bug Report</option><option>Suggest a Feature</option></select></li>
1154
  </ul>
1155
  <p><input type="submit" name="contact_author" value="Send Message" /></p>
1156
  </form>
@@ -1180,6 +1398,25 @@ the field names you want required by commas. Remember to use underscores instead
1180
  &lt;/form&gt;</textarea>
1181
  </div>
1182
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1183
  <a name="plugin-news"></a>
1184
  <div id="plugin-news" class="postbox">
1185
  <h3 class="hndle"><span>Custom Contact Forms Plugin News</span></h3>
@@ -1245,8 +1482,8 @@ the field names you want required by commas. Remember to use underscores instead
1245
 
1246
  function displayPluginNewsFeed() {
1247
  include_once(ABSPATH . WPINC . '/feed.php');
1248
- $rss = fetch_feed('http://www.taylorlovett.com/category/custom-contact-forms/feed');
1249
- if (!is_wp_error($rss) ) {
1250
  $maxitems = $rss->get_item_quantity(5);
1251
  $rss_items = $rss->get_items(0, 1);
1252
  $rss_items2 = $rss->get_items(1, $maxitems);
@@ -1316,10 +1553,10 @@ the field names you want required by commas. Remember to use underscores instead
1316
  $style = parent::selectStyle($form->form_style, '');
1317
  $style_class = $style->style_slug;
1318
  }
1319
- $form_title = parent::decodeOption($form->form_title, 1, 1);
1320
  $action = (!empty($form->form_action)) ? $form->form_action : $_SERVER['REQUEST_URI'];
1321
  $out .= '<form id="'.$form_id.'" method="'.strtolower($form->form_method).'" action="'.$action.'" class="'.$style_class.'">' . "\n";
1322
- $out .= parent::decodeOption($form->custom_code, 1, 1) . "\n";
1323
  if (!empty($form_title)) $out .= '<h4 id="h4-' . $form->id . '-' . $form_key . '">' . $form_title . '</h4>' . "\n";
1324
  $fields = parent::getAttachedFieldsArray($fid);
1325
  $hiddens = '';
@@ -1328,8 +1565,8 @@ the field names you want required by commas. Remember to use underscores instead
1328
  $field = parent::selectField($field_id, '');
1329
  $req = ($field->field_required == 1 or $field->field_slug == 'ishuman') ? '* ' : '';
1330
  $req_long = ($field->field_required == 1) ? ' (required)' : '';
1331
- $input_id = 'id="'.parent::decodeOption($field->field_slug, 1, 1).'-'.$form_key.'"';
1332
- $field_value = parent::decodeOption($field->field_value, 1, 1);
1333
  $instructions = (empty($field->field_instructions)) ? '' : 'title="' . $field->field_instructions . $req_long . '" class="ccf-tooltip-field"';
1334
  if ($admin_options[enable_widget_tooltips] == 0 && $is_sidebar) $instructions = '';
1335
  if ($_SESSION[fields][$field->field_slug]) {
@@ -1339,13 +1576,13 @@ the field names you want required by commas. Remember to use underscores instead
1339
  $out .= '<div>' . "\n" . $this->getCaptchaCode($form->id) . "\n" . '</div>' . "\n";
1340
  } elseif ($field->field_type == 'Text') {
1341
  $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="'.$field->field_maxlength.'"';
1342
- $out .= '<div>'."\n".'<label for="'.parent::decodeOption($field->field_slug, 1, 1).'">'. $req .parent::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<input '.$instructions.' '.$input_id.' type="text" name="'.parent::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'"'.$maxlength.''.$code_type.'>'."\n".'</div>' . "\n";
1343
  } elseif ($field->field_type == 'Hidden') {
1344
- $hiddens .= '<input type="hidden" name="'.parent::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'" '.$input_id.''.$code_type.'>' . "\n";
1345
  } elseif ($field->field_type == 'Checkbox') {
1346
- $out .= '<div>'."\n".'<input '.$instructions.' type="checkbox" name="'.parent::decodeOption($field->field_slug, 1, 1).'" value="'.parent::decodeOption($field->field_value, 1, 1).'" '.$input_id.''.$code_type.'> '."\n".'<label class="checkbox" for="'.parent::decodeOption($field->field_slug, 1, 1).'">' . $req .parent::decodeOption($field->field_label, 1, 1).'</label>'."\n".'</div>' . "\n";
1347
  } elseif ($field->field_type == 'Textarea') {
1348
- $out .= '<div>'."\n".'<label for="'.parent::decodeOption($field->field_slug, 1, 1).'">'. $req .parent::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<textarea '.$instructions.' '.$input_id.' rows="5" cols="40" name="'.parent::decodeOption($field->field_slug, 1, 1).'">'.$field_value.'</textarea>'."\n".'</div>' . "\n";
1349
  } elseif ($field->field_type == 'Dropdown') {
1350
  $field_options = '';
1351
  $options = parent::getAttachedFieldOptionsArray($field->id);
@@ -1356,8 +1593,8 @@ the field names you want required by commas. Remember to use underscores instead
1356
  $field_options .= '<option'.$option_sel.''.$option_value.'>' . $option->option_label . '</option>' . "\n";
1357
  }
1358
  if (!empty($options)) {
1359
- if (!$is_sidebar) $out .= '<div>'."\n".'<select '.$instructions.' '.$input_id.' name="'.parent::decodeOption($field->field_slug, 1, 1).'">'."\n".$field_options.'</select>'."\n".'<label class="checkbox" for="'.parent::decodeOption($field->field_slug, 1, 1).'">'. $req .parent::decodeOption($field->field_label, 1, 1).'</label>'."\n".'</div>' . "\n";
1360
- else $out .= '<div>'."\n".'<label for="'.parent::decodeOption($field->field_slug, 1, 1).'">'. $req .parent::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<select '.$instructions.' '.$input_id.' name="'.parent::decodeOption($field->field_slug, 1, 1).'">'."\n".$field_options.'</select>'."\n".'</div>' . "\n";
1361
  }
1362
  } elseif ($field->field_type == 'Radio') {
1363
  $field_options = '';
@@ -1365,30 +1602,34 @@ the field names you want required by commas. Remember to use underscores instead
1365
  foreach ($options as $option_id) {
1366
  $option = parent::selectFieldOption($option_id);
1367
  $option_sel = ($field->field_value == $option->option_slug) ? ' checked="checked"' : '';
1368
- $field_options .= '<div><input'.$option_sel.' type="radio" '.$instructions.' name="'.parent::decodeOption($field->field_slug, 1, 1).'" value="'.parent::decodeOption($option->option_value, 1, 1).'"'.$code_type.'> <label class="select" for="'.parent::decodeOption($field->field_slug, 1, 1).'">' . parent::decodeOption($option->option_label, 1, 1) . '</label></div>' . "\n";
1369
  }
1370
- $field_label = (!empty($field->field_label)) ? '<label for="'.parent::decodeOption($field->field_slug, 1, 1).'">'. $req .parent::decodeOption($field->field_label, 1, 1).'</label>' : '';
1371
  if (!empty($options)) $out .= '<div>'."\n".$field_label."\n".$field_options."\n".'</div>' . "\n";
1372
  }
1373
  }
1374
- $submit_text = (!empty($form->submit_button_text)) ? parent::decodeOption($form->submit_button_text, 1, 0) : 'Submit';
1375
  $out .= '<input name="form_page" value="'.$_SERVER['REQUEST_URI'].'" type="hidden"'.$code_type.'>'."\n".'<input type="hidden" name="fid" value="'.$form->id.'"'.$code_type.'>'."\n".$hiddens."\n".'<input type="submit" id="submit-' . $form->id . '-'.$form_key.'" class="submit" value="' . $submit_text . '" name="customcontactforms_submit"'.$code_type.'>' . "\n" . '</form>';
1376
  if ($admin_options[author_link] == 1) $out .= "\n".'<a class="hide" href="http://www.taylorlovett.com" title="Rockville Web Developer, Wordpress Plugins">Wordpress plugin expert and Rockville Web Developer Taylor Lovett</a>';
1377
 
1378
  if ($form->form_style != 0) {
 
 
 
1379
  $form_styles .= '<style type="text/css">' . "\n";
1380
- $form_styles .= '#' . $form_id . " { width: ".$style->form_width."; padding:".$style->form_padding."; margin:".$style->form_margin."; border:".$style->form_borderwidth." ".$style->form_borderstyle." #".parent::formatStyle($style->form_bordercolor)."; font-family:".$style->form_fontfamily."; }\n";
1381
- $form_styles .= '#' . $form_id . " div { margin-bottom:6px }\n";
1382
- $form_styles .= '#' . $form_id . " div div { margin:0; padding:0; }\n";
1383
- $form_styles .= '#' . $form_id . " h4 { padding:0; margin:".$style->title_margin." ".$style->title_margin." ".$style->title_margin." 0; color:#".parent::formatStyle($style->title_fontcolor)."; font-size:".$style->title_fontsize."; } \n";
1384
- $form_styles .= '#' . $form_id . " label { padding:0; margin:".$style->label_margin." ".$style->label_margin." ".$style->label_margin." 0; display:block; color:#".parent::formatStyle($style->label_fontcolor)."; width:".$style->label_width."; font-size:".$style->label_fontsize."; } \n";
1385
- $form_styles .= '#' . $form_id . " div div input { margin-bottom:2px; line-height:normal; }";
1386
- $form_styles .= '#' . $form_id . " input[type=checkbox] { margin:0; }";
1387
  $form_styles .= '#' . $form_id . " label.checkbox, #" . $form_id . " label.radio, #" . $form_id . " label.select { display:inline; } \n";
1388
- $form_styles .= '#' . $form_id . " input[type=text], #" . $form_id . " select { color:#".parent::formatStyle($style->field_fontcolor)."; margin:0; width:".$style->input_width."; font-size:".$style->field_fontsize."; background-color:#".parent::formatStyle($style->field_backgroundcolor)."; border:1px ".$style->field_borderstyle." #".parent::formatStyle($style->field_bordercolor)."; } \n";
1389
- $form_styles .= '#' . $form_id . " select { width:".$style->dropdown_width."; }\n";
1390
  $form_styles .= '#' . $form_id . " .submit { color:#".parent::formatStyle($style->submit_fontcolor)."; width:".$style->submit_width."; height:".$style->submit_height."; font-size:".$style->submit_fontsize."; } \n";
1391
- $form_styles .= '#' . $form_id . " textarea { color:#".parent::formatStyle($style->field_fontcolor)."; width:".$style->textarea_width."; margin:0; background-color:#".parent::formatStyle($style->textarea_backgroundcolor)."; height:".$style->textarea_height."; font-size:".$style->field_fontsize."; border:1px ".$style->field_borderstyle." #".parent::formatStyle($style->field_bordercolor)."; } \n";
 
1392
  $form_styles .= '</style>' . "\n";
1393
  }
1394
 
@@ -1419,7 +1660,7 @@ the field names you want required by commas. Remember to use underscores instead
1419
  $body .= "Message: $message\n";
1420
  $body .= "Message Type: $type\n";
1421
  $body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
1422
- $mailer = new CustomContactFormsMailer('admin@taylorlovett.com', $email, "CCF Message: $type", stripslashes($body), $admin_options[wp_mail_function], $admin_options[default_to_email]);
1423
  $mailer->send();
1424
  return true;
1425
  }
@@ -1451,7 +1692,7 @@ the field names you want required by commas. Remember to use underscores instead
1451
  <div id="ccf-form-success">
1452
  <div>
1453
  <h5><?php echo $success_title; ?></h5>
1454
- <a href="javascript:void(0)" class="close">[close]</a>
1455
  </div>
1456
  <p><?php echo $success_message; ?></p>
1457
 
@@ -1470,6 +1711,16 @@ the field names you want required by commas. Remember to use underscores instead
1470
  return $array;
1471
  }
1472
 
 
 
 
 
 
 
 
 
 
 
1473
  function processForms() {
1474
  if ($_POST[ccf_customhtml]) {
1475
  $admin_options = $this->getAdminOptions();
@@ -1481,17 +1732,22 @@ the field names you want required by commas. Remember to use underscores instead
1481
  if (in_array($key, $req_fields) && !empty($value))
1482
  unset($req_fields[array_search($key, $req_fields)]);
1483
  $body .= ucwords(str_replace('_', ' ', $key)) . ': ' . $value . "\n";
 
1484
  }
1485
  } foreach($req_fields as $err)
1486
  $this->setFormError($err, 'You left the "' . $err . '" field blank.');
1487
  $errors = $this->getAllFormErrors();
1488
  if (empty($errors)) {
 
1489
  require_once('custom-contact-forms-mailer.php');
 
 
1490
  $body .= "\n" . 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
1491
- $mailer = new CustomContactFormsMailer($_POST[destination_email], $admin_options[default_from_email], $admin_options[default_form_subject], stripslashes($body), $admin_options[wp_mail_function]);
1492
- $mailer->send();
1493
- if ($_POST[thank_you_page])
1494
- header("Location: " . $_POST[thank_you_page]);
 
1495
  $this->current_thank_you_message = (!empty($_POST[success_message])) ? $_POST[success_message] : $admin_options[form_success_message];
1496
  $this->current_form = 0;
1497
  add_action('wp_footer', array(&$this, 'insertFormSuccessCode'), 1);
@@ -1525,31 +1781,38 @@ the field names you want required by commas. Remember to use underscores instead
1525
  $checks[] = $field->field_slug;
1526
  }
1527
  $body = '';
 
1528
  foreach ($_POST as $key => $value) {
1529
  $_SESSION[fields][$key] = $value;
1530
  $field = parent::selectField('', $key);
1531
- if (!array_key_exists($key, $this->fixed_fields) or $key == 'fixedEmail') {
1532
  $mail_field_label = (empty($field->field_label)) ? $field->field_slug : $field->field_label;
1533
  $body .= $mail_field_label . ': ' . $value . "\n";
 
1534
  } if (in_array($key, $checks)) {
1535
  $checks_key = array_search($key, $checks);
1536
  unset($checks[$checks_key]);
1537
  }
1538
  } foreach ($checks as $check_key) {
1539
  $field = parent::selectField('', $check_key);
1540
- $body .= ucwords(str_replace('_', ' ', $field->field_label)) . ': 0' . "\n";
 
1541
  }
1542
  $errors = $this->getAllFormErrors();
1543
  if (empty($errors)) {
1544
  require_once('custom-contact-forms-mailer.php');
 
1545
  unset($_SESSION['captcha_' . $_POST[fid]]);
1546
  unset($_SESSION[fields]);
 
 
1547
  $body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
1548
  $to_email = (!empty($form->form_email)) ? $form->form_email : $admin_options[default_to_email];
1549
- $mailer = new CustomContactFormsMailer($to_email, $admin_options[default_from_email], $admin_options[default_form_subject], stripslashes($body), $admin_options[wp_mail_function], $reply);
1550
- $mailer->send();
1551
- if (!empty($form->form_thank_you_page)) {
1552
- header("Location: " . $form->form_thank_you_page);
 
1553
  }
1554
  $this->current_form = $form->id;
1555
  add_action('wp_footer', array(&$this, 'insertFormSuccessCode'), 1);
@@ -1587,13 +1850,19 @@ if (!function_exists('CCFWidgetInit')) {
1587
  if (isset($customcontact)) {
1588
  add_action('init', array(&$customcontact, 'init'), 1);
1589
  register_activation_hook(__FILE__, array(&$customcontact, 'activatePlugin'));
1590
- add_action('wp_print_scripts', array(&$customcontact, 'insertFrontEndScripts'), 1);
1591
- add_action('admin_print_scripts', array(&$customcontact, 'insertAdminScripts'), 1);
1592
- add_action('wp_print_styles', array(&$customcontact, 'insertFrontEndStyles'), 1);
1593
- add_action('admin_print_styles', array(&$customcontact, 'insertBackEndStyles'), 1);
 
 
 
 
 
 
 
 
1594
  add_filter('the_content', array(&$customcontact, 'contentFilter'));
1595
  add_action('widgets_init', 'CCFWidgetInit');
1596
- add_action('admin_menu', 'CustomContactForms_ap');
1597
- add_action('admin_footer', array(&$customcontact, 'insertUsagePopover'));
1598
  }
1599
  ?>
2
  /*
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, form submissions saved to database, captchas, tooltip popovers, unlimited fields/forms/form styles, import/export, use a custom thank you page or built-in popover with a custom success message set for each form.
6
+ Version: 4.0.0.b3
7
  Author: Taylor Lovett
8
  Author URI: http://www.taylorlovett.com
9
  */
21
  You should have received a copy of the GNU General Public License
22
  along with this program. If not, see <http://www.gnu.org/licenses/>.
23
  */
24
+ require_once('custom-contact-forms-static.php');
25
+ CustomContactFormsStatic::definePluginConstants();
26
  require_once('custom-contact-forms-db.php');
27
  if (!class_exists('CustomContactForms')) {
28
  class CustomContactForms extends CustomContactFormsDB {
29
  var $adminOptionsName = 'customContactFormsAdminOptions';
30
+ var $form_errors = array();
 
31
  var $error_return;
32
  var $current_form;
33
  var $current_thank_you_message;
34
+ var $current_page = NULL;
 
 
 
 
 
 
35
 
36
  function CustomContactForms() {
37
+ if (is_admin())
38
+ $this->current_page = $_GET[page];
39
+ }
40
+
41
+ function isPluginAdminPage() {
42
+ return ($this->current_page == 'custom-contact-forms');
43
  }
44
 
45
  function activatePlugin() {
55
  $admin_email = get_option('admin_email');
56
  $customcontactAdminOptions = array('show_widget_home' => 1, 'show_widget_pages' => 1, 'show_widget_singles' => 1, 'show_widget_categories' => 1, 'show_widget_archives' => 1, 'default_to_email' => $admin_email, 'default_from_email' => $admin_email, 'default_form_subject' => 'Someone Filled Out Your Contact Form!',
57
  'remember_field_values' => 0, 'author_link' => 1, 'enable_widget_tooltips' => 1, 'wp_mail_function' => 1, 'form_success_message_title' => 'Form Success!', 'form_success_message' => 'Thank you for filling out our web form. We will get back to you ASAP.', 'enable_jquery' => 1, 'code_type' => 'XHTML',
58
+ 'show_install_popover' => 0, 'email_form_submissions' => 1, 'admin_ajax' => 1); // default general settings
59
  $customcontactOptions = get_option($this->adminOptionsName);
60
  if (!empty($customcontactOptions)) {
61
  foreach ($customcontactOptions as $key => $option)
68
  if (!is_admin()) {
69
  $this->startSession();
70
  $this->processForms();
71
+ } else {
72
+ $this->downloadExportFile();
73
  }
74
  }
75
 
76
+ function downloadExportFile() {
77
+ if ($_POST[ccf_export]) {
78
+ require_once('custom-contact-forms-export.php');
79
+ $transit = new CustomContactFormsExport($this->adminOptionsName);
80
+ $transit->exportAll();
81
+ $file = $transit->exportToFile();
82
+ CustomContactFormsStatic::redirect(WP_PLUGIN_URL . '/custom-contact-forms/download.php?location=export/' . $file);
83
  }
84
  }
85
 
86
+ function insertFrontEndStyles() {
87
+ wp_register_style('CCFStandardsCSS', WP_PLUGIN_URL . '/custom-contact-forms/css/custom-contact-forms-standards.css');
88
+ wp_register_style('CCFFormsCSS', WP_PLUGIN_URL . '/custom-contact-forms/css/custom-contact-forms.css');
89
+ wp_enqueue_style('CCFStandardsCSS');
90
+ wp_enqueue_style('CCFFormsCSS');
91
+ }
92
+
93
  function insertBackEndStyles() {
94
+ wp_register_style('CCFStandardsCSS', WP_PLUGIN_URL . '/custom-contact-forms/css/custom-contact-forms-standards.css');
95
+ wp_register_style('CCFAdminCSS', WP_PLUGIN_URL . '/custom-contact-forms/css/custom-contact-forms-admin.css');
96
+ wp_register_style('CCFColorPickerCSS', WP_PLUGIN_URL . '/custom-contact-forms/css/colorpicker.css');
97
  wp_enqueue_style('CCFStandardsCSS');
98
  wp_enqueue_style('CCFAdminCSS');
99
  wp_enqueue_style('CCFColorPickerCSS');
100
  }
101
 
102
  function insertAdminScripts() {
103
+ $admin_options = $this->getAdminOptions();
104
+ ?>
105
+ <script type="text/javascript" language="javascript">
106
+ var ccf_plugin_dir = "<?php echo WP_PLUGIN_URL . '/custom-contact-forms'; ?>";
107
+ var ccf_file = "<?php echo get_option('siteurl') . '/wp-admin/options-general.php?page=custom-contact-forms'; ?>";
108
+ </script>
109
+ <?php
110
+ wp_enqueue_script('jquery');
111
+ wp_enqueue_script('jquery-ui-core');
112
+ wp_enqueue_script('jquery-ui-tabs');
113
+ wp_enqueue_script('jquery-tools', WP_PLUGIN_URL . '/custom-contact-forms/js/jquery.tools.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'), '1.0');
114
+ wp_enqueue_script('ccf-admin-inc', WP_PLUGIN_URL . '/custom-contact-forms/js/custom-contact-forms-admin-inc.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'), '1.0');
115
+ wp_enqueue_script('ccf-admin', WP_PLUGIN_URL . '/custom-contact-forms/js/custom-contact-forms-admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'), '1.0');
116
+ if ($admin_options['admin_ajax'] == 1)
117
+ wp_enqueue_script('ccf-admin-ajax', WP_PLUGIN_URL . '/custom-contact-forms/js/custom-contact-forms-admin-ajax.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'), '1.0');
118
+ wp_enqueue_script('ccf-colorpicker', WP_PLUGIN_URL . '/custom-contact-forms/js/colorpicker.js');
119
+ wp_enqueue_script('ccf-eye', WP_PLUGIN_URL . '/custom-contact-forms/js/eye.js');
120
+ wp_enqueue_script('ccf-utils', WP_PLUGIN_URL . '/custom-contact-forms/js/utils.js');
121
+ wp_enqueue_script('ccf-layout', WP_PLUGIN_URL . '/custom-contact-forms/js/layout.js?ver=1.0.2');
122
  }
123
 
124
  function insertFrontEndScripts() {
126
  $admin_options = $this->getAdminOptions();
127
  if ($admin_options[enable_jquery] == 1) {
128
  wp_enqueue_script('jquery');
129
+ wp_enqueue_script('jquery-tools', WP_PLUGIN_URL . '/custom-contact-forms/js/jquery.tools.min.js');
130
+ wp_enqueue_script('ccf-main', WP_PLUGIN_URL . '/custom-contact-forms/js/custom-contact-forms.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs', 'jquery-ui-resizable'), '1.0');
 
 
 
 
131
  }
132
  }
133
  }
152
  <a href="javascript:void(0)" class="close">[close]</a>
153
  </div>
154
  <div class="popover-body">
155
+ <ul id="popover-tof">
156
+ <li><a href="#pop-forms">Forms</a></li>
157
+ <li><a href="#pop-fields">Fields</a></li>
158
+ <li><a href="#pop-field-options">Field Options</a></li>
159
+ <li><a href="#pop-styles">Styles</a></li>
160
+ <li><a href="#pop-custom-html">Custom HTML Forms</a></li>
161
+ <li><a href="#pop-import-export">Import / Export</a></li>
162
+ <li><a href="#pop-form-submissions">Form Submissions</a></li>
163
+ </ul>
164
+ <h3>Introduction</h3>
165
  <p>CCF is an extremely intuitive plugin allowing you to create any type of contact form you can imagine. CCF is very user friendly but with possibilities comes complexity. It is recommend that you click the button below to create default fields, field options, and forms.
166
  The default content will help you get a feel for the amazing things you can accomplish with this plugin. This popover only shows 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>
167
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
168
  <input type="submit" class="insert-default-content-button" value="Insert Default Content" name="insert_default_content" />
169
  </form>
170
+ <p>Below is a basic usage outline of the four pillars of this plugin: fields, field options, styles, and forms. Another useful part of the plugin is the "Custom HTML Feature" which allows you to write the form HTML yourself using the plugin simply as a form processor; this is great if you are a web developer with HTML experience. Also explained below is the "Saved Form Submissions" feature which displays all form submissions in the admin panel.</p>
171
  <ul>
172
  <li>
173
+ <h3>Fields<a name="pop-fields"></a></h3>
174
  <p>Fields are the actual input boxes in which users enter their information. There are six types of fields that you can attach to your forms.</p>
175
  <ul>
176
  <li><span>Text:</span>
199
  <p>The last important thing related to fields are <span>Fixed Fields</span>. Fixed Fields are special fields that come already created within the plugin such as the captcha spam blocker and email field. Fixed Fields do special things that you wouldn't be able to accomplish with normally; they cannot be deleted or created. If you use the fixedEmail field, as opposed to creating your own email field. the users email will be checked to make sure it is valid, if it isn't a form error will be displayed.</p>
200
  </li>
201
  <li>
202
+ <h3>Field Options<a name="pop-field-options"></a></h3>
203
  <p>In the field section above, look at the radio or dropdown fields. See how they have multiple options within the field? Those are called Field Options. Field Options have their own manager. There are only three things you must fill in to create a field option.</p>
204
  <ul>
205
  <li><span class="red">*</span> <span>Slug:</span> Used to identify the field option, solely for admin purposes; must be unique, and contain only letters, numbers, and underscores. Example: "slug_one".</li>
209
  <p>Once you create field options, you can attach them (in the field manager) to radio and dropdown fields (that are already created). It is important to remember that after you create a dropdown or radio field, they will not work until you attach one or more field options.</p>
210
  </li>
211
  <li>
212
+ <h3>Forms<a name="pop-forms"></a></h3>
213
  <p>Forms bring everything together. Each form you create in the form manager shows a code to display that form in posts/pages as well as theme files. The post/page form display code looks like: [customcontact id=FORMID]. There are a number of parameters that you can fill out when creating and managing each of your forms.</p>
214
  <ul>
215
  <li><span class="red">*</span> <span>Slug:</span> A slug is simply a way to identify your form. It can only contain underscores, letters, and numbers and must be unique. Example "my_contact_form"</li>
229
  <div class="ccf-success-popover-example"></div>
230
  </li>
231
  <li>
232
+ <h3>Style Manager<a name="pop-styles"></a></h3>
233
  <p>The style manager allows you to customize the appearance of forms without any knowledge of CSS. There are a ton of parameters you can fill out with each style and all of them are pretty self-explanitory. After you create a style, you need to go to the form manager and set the form style to the new style you created (the slug will be what shows in the "Form Style" dropdown).</p>
234
  <p>The image below will help you better understand how each style option will change your forms.</p>
235
  <div class="ccf-style-example"></div>
236
  </li>
237
  <li>
238
+ <h3>Custom HTML Forms Feature (advanced)<a name="pop-custom-html"></a></h3>
239
  <p>If you know HTML and simply want to use this plugin to process form requests, this feature is for you. The following HTML is a the framework to which you must adhere. In order for your form to work you MUST do the following:</p>
240
  <ul>
241
  <li>Keep the form action/method the same (yes the action is supposed to be empty).</li>
244
  </ul>
245
  <p>Just to be clear, you don't edit the code in the Custom HTML Forms feature within the admin panel. Instead, you copy the code in to the page, post, or theme file you want to display a form, then edit the code to look how you want following the guidelines provided above.</p>
246
  </li>
247
+ <li>
248
+ <h3>Saved Form Submissions<a name="pop-form-submissions"></a></h3>
249
+ <p>This features saves each user form submission. All the fields attached to the form along with the time of submission and form URL are saved in the database and displayed in a stylish format in the admin panel.</p>
250
+ </li>
251
+ <li>
252
+ <h3>Import / Export<a name="pop-import-export"></a></h3>
253
+ <p>Import/export is a new feature that allows you to transfer forms, fields, field options, styles and everything else saved by the plugin between Wordpress installations. Clicking the Export All button will create a .SQL file for download. With the .SQL export file you can use the importer within the CCF plugin admin page to import the .SQL file. The built-in importer is completely safe as long as you only import files that have been generated by the CCF exporter.
254
+ You can also use PHPMyAdmin or any other MySQL database administration tool to run the import file. Importing a .SQL file will never overwrite any existing data.
255
+ It is strongly recommended that you import CCF .SQL files using the built-in importer with in the admin panel due to the added complexity of importing using alterative methods.
256
+ If you are importing <i>without</i> using the built-in importer (such as PHPMyAdmin), then note the following: You should only run the import file on Wordpress installations that already have Custom Contact Forms installed; also you will need to change the table prefix for each query within the .SQL file.</p>
257
+ </li>
258
  </ul>
259
  </div>
260
  </div>
287
  $admin_options[show_widget_archives] = $_POST[show_widget_archives];
288
  $admin_options[show_widget_home] = $_POST[show_widget_home];
289
  $admin_options[custom_thank_you] = $_POST[custom_thank_you];
290
+ $admin_options[email_form_submissions] = $_POST[email_form_submissions];
291
  $admin_options[author_link] = $_POST[author_link];
292
+ $admin_options[admin_ajax] = $_POST[admin_ajax];
293
  $admin_options[enable_jquery] = $_POST[enable_jquery];
294
  $admin_options[code_type] = $_POST[code_type];
295
  $admin_options[form_success_message] = $_POST[form_success_message];
309
  } elseif ($_POST[form_edit]) {
310
  parent::updateForm($_POST[form], $_POST[fid]);
311
  } elseif ($_POST[form_add_field]) {
312
+ parent::addFieldToForm($_POST[attach_object_id], $_POST[fid]);
313
  } elseif ($_POST[attach_field_option]) {
314
+ parent::addFieldOptionToField($_POST[attach_object_id], $_POST[fid]);
315
  } elseif ($_POST[dettach_field]) {
316
+ parent::dettachField($_POST[dettach_object_id], $_POST[fid]);
317
  } elseif ($_POST[dettach_field_option]) {
318
+ parent::dettachFieldOption($_POST[dettach_object_id], $_POST[fid]);
319
  } elseif ($_POST[style_create]) {
320
  parent::insertStyle($_POST[style]);
321
  } elseif ($_POST[style_edit]) {
331
  parent::updateFieldOption($_POST[option], $_POST[oid]);
332
  } elseif ($_POST[create_field_option]) {
333
  parent::insertFieldOption($_POST[option]);
334
+ } elseif ($_POST[form_submission_delete]) {
335
+ parent::deleteUserData($_POST[uid]);
336
+ } elseif ($_POST[ccf_import]) {
337
+ require_once('custom-contact-forms-export.php');
338
+ $transit = new CustomContactFormsExport($this->adminOptionsName);
339
+ $transit->importFromFile($_FILES[import_file]);
340
+ } elseif ($_POST[ajax_action]) {
341
+ switch ($_POST[ajax_action]) {
342
+ case 'delete':
343
+ if (empty($_POST[object_id])) exit;
344
+ switch($_POST[object_type]) {
345
+ case 'form':
346
+ parent::deleteForm($_POST[object_id]);
347
+ break;
348
+ case 'field':
349
+ parent::deleteField($_POST[object_id]);
350
+ break;
351
+ case 'field_option':
352
+ parent::deleteFieldOption($_POST[object_id]);
353
+ break;
354
+ case 'form_submission':
355
+ parent::deleteUserData($_POST[object_id]);
356
+ break;
357
+ case 'style':
358
+ parent::deleteStyle($_POST[object_id]);
359
+ break;
360
+ }
361
+ break;
362
+ case 'create_field_option':
363
+ parent::insertFieldOption($_POST[option]);
364
+ break;
365
+ case 'attach':
366
+ echo '<div style="margin-left:20px;">';
367
+ print_r($_POST);
368
+ echo '</div>';
369
+ switch ($_POST[object_type]) {
370
+ case 'form':
371
+ echo ' -> ' . $_POST[attach_object_id] .' - '. $_POST[attach_to];
372
+ parent::addFieldToForm($_POST[attach_object_id], $_POST[attach_to]);
373
+ break;
374
+ case 'field':
375
+ parent::addFieldOptionToField($_POST[attach_object_id], $_POST[attach_to]);
376
+ break;
377
+ }
378
+ break;
379
+ case 'edit':
380
+ if (empty($_POST[object_id])) exit;
381
+ switch($_POST[object_type]) {
382
+ case 'form':
383
+ if (!empty($_POST[form])) parent::updateForm($_POST[form], $_POST[object_id]);
384
+ break;
385
+ case 'field':
386
+ if (!empty($_POST[field])) parent::updateField($_POST[field], $_POST[object_id]);
387
+ break;
388
+ case 'field_option':
389
+ if (!empty($_POST[option])) parent::updateFieldOption($_POST[option], $_POST[object_id]);
390
+ break;
391
+ case 'style':
392
+ if (!empty($_POST[style])) parent::updateStyle($_POST[style], $_POST[object_id]);
393
+ break;
394
+ }
395
+ break;
396
+ }
397
+ exit;
398
+ } if ($_GET[clear_tables] == 1 && $_GET[confirm] == 1) {
399
+
400
  }
401
+
402
  $styles = parent::selectAllStyles();
403
  $style_options = '<option value="0">Default</option>';
404
  foreach ($styles as $style)
415
  <li><a href="#manage-fields">Manage Fields</a></li>
416
  <li><a href="#manage-fixed-fields">Manage Fixed Fields</a></li>
417
  <li><a href="#manage-forms">Manage Forms</a></li>
418
+ <li><a href="#form-submissions">Saved Form Submissions (New!)</a></li>
419
  <li><a href="#create-styles">Create Styles</a></li>
420
  <li><a href="#manage-styles">Manage Styles</a></li>
421
  <li><a href="#manage-field-options">Manage Field Options</a></li>
422
  <li><a href="#contact-author">Suggest a Feature</a></li>
423
  <li><a href="#contact-author">Bug Report</a></li>
424
+ <li><a href="#custom-html">Custom HTML Forms</a></li>
425
+ <li><a href="#import-export">Import / Export (New!)</a></li>
426
  <li class="last"><a href="#plugin-news">Plugin News</a></li>
427
  </ul>
428
  <a class="rate-me" href="http://wordpress.org/extend/plugins/custom-contact-forms" title="Rate This Plugin">We need your help to continue development! Please <span>rate this plugin</span> to show your support.</a>
 
429
  <a name="create-fields"></a>
430
  <div id="create-fields" class="postbox">
431
  <h3 class="hndle"><span>Create A Form Field</span></h3>
434
  <ul>
435
  <li>
436
  <label for="field_slug">* Slug (Name):</label>
437
+ <input name="field[field_slug]" type="text" maxlength="40" /><br />
438
  (A slug is simply a way to identify your field. It can only contain underscores, letters, and numbers and must be unique.)</li>
439
  <li>
440
  <label for="field_label">Field Label:</label>
562
 
563
  ?>
564
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
565
+ <tr<?php if ($z % 2 == 1) echo ' class="evenrow"'; ?>>
566
 
567
  <td><input type="text" name="field[field_slug]" class="width100" maxlength="50" value="<?php echo $fields[$i]->field_slug; ?>" /></td>
568
  <td><input type="text" name="field[field_label]" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" /></td>
578
  <input type="text" class="width50" name="field[field_maxlength]" value="<?php echo $fields[$i]->field_maxlength; ?>" />
579
  <?php } ?>
580
  </td>
581
+ <td><input type="hidden" class="object-type" name="object_type" value="field" />
582
+ <input type="hidden" class="object-id" name="fid" value="<?php echo $fields[$i]->id; ?>" />
583
  <span class="fields-options-expand"></span>
584
+ <input type="submit" class="edit-button" name="field_edit" value="Save" />
585
+ <input type="submit" name="field_delete" class="delete-button" value="Delete" /></td>
586
 
587
  </tr>
588
  <tr<?php if ($z % 2 == 1) echo ' class="evenrow"'; ?>>
589
+ <td class="fields-extra-options" colspan="7">
590
  <div class="field-instructions">
591
  <label for="field_instructions">Field Instructions:</label>
592
  <input type="text" class="width150" name="field[field_instructions]" value="<?php echo $fields[$i]->field_instructions; ?>" />
595
  if ($fields[$i]->field_type == 'Radio' || $fields[$i]->field_type == 'Dropdown') { ?>
596
  <div class="dettach-field-options">
597
  <?php if (empty($attached_options)) { ?>
598
+ <select name="dettach_object_id"><option value="-1">Nothing Attached!</option></select>
599
  <?php } else { ?>
600
+ <select name="dettach_object_id">
601
  <?php
602
  foreach ($attached_options as $option_id) {
603
  $option = parent::selectFieldOption($option_id);
607
  }
608
  ?>
609
  </select>
610
+ <input type="submit" class="dettach-button" name="dettach_field_option" value="Dettach Field Option" />
611
  <?php } ?>
612
  <br /><span class="red bold">*</span> Dettach field options you <a href="#create-field-options">create</a>.
613
  </div>
616
  <?php if (empty($all_options)) { ?>
617
  <b>No Field Options to Attach</b>
618
  <?php } else { ?>
619
+ <select name="attach_object_id" class="onObject<?php echo $fields[$i]->id ?>">
620
  <?php echo $all_options; ?>
621
+ </select> <input type="submit" class="attach-button" name="attach_field_option" value="Attach Field Option" />
622
  <?php } ?>
623
  <br /><span class="red bold">*</span> Attach field options in the order you want them to display.
624
  </div>
665
 
666
  ?>
667
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
668
+ <tr <?php if ($z % 2 == 0) echo ' class="evenrow"'; ?>>
669
 
670
  <td><?php echo $fields[$i]->field_slug; ?></td>
671
  <td><input type="text" name="field[field_label]" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" /></td>
691
  <?php } ?>
692
  </td>
693
 
694
+ <td><input type="hidden" class="object-type" name="object_type" value="field" />
695
+ <input type="hidden" class="object-id" name="fid" value="<?php echo $fields[$i]->id; ?>" />
696
  <span class="fixed-fields-options-expand"></span>
697
+ <input type="submit" name="field_edit" class="edit-button" value="Save" /></td>
698
  </tr>
699
+ <tr <?php if ($z % 2 == 0) echo ' class="evenrow"'; ?>>
700
+ <td class="fixed-fields-extra-options" colspan="7">Field Instructions: <input type="text" name="field[field_instructions]" class="width200" value="<?php echo $fields[$i]->field_instructions; ?>" /> - <?php echo $GLOBALS[ccf_fixed_fields][$fields[$i]->field_slug]; ?></td>
701
  </tr>
702
  </form>
703
  <?php
737
  <td class="label"><input type="text" name="option[option_label]" value="<?php echo $option->option_label; ?>" class="width100" /></td>
738
  <td class="option-value"><input type="text" name="option[option_value]" value="<?php echo $option->option_value; ?>" class="width100" /></td>
739
  <td class="action">
740
+ <input type="submit" value="Save" class="edit-button" name="edit_field_option" />
741
+ <input type="submit" class="delete-button" value="Delete" name="delete_field_option" />
742
  </td>
743
+ <input type="hidden" class="object-type" name="object_type" value="field_option" />
744
+ <input type="hidden" class="object-id" name="oid" value="<?php echo $option->id; ?>" />
745
  </form>
746
  </tr>
747
  <?php
760
  <div class="action">Action</div>
761
  </div>
762
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']?>">
763
+ <input type="hidden" name="object_type" value="field_option" />
764
  <div class="create-field-options-header">Create a Field Option</div>
765
  <ul id="create-field-options">
766
  <li><label for="option[option_slug]">* Option Slug:</label> <input maxlength="20" type="text" name="option[option_slug]" /><br />
769
  (This is what is shown to the user in the dropdown or radio field. Example:)</li>
770
  <li><label for="option[option_value]">Option Value:</label> <input type="text" name="option[option_value]" /><br />
771
  (This is the actual value of the option which isn't shown to the user. This can be the same thing as the label. An example pairing of label => value is: "The color green" => "green" or "Yes" => "1".)</li>
772
+ <li><input type="submit" class="create-button" name="create_field_option" value="Create Field Option" /></li>
773
  </ul>
774
  <p id="edit-field-comments"><b>*</b> The option value is behind the scences; unseen by the user, but when a user fills out the form, the option value is what is actually sent in the email to you. For dropdown fields the option value is optional, for radio fields it is required.</p>
775
  </form>
805
  <td><input type="text" class="width125" name="form[form_title]" value="<?php echo $forms[$i]->form_title; ?>" /></td>
806
  <td><input class="width100" type="text" name="form[submit_button_text]" value="<?php echo $forms[$i]->submit_button_text; ?>" /></td>
807
  <td><select name="form[form_style]"><?php echo $sty_opt; ?></select></td>
808
+ <td><input type="hidden" class="object-id" name="fid" value="<?php echo $forms[$i]->id; ?>" />
809
+ <input type="hidden" class="object-type" name="object_type" value="form" />
810
  <span class="form-options-expand"></span>
811
+ <input type="submit" name="form_edit" class="edit-button" value="Save" />
812
+ <input type="submit" name="form_delete" class="delete-button" value="Delete" />
813
  </td>
814
  </tr>
815
  <tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
816
+ <td class="form-extra-options textcenter" colspan="8">
817
  <table class="form-extra-options-table">
818
  <tbody>
819
  <tr>
825
  <td class="bold">Custom Success URL</td>
826
  </tr>
827
  <tr>
828
+ <td><a href="javascript:void(0)" class="toollink" title="The Form Method is the method by which information is transfer through your form. If you aren't an expert with HTML and PHP, leave this as Post.">(?)</a> <select name="form[form_method]"><?php echo $form_methods; ?></select></td>
829
+ <td><a href="javascript:void(0)" class="toollink" title="This lets you process your forms through alternate scripts. If you use a service like InfusionSoft or Aweber, set this to be the same form action as the code provided to you by that service, otherwise leave this blank.">(?)</a> <input class="width100" type="text" name="form[form_action]" value="<?php echo $forms[$i]->form_action; ?>" /></td>
830
+ <td><a href="javascript:void(0)" class="toollink" title="This email address will recieve form emails (provided that Email Form Submissions is set to Yes in general settings).">(?)</a> <input class="width100" type="text" name="form[form_email]" value="<?php echo $forms[$i]->form_email; ?>" /></td>
831
+ <td><a href="javascript:void(0)" class="toollink" title="This will be displayed as the header in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.">(?)</a> <input class="width100" type="text" name="form[form_success_title]" value="<?php echo $forms[$i]->form_success_title; ?>" /></td>
832
+ <td><a href="javascript:void(0)" class="toollink" title="This will be displayed in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.">(?)</a> <input type="text" name="form[form_success_message]" class="width100" value="<?php echo $forms[$i]->form_success_message; ?>" /></td>
833
+ <td><a href="javascript:void(0)" class="toollink" title="If this is filled out, users will be sent to this thank you page when they successfully fill out this form. If it is left blank, a popover showing the form's 'success message' will be displayed on form success.">(?)</a> <input type="text" class="width100" name="form[form_thank_you_page]" value="<?php echo $forms[$i]->form_thank_you_page; ?>" /></td>
834
  </tr>
835
  <tr>
836
  <td colspan="3">
837
+ <label for="dettach_object_id"><span>Attached Fields:</span></label>
838
  <?php
839
  $attached_fields = parent::getAttachedFieldsArray($forms[$i]->id);
840
+ if (empty($attached_fields)) echo '<select name="dettach_object_id"><option value="-1">Nothing Attached!</option></select> ';
841
  else {
842
+ echo '<select name="dettach_object_id">';
843
  foreach($attached_fields as $attached_field) {
844
  $this_field = parent::selectField($attached_field, '');
845
  echo $this_field->field_slug . ' <option value="'.$this_field->id.'">'.$this_field->field_slug.'</option>';
846
  }
847
+ echo '</select> <input type="submit" class="dettach-button" value="Dettach Field" name="dettach_field" />';
848
  }
849
  ?><br />
850
  <span class="red bold">*</span> Attach fields in the order you want them displayed.
851
  </td>
852
  <td colspan="3">
853
  <label for="field_id"><span>Attach Field:</span></label>
854
+ <select class="onObject<?php echo $forms[$i]->id; ?>" name="attach_object_id"><?php echo $add_fields; ?></select> <input class="attach-button" type="submit" name="form_add_field" value="Attach Field" />
855
  <br /><span class="red bold">*</span> Attach fixed fields or ones you <a href="#create-fields">create</a>.
856
  </td>
857
  </tr>
858
  <tr>
859
+ <td colspan="6"><label for="theme_code_<?php echo $forms[$i]->id; ?>"><a href="javascript:void(0)" class="toollink" title="The form display code above ([customcontact form=x]) will only work in Wordpress pages and posts. If you want to display this form in a theme file such as page.php, header.php, index.php, category.php, etc, then insert this PHP snippet.">(?)</a> <span>Code to Display Form in Theme Files:</span></label> <input type="text" class="width225" value="&lt;?php if (function_exists('serveCustomContactForm')) { serveCustomContactForm(<?php echo $forms[$i]->id; ?>); } ?&gt;" name="theme_code_<?php echo $forms[$i]->id; ?>" /> <label for="form[custom_code]"><a href="javascript:void(0)" class="toollink" title="This field allows you to insert HTML directly after the starting <form> tag.">(?)</a> Custom Code:</label> <input name="form[custom_code]" type="text" value="<?php echo $forms[$i]->custom_code; ?>" /></td>
860
  </tr>
861
  </tbody>
862
  </table>
886
  </tr>
887
 
888
  </tfoot>
889
+ </table>
890
+ <?php
891
+ require_once('custom-contact-forms-user-data.php');
892
+ $user_data_array = parent::selectAllUserData();
893
+ ?>
894
+ <a name="form-submissions"></a>
895
+ <h3 class="manage-h3">Saved Form Submissions</h3>
896
+ <table class="widefat post" id="form-submissions" cellspacing="0">
897
+ <thead>
898
+ <tr>
899
+ <th scope="col" class="manage-column width250">Date Submitted</th>
900
+ <th scope="col" class="manage-column width150">Form Submitted</th>
901
+ <th scope="col" class="manage-column width250">Form Page</th>
902
+ <th scope="col" class="manage-column "><div class="alignright">Action</div></th>
903
+ </tr>
904
+ </thead>
905
+ <tbody>
906
+ <?php
907
+ $i = 0;
908
+ foreach ($user_data_array as $data_object) {
909
+ $data = new CustomContactFormsUserData(array('form_id' => $data_object->data_formid, 'data_time' => $data_object->data_time, 'form_page' => $data_object->data_formpage, 'encoded_data' => $data_object->data_value));
910
+ ?>
911
+ <tr class="submission-top <?php if ($i % 2 == 0) echo 'evenrow'; ?>">
912
+ <td><?php echo date('F d, Y h:i:s A', $data->getDataTime()); ?></td>
913
+ <td>
914
+ <?php
915
+ if ($data->getFormID() > 0) {
916
+ $data_form = parent::selectForm($data->getFormID());
917
+ echo $data_form->form_slug;
918
+ } else
919
+ echo 'Custom HTML Form'
920
+ ?>
921
+ </td>
922
+ <td>
923
+ <?php echo $data->getFormPage(); ?>
924
+ </td>
925
+ <td class="alignright">
926
+ <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
927
+ <span class="submission-content-expand"></span>
928
+ <input type="submit" class="delete-button" value="Delete" name="form_submission_delete" />
929
+ <input type="hidden" class="object-type" name="object_type" value="form_submission" />
930
+ <input type="hidden" class="object-id" value="<?php echo $data_object->id; ?>" name="uid" />
931
+ </form>
932
+ </td>
933
+ </tr>
934
+ <tr class="submission-content <?php if ($i % 2 == 0) echo 'evenrow'; ?>">
935
+ <td colspan="4">
936
+ <ul>
937
+ <?php
938
+ $data_array = $data->getDataArray();
939
+ foreach ($data_array as $item_key => $item_value) {
940
+ ?>
941
+ <li>
942
+ <div><?php echo $item_key; ?></div>
943
+ <p><?php echo $item_value; ?></p>
944
+ </li>
945
+ <?php
946
+ }
947
+ ?>
948
+ </ul>
949
+ </td>
950
+ </tr>
951
+ <?php
952
+ $i++;
953
+ }
954
+ ?>
955
+ </tbody>
956
+ <tfoot>
957
+ <tr>
958
+ <th scope="col" class="manage-column width250">Date Submitted</th>
959
+ <th scope="col" class="manage-column width150">Form Submitted</th>
960
+ <th scope="col" class="manage-column width250">Form Page</th>
961
+ <th scope="col" class="manage-column "><div class="alignright">Action</div></th>
962
+ </tr>
963
+ </tfoot>
964
+ </table>
965
+
966
+ <a name="general-settings"></a>
967
  <div id="general-settings" class="postbox">
968
  <h3 class="hndle"><span>General Settings</span></h3>
969
  <div class="inside">
970
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
971
  <ul>
972
+ <li>
973
+ <label for="email_form_submissions">Email Form Submissions:</label>
974
+ <select name="email_form_submissions"><option value="1">Yes</option><option value="0" <?php if ($admin_options[email_form_submissions] == 0) echo 'selected="selected"'; ?>>No</option></select>
975
+ </li>
976
+ <li class="descrip">When a user fills out one of your forms, the info he submitted is saved in the Saved Form Submission section of the admin panel for you to view. If this is enabled, you will also be sent an email containing the submission info.</li>
977
+
978
  <li>
979
  <label for="default_to_email">Default Email:</label>
980
  <input name="default_to_email" value="<?php echo $admin_options[default_to_email]; ?>" type="text" maxlength="100" />
982
  <li class="descrip">Form emails will be sent <span>to</span> this address, if no destination email is specified by the form.</li>
983
 
984
  <li>
985
+ <label for="enable_jquery">Front End JQuery:</label>
986
+ <select name="enable_jquery"><option value="1">Enabled</option><option <?php if ($admin_options[enable_jquery] != 1) echo 'selected="selected"'; ?> value="0">Disabled</option></select>
987
  </li>
988
  <li class="descrip">Some plugins don't setup JQuery correctly, so when any other plugin uses JQuery (whether correctly or not), JQuery works for neither plugin. This plugin uses JQuery correctly. If another plugin isn't using JQuery correctly but is more important to you than this one: disable this option. 99% of this plugin's functionality will work without JQuery, just no field instruction tooltips.</li>
989
 
1015
  </li>
1016
  <li class="descrip">Selecting yes will make form fields remember how they were last filled out.</li>
1017
  <li>
1018
+ <label for="enable_widget_tooltips">Tooltips in Widget:</label>
1019
+ <select name="enable_widget_tooltips"><option value="1">Enabled</option><option <?php if ($admin_options[enable_widget_tooltips] == 0) echo 'selected="selected"'; ?> value="0">Disabled</option></select>
1020
  </li>
1021
  <li class="descrip">Enabling this shows tooltips containing field instructions on forms in the widget.</li>
1022
  <li>
1028
  <select name="code_type"><option>XHTML</option><option <?php if ($admin_options[code_type] == 'HTML') echo 'selected="selected"'; ?>>HTML</option></select>
1029
  </li>
1030
  <li class="descrip">This lets you switch the form code between HTML and XHTML.</li>
1031
+ <li>
1032
+ <label for="admin_ajax">Fancy Admin AJAX Abilities:</label>
1033
+ <select name="admin_ajax"><option value="1">Enabled</option><option <?php if ($admin_options[admin_ajax] == 0) echo 'selected="selected"'; ?>>Disabled</option></select>
1034
+ </li>
1035
+ <li class="descrip">If you enable this, creating, editing and modifying forms, fields, styles, etc in the admin panel will be done using AJAX. This means that clicking things like "Edit" or "Delete" will not cause the page to reload thus managing your forms will be much smoother and quicker. If you are having problems with things not saving, deleting, or inserting correctly, then disable this and fill out a bug report below.</li>
1036
  <li>
1037
  <label for="wp_mail_function">Use Wordpress Mail Function:</label>
1038
  <select name="wp_mail_function"><option value="1">Yes</option><option <?php if ($admin_options[wp_mail_function] == 0) echo 'selected="selected"'; ?> value="0">No</option></select>
1042
  <li>
1043
  <label>
1044
  <input value="1" type="checkbox" name="show_widget_home" <?php if ($admin_options[show_widget_home] == 1) echo 'checked="checked"'; ?> />
1045
+ On Homepage</label>
 
 
1046
  <label>
1047
  <input value="1" type="checkbox" name="show_widget_pages" <?php if ($admin_options[show_widget_pages] == 1) echo 'checked="checked"'; ?> />
1048
+ On Pages</label>
 
 
1049
  <label>
1050
  <input value="1" type="checkbox" name="show_widget_singles" <?php if ($admin_options[show_widget_singles] == 1) echo 'checked="checked"'; ?> />
1051
+ On Single Posts</label><br />
 
 
1052
  <label>
1053
  <input value="1" type="checkbox" name="show_widget_categories" <?php if ($admin_options[show_widget_categories] == 1) echo 'checked="checked"'; ?> />
1054
+ On Categories</label>
 
 
1055
  <label>
1056
  <input value="1" type="checkbox" name="show_widget_archives" <?php if ($admin_options[show_widget_archives] == 1) echo 'checked="checked"'; ?> />
1057
  On Archives</label>
1058
  </li>
1059
  <li>
1060
+ <input type="submit" value="Update" name="general_settings" />
1061
  </li>
1062
  </ul>
1063
  </form>
1092
  <div id="create-styles" class="postbox">
1093
  <h3 class="hndle"><span>Create A Style for Your Forms</span></h3>
1094
  <div class="inside">
1095
+ <p>Use this manager to create styles for your forms. Each field is already filled out with nice look defaults. It is recommended you simply input a slug and click create to see the defaults before you start changing values.</p>
1096
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1097
+ <ul class="style_left">
1098
  <li>
1099
  <label for="style_slug">* Style Slug:</label>
1100
  <input type="text" maxlength="30" class="width75" name="style[style_slug]" />
1109
  (ex: FF0000)</li>
1110
  <li>
1111
  <label for="label_width">Label Width:</label>
1112
+ <input type="text" maxlength="20" value="200px" class="width75" name="style[label_width]" />
1113
  (ex: 100px or 20%)</li>
1114
  <li>
1115
  <label for="label_fontsize">Label Font Size:</label>
1129
  (ex: 100px or 100%)</li>
1130
  <li>
1131
  <label for="textarea_height">Textarea Field Height:</label>
1132
+ <input type="text" maxlength="20" value="90px" class="width75" name="style[textarea_height]" />
1133
  (ex: 100px or 100%)</li>
1134
  <li>
1135
  <label for="field_fontsize">Field Font Size:</label>
1136
+ <input type="text" maxlength="20" value="1.3em" class="width75" name="style[field_fontsize]" />
1137
  (ex: 10px, 10pt, 1em</li>
1138
  <li>
1139
  <label for="field_fontcolor">Field Font Color:</label>
1145
  </li>
1146
  <li>
1147
  <label for="form_margin">Form Margin:</label>
1148
+ <input type="text" maxlength="20" value="7px" class="width75" name="style[form_margin]" />
1149
  (ex: 5px or 1em)</li>
1150
  <li>
1151
  <label for="label_margin">Label Margin:</label>
1152
+ <input type="text" maxlength="20" value="5px" class="width75" name="style[label_margin]" />
1153
  (ex: 5px or 1em)</li>
1154
  <li>
1155
  <label for="textarea_backgroundcolor">Textarea Background Color:</label>
1156
+ <input type="text" maxlength="20" value="f5f5f5" class="width75 colorfield" name="style[textarea_backgroundcolor]" />
1157
  (ex: FF0000)</li>
1158
  <li>
1159
  <label for="success_popover_fontcolor">Success Popover Font Color:</label>
1161
  (ex: 333333)</li>
1162
  <li>
1163
  <label for="success_popover_title_fontsize">Success Popover Title Font Size:</label>
1164
+ <input type="text" maxlength="20" value="15px" class="width75" name="style[success_popover_title_fontsize]" />
1165
+ (ex: 12px, 1em, 100%)</li>
1166
+ <li>
1167
+ <label for="form_backgroundcolor">Form Background Color:</label>
1168
+ <input type="text" maxlength="20" value="ffffff" class="width75 colorfield" name="style[form_backgroundcolor]" />
1169
  (ex: 12px, 1em, 100%)</li>
1170
+ <li>
1171
+ <label for="tooltip_backgroundcolor">Tooltip Background Color:</label>
1172
+ <input type="text" maxlength="20" value="000000" class="width75 colorfield" name="style[tooltip_backgroundcolor]" />
1173
+ (ex: 000000 or black)</li>
1174
  </ul>
1175
  <ul class="style_right">
1176
  <li>
1177
  <label for="input_width">Field Border Color:</label>
1178
+ <input type="text" maxlength="20" value="999999" class="width75 colorfield" name="style[field_bordercolor]" />
1179
  (ex: 100px or 100%)</li>
1180
  <li>
1181
  <label for="form_borderstyle">Form Border Style:</label>
1182
+ <select class="width75" name="style[form_borderstyle]"><?php echo $border_style_options; ?></select>
1183
  </li>
1184
  <li>
1185
  <label for="form_bordercolor">Form Border Color:</label>
1186
+ <input type="text" maxlength="20" value="ffffff" class="width75 colorfield" name="style[form_bordercolor]" />
1187
  (ex: 000000)</li>
1188
  <li>
1189
  <label for="form_borderwidth">Form Border Width:</label>
1190
+ <input type="text" maxlength="20" value="0px" class="width75" name="style[form_borderwidth]" />
1191
  (ex: 1px)</li>
1192
  <li>
1193
  <label for="form_borderwidth">Form Width:</label>
1194
+ <input type="text" maxlength="20" value="100%" class="width75" name="style[form_width]" />
1195
  (ex: 100px or 50%)</li>
1196
  <li>
1197
  <label for="form_borderwidth">Form Font Family:</label>
1198
+ <input type="text" maxlength="120" value="Verdana, tahoma, arial" class="width75" name="style[form_fontfamily]" />
1199
  (ex: Verdana, Tahoma, Arial)</li>
1200
  <li>
1201
  <label for="submit_width">Button Width:</label>
1202
+ <input type="text" maxlength="20" value="auto" class="width75" name="style[submit_width]" />
1203
+ (ex: 100px, 30%, auto)</li>
1204
  <li>
1205
  <label for="submit_height">Button Height:</label>
1206
+ <input type="text" maxlength="20" value="30px" class="width75" name="style[submit_height]" />
1207
  (ex: 100px or 30%)</li>
1208
  <li>
1209
  <label for="submit_fontsize">Button Font Size:</label>
1215
  (ex: FF0000)</li>
1216
  <li>
1217
  <label for="field_backgroundcolor">Field Background Color:</label>
1218
+ <input type="text" maxlength="20" value="f5f5f5" class="width75 colorfield" name="style[field_backgroundcolor]" />
1219
  (ex: FF0000)</li>
1220
  <li>
1221
  <label for="form_padding">Form Padding:</label>
1222
+ <input type="text" maxlength="20" value="8px" class="width75" name="style[form_padding]" />
1223
  (ex: 5px or 1em)</li>
1224
  <li>
1225
  <label for="title_margin">Title Margin:</label>
1226
+ <input type="text" maxlength="20" value="5px" class="width75" name="style[title_margin]" />
1227
  (ex: 5px or 1em)</li>
1228
  <li>
1229
  <label for="title_margin">Dropdown Width:</label>
1237
  <label for="success_popover_fontsize">Success Popover Font Size:</label>
1238
  <input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_fontsize]" />
1239
  (ex: 12px, 1em, 100%)</li>
 
 
 
 
1240
  <li>
1241
  <label for="success_popover_height">Success Popover Height:</label>
1242
  <input type="text" maxlength="20" value="200px" class="width75" name="style[success_popover_height]" />
1243
  (ex: 200px, 6em, 50%)</li>
1244
+ <li>
1245
+ <label for="field_borderround">Field Border Roundness:</label>
1246
+ <input type="text" maxlength="20" value="6px" class="width75" name="style[field_borderround]" />
1247
+ (ex: 6px, or 0px)</li>
1248
+ <li>
1249
+ <label for="tooltip_fontsize">Tooltip <a href="javascript:void(0)" class="toollink" title="A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.">(?)</a> Font Size:</label>
1250
+ <input type="text" maxlength="20" value="12px" class="width75" name="style[tooltip_fontsize]" />
1251
+ (ex: 12px, 1em, 100%)</li>
1252
+ <li>
1253
+ <label for="tooltip_fontcolor">Tooltip Font Color:</label>
1254
+ <input type="text" maxlength="20" value="ffffff" class="width75 colorfield" name="style[tooltip_fontcolor]" />
1255
+ (ex: ffffff or white)</li>
1256
  <li>
1257
  <input type="submit" value="Create Style" name="style_create" />
1258
  </li>
1281
  <tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
1282
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1283
  <td><label>* Slug:</label> <input type="text" maxlength="30" value="<?php echo $style->style_slug; ?>" name="style[style_slug]" /><br />
1284
+ <label>Font Family:</label><input type="text" maxlength="120" value="<?php echo $style->form_fontfamily; ?>" name="style[form_fontfamily]" /><br />
1285
  <label>Textarea Background<br />Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->textarea_backgroundcolor; ?>" name="style[textarea_backgroundcolor]" /><br />
1286
  <label>Success Popover<br />Border Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_bordercolor; ?>" name="style[success_popover_bordercolor]" /><br />
1287
+ <label>Tooltip <a href="javascript:void(0)" class="toollink" title="A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.">(?)</a> Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->tooltip_fontcolor; ?>" name="style[tooltip_fontcolor]" /><br />
1288
+ <input type="submit" class="submit-styles edit-button" name="style_edit" value="Save" /><br />
1289
+ <input type="submit" class="submit-styles delete-button" name="style_delete" value="Delete Style" />
1290
  </td>
1291
 
1292
  <td>
1305
  <label>Field Background Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_backgroundcolor; ?>" name="style[field_backgroundcolor]" /><br />
1306
  <label>Title Margin:</label><input type="text" maxlength="20" value="<?php echo $style->title_margin; ?>" name="style[title_margin]" /><br />
1307
  <label>Success Popover<br />Title Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->success_popover_title_fontsize; ?>" name="style[success_popover_title_fontsize]" />
1308
+ <label>Form Background Color:</label><input type="text" class="colorfield" maxlength="20" value="<?php echo $style->form_backgroundcolor; ?>" name="style[form_backgroundcolor]" />
1309
  </td>
1310
 
1311
  <td>
1314
  <label>Field Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->field_fontsize; ?>" name="style[field_fontsize]" /><br />
1315
  <label>Button Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->submit_fontsize; ?>" name="style[submit_fontsize]" /><br />
1316
  <label>Form Padding:</label><input type="text" maxlength="20" value="<?php echo $style->form_padding; ?>" name="style[form_padding]" /><br />
1317
+ <label>Success Popover<br />Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->success_popover_fontsize; ?>" name="style[success_popover_fontsize]" /><br />
1318
+ <label>Tooltip <a href="javascript:void(0)" class="toollink" title="A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.">(?)</a> Background Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->tooltip_backgroundcolor; ?>" name="style[tooltip_backgroundcolor]" />
1319
  </td>
1320
 
1321
  <td>
1325
  <label>Button Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->submit_fontcolor; ?>" name="style[submit_fontcolor]" /><br />
1326
  <label>Form Margin:</label><input type="text" maxlength="20" value="<?php echo $style->form_margin; ?>" name="style[form_margin]" /><br />
1327
  <label>Success Popover<br />Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_fontcolor; ?>" name="style[success_popover_fontcolor]" /><br />
1328
+ <label>Tooltip Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->tooltip_fontsize; ?>" name="style[tooltip_fontsize]" />
1329
  </td>
1330
 
1331
  <td><label>Form Border Style:</label><select name="style[form_borderstyle]"><?php echo str_replace('<option>'.$style->form_borderstyle.'</option>', '<option selected="selected">'.$style->form_borderstyle.'</option>', $border_style_options); ?></select><br />
1334
  <label>Field Border Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_bordercolor; ?>" name="style[field_bordercolor]" /><br />
1335
  <label>Field Border Style:</label><select name="style[field_borderstyle]"><?php echo str_replace('<option>'.$style->field_borderstyle.'</option>', '<option selected="selected">'.$style->field_borderstyle.'</option>', $border_style_options); ?></select><br />
1336
  <label>Success Popover<br />Title Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_title_fontcolor; ?>" name="style[success_popover_title_fontcolor]" /><br />
1337
+ <label>Field Border Roundness:</label><input name="style[field_borderround]" value="<?php echo $style->field_borderround; ?>" type="text" maxlength="20" /><br />
1338
+ <input type="hidden" class="object-type" name="object_type" value="style" />
1339
+ <input name="sid" type="hidden" class="object-id" value="<?php echo $style->id; ?>" />
1340
  </td>
1341
 
1342
  </form>
1368
  <input id="email" type="text" value="<?php echo get_option('admin_email'); ?>" name="email" maxlength="100" /></li>
1369
  <li><label for="message">* Your Message:</label>
1370
  <textarea id="message" name="message"></textarea></li>
1371
+ <li><label for="type">* Purpose of this message:</label> <select id="type" name="type"><option>Bug Report</option><option>Suggest a Feature</option><option>Plugin Question</option></select></li>
1372
  </ul>
1373
  <p><input type="submit" name="contact_author" value="Send Message" /></p>
1374
  </form>
1398
  &lt;/form&gt;</textarea>
1399
  </div>
1400
  </div>
1401
+ <a name="import-export"></a>
1402
+ <div id="import-export" class="postbox">
1403
+ <h3 class="hndle"><span>Import / Export</span></h3>
1404
+ <div class="inside">
1405
+ <form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1406
+ <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
1407
+ <div class="import">
1408
+ <p>Browse to a CCF .sql export file to import Custom Contact Form data from another Wordpress installation to this one.</p>
1409
+ <input type="file" name="import_file" /> <input name="ccf_import" type="submit" value="Import" />
1410
+ </div>
1411
+ <div class="export">
1412
+ <p>Preforming a Custom Contact Forms export will create a file of the form
1413
+ ccf-export-xxxx.sql on your web server. The file created contains SQL that
1414
+ will recreate all the plugin data on any Wordpress installation.</p>
1415
+ <input type="submit" name="ccf_export" value="Export All CCF Plugin Content" />
1416
+ </div>
1417
+ </form>
1418
+ </div>
1419
+ </div>
1420
  <a name="plugin-news"></a>
1421
  <div id="plugin-news" class="postbox">
1422
  <h3 class="hndle"><span>Custom Contact Forms Plugin News</span></h3>
1482
 
1483
  function displayPluginNewsFeed() {
1484
  include_once(ABSPATH . WPINC . '/feed.php');
1485
+ $rss = @fetch_feed('http://www.taylorlovett.com/category/custom-contact-forms/feed');
1486
+ if (!is_wp_error($rss) ) {
1487
  $maxitems = $rss->get_item_quantity(5);
1488
  $rss_items = $rss->get_items(0, 1);
1489
  $rss_items2 = $rss->get_items(1, $maxitems);
1553
  $style = parent::selectStyle($form->form_style, '');
1554
  $style_class = $style->style_slug;
1555
  }
1556
+ $form_title = CustomContactFormsStatic::decodeOption($form->form_title, 1, 1);
1557
  $action = (!empty($form->form_action)) ? $form->form_action : $_SERVER['REQUEST_URI'];
1558
  $out .= '<form id="'.$form_id.'" method="'.strtolower($form->form_method).'" action="'.$action.'" class="'.$style_class.'">' . "\n";
1559
+ $out .= CustomContactFormsStatic::decodeOption($form->custom_code, 1, 1) . "\n";
1560
  if (!empty($form_title)) $out .= '<h4 id="h4-' . $form->id . '-' . $form_key . '">' . $form_title . '</h4>' . "\n";
1561
  $fields = parent::getAttachedFieldsArray($fid);
1562
  $hiddens = '';
1565
  $field = parent::selectField($field_id, '');
1566
  $req = ($field->field_required == 1 or $field->field_slug == 'ishuman') ? '* ' : '';
1567
  $req_long = ($field->field_required == 1) ? ' (required)' : '';
1568
+ $input_id = 'id="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'-'.$form_key.'"';
1569
+ $field_value = CustomContactFormsStatic::decodeOption($field->field_value, 1, 1);
1570
  $instructions = (empty($field->field_instructions)) ? '' : 'title="' . $field->field_instructions . $req_long . '" class="ccf-tooltip-field"';
1571
  if ($admin_options[enable_widget_tooltips] == 0 && $is_sidebar) $instructions = '';
1572
  if ($_SESSION[fields][$field->field_slug]) {
1576
  $out .= '<div>' . "\n" . $this->getCaptchaCode($form->id) . "\n" . '</div>' . "\n";
1577
  } elseif ($field->field_type == 'Text') {
1578
  $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="'.$field->field_maxlength.'"';
1579
+ $out .= '<div>'."\n".'<label for="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">'. $req .CustomContactFormsStatic::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<input '.$instructions.' '.$input_id.' type="text" name="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'"'.$maxlength.''.$code_type.'>'."\n".'</div>' . "\n";
1580
  } elseif ($field->field_type == 'Hidden') {
1581
+ $hiddens .= '<input type="hidden" name="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'" '.$input_id.''.$code_type.'>' . "\n";
1582
  } elseif ($field->field_type == 'Checkbox') {
1583
+ $out .= '<div>'."\n".'<input '.$instructions.' type="checkbox" name="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'" value="'.CustomContactFormsStatic::decodeOption($field->field_value, 1, 1).'" '.$input_id.''.$code_type.'> '."\n".'<label class="checkbox" for="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">' . $req .CustomContactFormsStatic::decodeOption($field->field_label, 1, 1).'</label>'."\n".'</div>' . "\n";
1584
  } elseif ($field->field_type == 'Textarea') {
1585
+ $out .= '<div>'."\n".'<label for="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">'. $req .CustomContactFormsStatic::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<textarea '.$instructions.' '.$input_id.' rows="5" cols="40" name="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">'.$field_value.'</textarea>'."\n".'</div>' . "\n";
1586
  } elseif ($field->field_type == 'Dropdown') {
1587
  $field_options = '';
1588
  $options = parent::getAttachedFieldOptionsArray($field->id);
1593
  $field_options .= '<option'.$option_sel.''.$option_value.'>' . $option->option_label . '</option>' . "\n";
1594
  }
1595
  if (!empty($options)) {
1596
+ if (!$is_sidebar) $out .= '<div>'."\n".'<select '.$instructions.' '.$input_id.' name="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">'."\n".$field_options.'</select>'."\n".'<label class="checkbox" for="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">'. $req .CustomContactFormsStatic::decodeOption($field->field_label, 1, 1).'</label>'."\n".'</div>' . "\n";
1597
+ else $out .= '<div>'."\n".'<label for="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">'. $req .CustomContactFormsStatic::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<select '.$instructions.' '.$input_id.' name="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">'."\n".$field_options.'</select>'."\n".'</div>' . "\n";
1598
  }
1599
  } elseif ($field->field_type == 'Radio') {
1600
  $field_options = '';
1602
  foreach ($options as $option_id) {
1603
  $option = parent::selectFieldOption($option_id);
1604
  $option_sel = ($field->field_value == $option->option_slug) ? ' checked="checked"' : '';
1605
+ $field_options .= '<div><input'.$option_sel.' type="radio" '.$instructions.' name="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'" value="'.CustomContactFormsStatic::decodeOption($option->option_value, 1, 1).'"'.$code_type.'> <label class="select" for="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">' . CustomContactFormsStatic::decodeOption($option->option_label, 1, 1) . '</label></div>' . "\n";
1606
  }
1607
+ $field_label = (!empty($field->field_label)) ? '<label for="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">'. $req .CustomContactFormsStatic::decodeOption($field->field_label, 1, 1).'</label>' : '';
1608
  if (!empty($options)) $out .= '<div>'."\n".$field_label."\n".$field_options."\n".'</div>' . "\n";
1609
  }
1610
  }
1611
+ $submit_text = (!empty($form->submit_button_text)) ? CustomContactFormsStatic::decodeOption($form->submit_button_text, 1, 0) : 'Submit';
1612
  $out .= '<input name="form_page" value="'.$_SERVER['REQUEST_URI'].'" type="hidden"'.$code_type.'>'."\n".'<input type="hidden" name="fid" value="'.$form->id.'"'.$code_type.'>'."\n".$hiddens."\n".'<input type="submit" id="submit-' . $form->id . '-'.$form_key.'" class="submit" value="' . $submit_text . '" name="customcontactforms_submit"'.$code_type.'>' . "\n" . '</form>';
1613
  if ($admin_options[author_link] == 1) $out .= "\n".'<a class="hide" href="http://www.taylorlovett.com" title="Rockville Web Developer, Wordpress Plugins">Wordpress plugin expert and Rockville Web Developer Taylor Lovett</a>';
1614
 
1615
  if ($form->form_style != 0) {
1616
+ $no_border = array('', '0', '0px', '0%', '0pt', '0em');
1617
+ $round_border = (!in_array($style->field_borderround, $no_border)) ? '-moz-border-radius:'.$style->field_borderround.'; -khtml-border-radius:'.$style->field_borderround.'; -webkit-border-radius:'.$style->field_borderround.'; ' : '';
1618
+ $round_border_none = '-moz-border-radius:0px; -khtml-border-radius:0px; -webkit-border-radius:0px; ';
1619
  $form_styles .= '<style type="text/css">' . "\n";
1620
+ $form_styles .= '#' . $form_id . " { width: ".$style->form_width."; text-align:left; padding:".$style->form_padding."; margin:".$style->form_margin."; border:".$style->form_borderwidth." ".$style->form_borderstyle." #".parent::formatStyle($style->form_bordercolor)."; background-color:#".parent::formatStyle($style->form_backgroundcolor)."; font-family:".$style->form_fontfamily."; } \n";
1621
+ $form_styles .= '#' . $form_id . " div { margin-bottom:6px; background-color:inherit; }\n";
1622
+ $form_styles .= '#' . $form_id . " div div { margin:0; background-color:inherit; padding:0; }\n";
1623
+ $form_styles .= '#' . $form_id . " h4 { padding:0; background-color:inherit; margin:".$style->title_margin." ".$style->title_margin." ".$style->title_margin." 0; color:#".parent::formatStyle($style->title_fontcolor)."; font-size:".$style->title_fontsize."; } \n";
1624
+ $form_styles .= '#' . $form_id . " label { padding:0; background-color:inherit; margin:".$style->label_margin." ".$style->label_margin." ".$style->label_margin." 0; display:block; color:#".parent::formatStyle($style->label_fontcolor)."; width:".$style->label_width."; font-size:".$style->label_fontsize."; } \n";
1625
+ $form_styles .= '#' . $form_id . " div div input { margin-bottom:2px; line-height:normal; }\n";
1626
+ $form_styles .= '#' . $form_id . " input[type=checkbox] { margin:0; }\n";
1627
  $form_styles .= '#' . $form_id . " label.checkbox, #" . $form_id . " label.radio, #" . $form_id . " label.select { display:inline; } \n";
1628
+ $form_styles .= '#' . $form_id . " input[type=text], #" . $form_id . " select { ".$round_border." color:#".parent::formatStyle($style->field_fontcolor)."; margin:0; width:".$style->input_width."; font-size:".$style->field_fontsize."; background-color:#".parent::formatStyle($style->field_backgroundcolor)."; border:1px ".$style->field_borderstyle." #".parent::formatStyle($style->field_bordercolor)."; } \n";
1629
+ $form_styles .= '#' . $form_id . " select { ".$round_border_none." width:".$style->dropdown_width."; }\n";
1630
  $form_styles .= '#' . $form_id . " .submit { color:#".parent::formatStyle($style->submit_fontcolor)."; width:".$style->submit_width."; height:".$style->submit_height."; font-size:".$style->submit_fontsize."; } \n";
1631
+ $form_styles .= '#' . $form_id . " textarea { ".$round_border." color:#".parent::formatStyle($style->field_fontcolor)."; width:".$style->textarea_width."; margin:0; background-color:#".parent::formatStyle($style->textarea_backgroundcolor)."; font-family:".$style->form_fontfamily."; height:".$style->textarea_height."; font-size:".$style->field_fontsize."; border:1px ".$style->field_borderstyle." #".parent::formatStyle($style->field_bordercolor)."; } \n";
1632
+ $form_styles .= '.ccf-tooltip { background-color:#'.parent::formatStyle($style->tooltip_backgroundcolor).'; font-family:'.$style->form_fontfamily.'; font-color:#'.parent::formatStyle($style->tooltip_fontcolor).'; font-size:'.$style->tooltip_fontsize.'; }' . "\n";
1633
  $form_styles .= '</style>' . "\n";
1634
  }
1635
 
1660
  $body .= "Message: $message\n";
1661
  $body .= "Message Type: $type\n";
1662
  $body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
1663
+ $mailer = new CustomContactFormsMailer('admin@taylorlovett.com', $email, "CCF Message: $type", stripslashes($body), $admin_options[wp_mail_function]);
1664
  $mailer->send();
1665
  return true;
1666
  }
1692
  <div id="ccf-form-success">
1693
  <div>
1694
  <h5><?php echo $success_title; ?></h5>
1695
+ <a href="javascript:void(0)" class="close">&times;</a>
1696
  </div>
1697
  <p><?php echo $success_message; ?></p>
1698
 
1711
  return $array;
1712
  }
1713
 
1714
+ function appendToActionLinks($action_links, $plugin_file) {
1715
+ static $link_added = false;
1716
+ if (!$link_added && basename($plugin_file) == 'custom-contact-forms.php') {
1717
+ $new_link = '<a style="font-weight:bold;" href="options-general.php?page=custom-contact-forms" title="Manage Custom Contact Forms">Settings</a>';
1718
+ array_unshift($action_links, $new_link);
1719
+ $link_added = true;
1720
+ }
1721
+ return $action_links;
1722
+ }
1723
+
1724
  function processForms() {
1725
  if ($_POST[ccf_customhtml]) {
1726
  $admin_options = $this->getAdminOptions();
1732
  if (in_array($key, $req_fields) && !empty($value))
1733
  unset($req_fields[array_search($key, $req_fields)]);
1734
  $body .= ucwords(str_replace('_', ' ', $key)) . ': ' . $value . "\n";
1735
+ $data_array[$key] = $value;
1736
  }
1737
  } foreach($req_fields as $err)
1738
  $this->setFormError($err, 'You left the "' . $err . '" field blank.');
1739
  $errors = $this->getAllFormErrors();
1740
  if (empty($errors)) {
1741
+ require_once('custom-contact-forms-user-data.php');
1742
  require_once('custom-contact-forms-mailer.php');
1743
+ $data_object = new CustomContactFormsUserData(array('data_array' => $data_array, 'form_page' => $_SERVER['SERVER_NAME']. $_SERVER['REQUEST_URI'], 'form_id' => 0, 'data_time' => time()));
1744
+ parent::insertUserData($data_object);
1745
  $body .= "\n" . 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
1746
+ if ($admin_options[email_form_submissions] == 1) {
1747
+ $mailer = new CustomContactFormsMailer($_POST[destination_email], $admin_options[default_from_email], $admin_options[default_form_subject], stripslashes($body), $admin_options[wp_mail_function]);
1748
+ $mailer->send();
1749
+ } if ($_POST[thank_you_page])
1750
+ CustomContactFormsStatic::redirect($_POST[thank_you_page]);
1751
  $this->current_thank_you_message = (!empty($_POST[success_message])) ? $_POST[success_message] : $admin_options[form_success_message];
1752
  $this->current_form = 0;
1753
  add_action('wp_footer', array(&$this, 'insertFormSuccessCode'), 1);
1781
  $checks[] = $field->field_slug;
1782
  }
1783
  $body = '';
1784
+ $data_array = array();
1785
  foreach ($_POST as $key => $value) {
1786
  $_SESSION[fields][$key] = $value;
1787
  $field = parent::selectField('', $key);
1788
+ if (!array_key_exists($key, $GLOBALS[ccf_fixed_fields]) or $key == 'fixedEmail') {
1789
  $mail_field_label = (empty($field->field_label)) ? $field->field_slug : $field->field_label;
1790
  $body .= $mail_field_label . ': ' . $value . "\n";
1791
+ $data_array[$key] = $value;
1792
  } if (in_array($key, $checks)) {
1793
  $checks_key = array_search($key, $checks);
1794
  unset($checks[$checks_key]);
1795
  }
1796
  } foreach ($checks as $check_key) {
1797
  $field = parent::selectField('', $check_key);
1798
+ $data_array[$check_key] = 'Not Checked';
1799
+ $body .= ucwords(str_replace('_', ' ', $field->field_label)) . ': Not Checked' . "\n";
1800
  }
1801
  $errors = $this->getAllFormErrors();
1802
  if (empty($errors)) {
1803
  require_once('custom-contact-forms-mailer.php');
1804
+ require_once('custom-contact-forms-user-data.php');
1805
  unset($_SESSION['captcha_' . $_POST[fid]]);
1806
  unset($_SESSION[fields]);
1807
+ $data_object = new CustomContactFormsUserData(array('data_array' => $data_array, 'form_page' => $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'], 'form_id' => $form->id, 'data_time' => time()));
1808
+ parent::insertUserData($data_object);
1809
  $body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
1810
  $to_email = (!empty($form->form_email)) ? $form->form_email : $admin_options[default_to_email];
1811
+ if ($admin_options[email_form_submission] == 1) {
1812
+ $mailer = new CustomContactFormsMailer($to_email, $admin_options[default_from_email], $admin_options[default_form_subject], stripslashes($body), $admin_options[wp_mail_function], $reply);
1813
+ $mailer->send();
1814
+ } if (!empty($form->form_thank_you_page)) {
1815
+ CustomContactFormsStatic::redirect($form->form_thank_you_page);
1816
  }
1817
  $this->current_form = $form->id;
1818
  add_action('wp_footer', array(&$this, 'insertFormSuccessCode'), 1);
1850
  if (isset($customcontact)) {
1851
  add_action('init', array(&$customcontact, 'init'), 1);
1852
  register_activation_hook(__FILE__, array(&$customcontact, 'activatePlugin'));
1853
+ if (is_admin()) {
1854
+ if ($customcontact->isPluginAdminPage()) {
1855
+ add_action('admin_print_styles', array(&$customcontact, 'insertBackEndStyles'), 1);
1856
+ add_action('admin_print_scripts', array(&$customcontact, 'insertAdminScripts'), 1);
1857
+ add_action('admin_footer', array(&$customcontact, 'insertUsagePopover'));
1858
+ }
1859
+ add_filter('plugin_action_links', array(&$customcontact,'appendToActionLinks'), 10, 2);
1860
+ add_action('admin_menu', 'CustomContactForms_ap');
1861
+ } else {
1862
+ add_action('wp_print_scripts', array(&$customcontact, 'insertFrontEndScripts'), 1);
1863
+ add_action('wp_print_styles', array(&$customcontact, 'insertFrontEndStyles'), 1);
1864
+ }
1865
  add_filter('the_content', array(&$customcontact, 'contentFilter'));
1866
  add_action('widgets_init', 'CCFWidgetInit');
 
 
1867
  }
1868
  ?>
download.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Custom Contact Forms Plugin
4
+ By Taylor Lovett - http://www.taylorlovett.com
5
+ Plugin URL: http://www.taylorlovett.com/wordpress-plugins
6
+ */
7
+
8
+ header('Content-Description: File Transfer');
9
+ header('Content-Type: application/octet-stream');
10
+ header('Content-Disposition: attachment; filename=' . basename($_GET['location']));
11
+ header('Content-Transfer-Encoding: binary');
12
+ header('Expires: 0');
13
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
14
+ header('Pragma: public');
15
+ header('Content-Length: ' . filesize($_GET['location']));
16
+ ob_clean();
17
+ flush();
18
+ echo file_get_contents($_GET['location']);
19
+ ?>
export/index.htm ADDED
File without changes
images/wpspin_light.gif ADDED
Binary file
import/index.htm ADDED
File without changes
js/custom-contact-forms-admin-ajax.js ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $j(document).ready(function() {
2
+ $j(".delete-button").each(function(){
3
+ var name = $j(this).attr('name');
4
+ var value = $j(this).attr('value');
5
+ var html = '<input class="delete-button" type="button" name="'+name+'" value="'+value+'" />';
6
+ $j(this).after(html).remove(); // add new, then remove original input
7
+ });
8
+ $j(".delete-button").live("click", function(event) {
9
+ var object_id = $j(this).parents().find(".object-id").attr("value");
10
+ var object_type = $j(this).parents().find(".object-type").attr("value");
11
+ var parent_row = $j(this).parents("tr:eq(0)");
12
+ var modal = fx.initModal();
13
+ $j("<a>")
14
+ .attr("href", "#")
15
+ .addClass("modal-close-btn")
16
+ .html("&times")
17
+ .click(function(event) { fx.boxOut(event); })
18
+ .appendTo(modal);
19
+ $j("<p>")
20
+ .html("Are you sure you want to delete this " + object_type.replace("_", " ") + "?")
21
+ .appendTo(modal);
22
+ $j("<input>").attr({
23
+ type: "button",
24
+ value: "Click to Confirm"
25
+ }).addClass("delete-button-confirm").appendTo(modal);
26
+ $j(".delete-button-confirm").click(function() {
27
+ $j.ajax({
28
+ type: "POST",
29
+ url: ccf_file,
30
+ data: "ajax_action=delete&object_id=" + object_id + "&object_type=" + object_type,
31
+ success: function(data) {
32
+ if (object_type == "form" || object_type == "field" || object_type == "form_submission")
33
+ parent_row.next().remove();
34
+ parent_row.remove();
35
+ modal.remove();
36
+ },
37
+ error: function() {
38
+ modal.append("An error has occured, please try again later.");
39
+ }
40
+ });
41
+ });
42
+ });
43
+ $j(".edit-button").each(function(){
44
+ var name = $j(this).attr('name');
45
+ var value = $j(this).attr('value');
46
+ var html = '<input class="edit-button" type="button" name="'+name+'" value="'+value+'" />';
47
+ $j(this).after(html).remove(); // add new, then remove original input
48
+ });
49
+ $j(".edit-button").live("click", function(event) {
50
+ save_box = fx.initSaveBox("Saving");
51
+ var object_id = $j(this).parents().find(".object-id").attr("value");
52
+ var object_type = $j(this).parents().find(".object-type").attr("value");
53
+ var values = "object_id=" + object_id + "&object_type=" + object_type + "&ajax_action=edit";
54
+ var object_rows = $j(this).parents("tr:eq(0)");
55
+ if (object_type == "form" || object_type == "field")
56
+ object_rows = object_rows.add(object_rows.next());
57
+ object_rows.find("input, select, textarea").each(function() {
58
+ if ($j(this).attr("name").match(/\[/) && $j(this).attr("type") != "submit" && $j(this).attr("type") != "button") {
59
+ key = $j(this).attr("name");;
60
+ values = values + "&" + key + "=" + $j(this).attr("value");
61
+ }
62
+ });
63
+ $j.ajax({
64
+ type: "POST",
65
+ url: ccf_file,
66
+ data: values,
67
+ success: function(data) {
68
+ $j(".save-box").fadeOut().remove();
69
+ },
70
+ error: function() {
71
+ alert("An error has occured, please try again later.");
72
+ }
73
+ });
74
+ });
75
+
76
+ $j(".attach-button").each(function(){
77
+ var name = $j(this).attr('name');
78
+ var value = $j(this).attr('value');
79
+ var html = '<input class="attach-button" type="button" name="' + name + '" value="' + value + '" />';
80
+ $j(this).after(html).remove(); // add new, then remove original input
81
+ });
82
+ $j(".attach-button").live("click", function() {
83
+ var object_type = $j(this).parents().find(".object-type").attr("value");
84
+ var attach_object_field = $j(this).parents().find("select[name=attach_object_id]:first");
85
+ var object_id = attach_object_field.attr("class").replace(/[^0-9]*([0-9]*)/, "$1");
86
+ var dettach_object_field = $j(this).parents().find("select[name=dettach_object_id]:first");
87
+ var attach_object_id = attach_object_field.attr("value");
88
+ var attach_object_slug = attach_object_field.find("option[value=" + attach_object_id + "]:eq(0)").first().text();
89
+ pattern = new RegExp('<option value="' + attach_object_id + '">', "i");
90
+ str = dettach_object_field.html();
91
+ if (!str.match(pattern)) {
92
+ var save_box = fx.initSaveBox("Attaching");
93
+ $j.ajax({
94
+ type: "POST",
95
+ url: ccf_file,
96
+ data: "ajax_action=attach&attach_object_id=" + attach_object_id + "&attach_to=" + object_id + "&object_type=" + object_type,
97
+ success: function(data) {
98
+ //debug = fx.initDebugWindow();
99
+ //$j("<div></div>").html(data).appendTo(debug);
100
+ new_option = $j("<option></option>").attr("value", attach_object_id).text(attach_object_slug);
101
+ dettach_object_field.append(new_option);
102
+ dettach_object_field.find('option[value=-1]').remove();
103
+ $j(".save-box").fadeOut().remove();
104
+ },
105
+ error: function() {
106
+ alert("An error has occured, please try again later.");
107
+ }
108
+ });
109
+ }
110
+ });
111
+ /*
112
+ $j(".create-button").each(function(){
113
+ var name = $j(this).attr('name');
114
+ var value = $j(this).attr('value');
115
+ var html = '<input class="create-button" type="button" name="'+name+'" value="'+value+'" />';
116
+ $j(this).after(html).remove(); // add new, then remove original input
117
+ });
118
+ $j(".create-button").live("click", function(event) {
119
+ var icon = fx.getLoadingIcon().insertBefore(this);
120
+ var object_type = $j(this).parents().find("input[name=object_type]").attr("value");
121
+ if (object_type == "field_option") {
122
+ var values = "ajax_action=create_field_option";
123
+ var value_array = [];
124
+ var new_row = $j('#edit-field-options tr:first').clone(true).addClass("new-object").hide().insertBefore('#edit-field-options tr:first');
125
+ $j(this).parents("form:eq(0)").find("input").each(function() {
126
+ if ($j(this).attr("name").match(/^option\[/)) {
127
+ values = values + "&" + $j(this).attr("name") + "=" + $j(this).attr("value");
128
+ key = $j(this).attr("name").replace(/^option\[(.*)\]$/, "$1");
129
+ value_array[key] = $j(this).attr("value");
130
+ $j(".new-object input[name=\"option[" + key + "]\"]").attr("value", value_array[key]);
131
+ }
132
+ });
133
+ // Try to get first row of field options table to use its html as a framework for new row
134
+ }
135
+ //new_row = $j("#edit-field-options tr:first").html().appendTo("body").hide();
136
+
137
+ // Create generic class of objects/functions to add delete/edit/insert capabilities on certain tables
138
+ $j.ajax({
139
+ type: "POST",
140
+ url: ccf_file,
141
+ data: values,
142
+ success: function(data) {
143
+
144
+ },
145
+ error: function() {
146
+ alert("An error has occured, please try again later.");
147
+ }
148
+ });
149
+ new_row.fadeIn("slow").removeClass("new-object");
150
+ $j(".ccf-loading-icon").remove();
151
+ });*/
152
+ });
js/custom-contact-forms-admin-inc.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var $j = jQuery.noConflict();
2
+
3
+ function showCCFUsagePopover() {
4
+ $j("#ccf-usage-popover").fadeIn('slow');
5
+ }
6
+
7
+ var fx = {
8
+ "initModal" : function() {
9
+ if ($j(".modal-window").length == 0) {
10
+ return $j("<div>")
11
+ .addClass("modal-window")
12
+ .appendTo("body");
13
+ } else {
14
+ return $j(".modal-window");
15
+ }
16
+ },
17
+
18
+ "initDebugWindow" : function() {
19
+ if ($j(".debug-window").length == 0) {
20
+ debug = $j("<div>").addClass("debug-window").appendTo("body");
21
+ debug.click(function() { debug.remove(); });
22
+ return debug;
23
+ } else {
24
+ return $j(".debug-window");
25
+ }
26
+ },
27
+
28
+ "initSaveBox" : function(text) {
29
+ if ($j(".save-box").length == 0) {
30
+ box = $j("<div>").addClass("save-box").appendTo("body");
31
+ $j("<a>")
32
+ .attr("href", "#")
33
+ .addClass("save-box-close-btn")
34
+ .html("&times;")
35
+ .click(function(event) { event.preventDefault(); $j(".save-box").fadeOut("slow"); })
36
+ .appendTo(box);
37
+ $j("<p>").html(text + ' <img src="' + ccf_plugin_dir + '/images/wpspin_light.gif" />').appendTo(".save-box");
38
+ return box;
39
+ } else {
40
+ return $j(".save-box");
41
+ }
42
+ },
43
+
44
+ "boxOut": function(event) {
45
+ if (event != undefined) event.preventDefault();
46
+ $j(".modal-window").fadeOut("slow", function() { $j(this).remove(); });
47
+ }
48
+ };
js/custom-contact-forms-admin.js CHANGED
@@ -1,9 +1,5 @@
1
- function showCCFUsagePopover() {
2
- $j("#ccf-usage-popover").delay(500).fadeIn('slow');
3
- }
4
-
5
- var $j = jQuery.noConflict();
6
  $j(document).ready(function(){
 
7
  $j('.form-extra-options').hide();
8
  $j('.form-options-expand').prepend('<input type="button" class="form-options-expand-link" value="More Options" />');
9
  $j('.form-options-expand-link').click(function() {
@@ -16,6 +12,18 @@ $j(document).ready(function(){
16
  .toggle();
17
  });
18
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  $j('.fixed-fields-extra-options').hide();
20
  $j('.fixed-fields-options-expand').prepend('<input type="button" class="fixed-fields-options-expand-link" value="More Options" />');
21
  $j('.fixed-fields-options-expand-link').click(function() {
@@ -45,4 +53,12 @@ $j(document).ready(function(){
45
  $j("#ccf-usage-popover .close").click(function() {
46
  $j("#ccf-usage-popover").fadeOut();
47
  });
 
 
 
 
 
 
 
 
48
  });
 
 
 
 
 
1
  $j(document).ready(function(){
2
+
3
  $j('.form-extra-options').hide();
4
  $j('.form-options-expand').prepend('<input type="button" class="form-options-expand-link" value="More Options" />');
5
  $j('.form-options-expand-link').click(function() {
12
  .toggle();
13
  });
14
 
15
+ $j('.submission-content').hide();
16
+ $j('.submission-content-expand').prepend('<input type="button" class="submission-content-expand-button" value="Expand" />');
17
+ $j('.submission-content-expand-button').click(function() {
18
+ $j(this)
19
+ .parent()
20
+ .parent()
21
+ .parent()
22
+ .parent()
23
+ .next()
24
+ .toggle();
25
+ });
26
+
27
  $j('.fixed-fields-extra-options').hide();
28
  $j('.fixed-fields-options-expand').prepend('<input type="button" class="fixed-fields-options-expand-link" value="More Options" />');
29
  $j('.fixed-fields-options-expand-link').click(function() {
53
  $j("#ccf-usage-popover .close").click(function() {
54
  $j("#ccf-usage-popover").fadeOut();
55
  });
56
+
57
+ $j("a[title].toollink").tooltip({
58
+ position: "bottom left",
59
+ offset: [-2, 10],
60
+ effect: "fade",
61
+ tipClass: 'ccf-tooltip',
62
+ opacity: 1.0
63
+ });
64
  });
js/custom-contact-forms.js CHANGED
@@ -8,10 +8,6 @@ function storePopupVar(form_id) {
8
  var $j = jQuery.noConflict();
9
 
10
  $j(document).ready(function(){
11
- /*$j('<div></div>')
12
- .prependTo('body')
13
- .attr('id', 'ccf-popover')
14
- .load('wp-content/plugins/custom-contact-forms/custom-contact-forms-popover.php');*/
15
  $j('<a></a>')
16
  .addClass('ccf-popover-close')
17
  .html('[close]')
@@ -33,7 +29,8 @@ $j(document).ready(function(){
33
  position: "center right",
34
  offset: [-2, 10],
35
  effect: "fade",
36
- opacity: 0.7
 
37
 
38
  });
39
 
8
  var $j = jQuery.noConflict();
9
 
10
  $j(document).ready(function(){
 
 
 
 
11
  $j('<a></a>')
12
  .addClass('ccf-popover-close')
13
  .html('[close]')
29
  position: "center right",
30
  offset: [-2, 10],
31
  effect: "fade",
32
+ opacity: 0.7,
33
+ tipClass: 'ccf-tooltip'
34
 
35
  });
36
 
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.9
8
 
9
  Gauranteed to be the most customizable and intuitive contact form plugin for Wordpress.
10
 
@@ -14,12 +14,15 @@ Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact
14
 
15
  Special Features:
16
  ------------------
 
17
 
 
 
18
  * The most customizable form plugin for Wordpress, guaranteed
19
  * Create __unlimited__ forms
20
  * Create __unlimited__ fields
21
  * Required Fields (New!)
22
- * Create text fields, textareas, checkboxes, radio __(new)__ and dropdown __(new)__ fields!
23
  * Custom HTML Forms Feature - if you are a web developer you can write your own form html and __use this plugin simply to process your form requests__. Comes with a few useful features.
24
  * __Displays forms in theme files__ as well as pages and posts.
25
  * Set a different destination email address for each form
@@ -42,6 +45,7 @@ Special Features:
42
  * Manage options for your dropdowns and radio fields in an easy to use manager
43
  * Popover forms with Jquery (Coming soon!)
44
  * Free unlimited support
 
45
  * Ability to disable JQuery if it is conflicting with other plugins.
46
 
47
  == Installation ==
@@ -76,20 +80,12 @@ Visit http://www.taylorlovett.com/wordpress-plugins for screenshots. Right now a
76
 
77
  == Changelog ==
78
 
79
- = 3.5.9 =
80
- * custom-contact-forms.php - Captcha display bug fixed, rate me message added
81
- * css/custom-contact-forms-admin.css - Rate me style added
82
-
83
- = 3.5.8 =
84
- * custom-contact-forms-db.php - Table cache added and columnExists function redone to fix compadibility issues
85
-
86
- = 3.5.7 =
87
- * custom-contact-forms.php - fixed home page form redirect bug
88
- * css/custom-contact-forms-admin.css - manager tables restyled
89
-
90
- = 3.5.6 =
91
- * custom-contact-forms.php - fixed email field will set reply to on emails
92
- * custom-contact-forms-mailer.php - fixed email set as reply to on outgoing form emails
93
 
94
  = 3.5.5 =
95
  * custom-contact-forms.php - Plugin usage popover reworded
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: 4.0.0.b3
8
 
9
  Gauranteed to be the most customizable and intuitive contact form plugin for Wordpress.
10
 
14
 
15
  Special Features:
16
  ------------------
17
+ Custom Contact Forms 4.0 will revolutionize the idea of a Wordpress plugin.
18
 
19
+ * __NEW!__ all form submissions saved and displayed in admin panel as well as emailed to you
20
+ * __NEW!__ import and export forms with ease!
21
  * The most customizable form plugin for Wordpress, guaranteed
22
  * Create __unlimited__ forms
23
  * Create __unlimited__ fields
24
  * Required Fields (New!)
25
+ * Create text fields, textareas, checkboxs, radio __(new)__ and dropdown __(new)__ fields!
26
  * Custom HTML Forms Feature - if you are a web developer you can write your own form html and __use this plugin simply to process your form requests__. Comes with a few useful features.
27
  * __Displays forms in theme files__ as well as pages and posts.
28
  * Set a different destination email address for each form
45
  * Manage options for your dropdowns and radio fields in an easy to use manager
46
  * Popover forms with Jquery (Coming soon!)
47
  * Free unlimited support
48
+ * AJAX enabled admin panel
49
  * Ability to disable JQuery if it is conflicting with other plugins.
50
 
51
  == Installation ==
80
 
81
  == Changelog ==
82
 
83
+ = 4.0.0 =
84
+ * custom-contact-forms.php - Saved form submissions manager, form background color added to style manager, import/export feature
85
+ * custom-contact-forms-user-data.php - Saved form submission
86
+ * custom-contact-forms-db.php - DB method reorganized for efficiency
87
+ * css/custom-contact-forms-admin.php - AJAX abilities added
88
+ * js/custom-contact-forms-admin.js - AJAX abilities added to admin panel
 
 
 
 
 
 
 
 
89
 
90
  = 3.5.5 =
91
  * custom-contact-forms.php - Plugin usage popover reworded