Custom Contact Forms - Version 3.5.9

Version Description

  • custom-contact-forms.php - Captcha display bug fixed, rate me message added
  • css/custom-contact-forms-admin.css - Rate me style added
Download this release

Release Info

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

Code changes from version 4.0.0.b2 to 3.5.9

css/custom-contact-forms-admin.css CHANGED
@@ -19,6 +19,21 @@
19
  height:25px;
20
  padding: 7px 0 0 9px;
21
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  #customcontactforms-admin #instructions {
23
  float:left;
24
  clear:none;
@@ -72,15 +87,6 @@
72
  #customcontactforms-admin #form-submissions table.second { margin-left:48%; border-collapse:collapse; width:48%; }
73
 
74
 
75
- #customcontactforms-admin #import-export {
76
- clear:both;
77
- width:1000px;
78
- margin:20px 1em 1em 5px;
79
- }
80
- #customcontactforms-admin #import-export .import { float:left; margin:0; padding:0; width:48%; }
81
- #customcontactforms-admin #import-export .export { margin-left:50%; width:48%; }
82
- #customcontactforms-admin #import-export p { padding:0 0 5px 0; margin:0; }
83
-
84
  #customcontactforms-admin #field-options {
85
  clear:both;
86
  width:1000px;
@@ -128,6 +134,21 @@
128
  text-align:center;
129
  padding:6px 0 0 0;
130
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  #customcontactforms-admin #field-options .action { width:155px; }
132
  #customcontactforms-admin #field-options .option-value { width:125px; }
133
  #customcontactforms-admin #field-options .create-field-options-header {
@@ -171,8 +192,6 @@
171
  width:1000px;
172
  margin:20px 1em 1em 5px;
173
  }
174
- #customcontactforms-admin #create-styles .inside,
175
- #customcontactforms-admin #create-styles form { margin-top:0px; padding-top:0 }
176
  #customcontactforms-admin #create-styles .style_left { float:left; width:48% }
177
  #customcontactforms-admin #create-styles .style_right { width:48%; margin-left:51%; clear:none }
178
  #customcontactforms-admin #plugin-news {
@@ -307,9 +326,6 @@
307
  -webkit-box-shadow: 0 0 14px #123;
308
  box-shadow:0 0 14px #123;
309
  }
310
- #ccf-usage-popover #popover-tof { text-align:center; border-bottom:1px #ccc dashed; margin:5px 0 10px 0; padding:0 0 6px 0; }
311
- #ccf-usage-popover #popover-tof li { display:inline; padding:0 2px 0 3px;
312
- }
313
  #ccf-usage-popover div.popover-header {
314
  background-color:#efefef;
315
  padding:9px 9px 9px 20px;
@@ -334,7 +350,7 @@
334
  overflow:scroll;
335
  position:absolute;
336
  bottom:0px;
337
- top:3em;
338
  padding:3px;
339
  }
340
  #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 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;
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
  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
  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
  -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
  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; }
css/custom-contact-forms-standards.css CHANGED
@@ -11,7 +11,4 @@
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; }
11
  .floatleft { float:left; }
12
  .floatright { float:right; }
13
  .form-extra-options-table { margin:0 auto 0 auto; }
14
+ .evenrow { background-color:#f5f5f5; }
 
 
 
css/custom-contact-forms.css CHANGED
@@ -97,9 +97,6 @@ form.customcontactform-sidebar div select { width:auto; }
97
  left:30%;
98
  background-color:white;
99
  top:30%;
100
- -moz-box-shadow:0 0 14px #123;
101
- -webkit-box-shadow: 0 0 14px #123;
102
- box-shadow:0 0 14px #123;
103
  }
104
  #ccf-form-success div {
105
  background-color:#efefef;
97
  left:30%;
98
  background-color:white;
99
  top:30%;
 
 
 
100
  }
101
  #ccf-form-success div {
102
  background-color:#efefef;
custom-contact-forms-db.php CHANGED
@@ -6,11 +6,34 @@
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,18 +45,8 @@ if (!class_exists('CustomContactFormsDB')) {
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,7 +55,7 @@ if (!class_exists('CustomContactFormsDB')) {
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,29 +67,30 @@ if (!class_exists('CustomContactFormsDB')) {
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,57 +104,52 @@ if (!class_exists('CustomContactFormsDB')) {
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
-
144
  }
145
 
146
  function insertFixedFields() {
@@ -148,11 +157,12 @@ if (!class_exists('CustomContactFormsDB')) {
148
  $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.');
149
  $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.');
150
  if (!$this->fieldSlugExists('captcha'))
151
- $this->insertField($captcha, true);
152
  if (!$this->fieldSlugExists('ishuman'))
153
- $this->insertField($ishuman, true);
154
  if (!$this->fieldSlugExists('fixedEmail'))
155
- $this->insertField($fixedEmail, true);
 
156
  }
157
 
158
  /*function columnExists($column, $table) {
@@ -179,20 +189,20 @@ if (!class_exists('CustomContactFormsDB')) {
179
  global $wpdb;
180
  if (empty($form) or empty($form[form_slug]) or $this->formSlugExists($this->formatSlug($form[form_slug]))) return false;
181
  $form[form_slug] = $this->formatSlug($form[form_slug]);
182
- foreach ($form as $key => $value)
183
- $form[$key] = CustomContactFormsStatic::encodeOption($value);
184
- $wpdb->insert(CCF_FORMS_TABLE, $form);
185
  return $wpdb->insert_id;
186
  }
187
 
188
- function insertField($field, $fixed = false) {
189
  global $wpdb;
190
- 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])))
191
- return false;
192
  $field[field_slug] = $this->formatSlug($field[field_slug]);
193
- foreach ($field as $key => $value)
194
- $field[$key] = CustomContactFormsStatic::encodeOption($value);
195
- $wpdb->insert(CCF_FIELDS_TABLE, $field);
 
 
196
  return $wpdb->insert_id;
197
  }
198
 
@@ -200,9 +210,8 @@ if (!class_exists('CustomContactFormsDB')) {
200
  global $wpdb;
201
  if (empty($option) or empty($option[option_slug]) or $this->fieldOptionsSlugExists($this->formatSlug($option[option_slug]))) return false;
202
  $option[option_slug] = $this->formatSlug($option[option_slug]);
203
- foreach ($option as $key => $value)
204
- $option[$key] = CustomContactFormsStatic::encodeOption($value);
205
- $wpdb->insert(CCF_FIELD_OPTIONS_TABLE, $option);
206
  return $wpdb->insert_id;
207
  }
208
 
@@ -210,36 +219,33 @@ if (!class_exists('CustomContactFormsDB')) {
210
  global $wpdb;
211
  if (empty($style) or empty($style[style_slug]) or $this->styleSlugExists($this->formatSlug($style[style_slug]))) return false;
212
  $style[style_slug] = $this->formatSlug($style[style_slug]);
213
- foreach ($style as $key => $value)
214
- $style[$key] = CustomContactFormsStatic::encodeOption($value);
215
- $wpdb->insert(CCF_STYLES_TABLE, $style);
 
 
216
  return $wpdb->insert_id;
217
  }
218
 
219
 
220
  function fieldsTableExists() {
221
  global $wpdb;
222
- return ($wpdb->get_var("show tables like '". CCF_FIELDS_TABLE . "'") == CCF_FIELDS_TABLE);
223
  }
224
 
225
  function formsTableExists() {
226
  global $wpdb;
227
- return ($wpdb->get_var("show tables like '". CCF_FORMS_TABLE . "'") == CCF_FORMS_TABLE);
228
  }
229
 
230
  function stylesTableExists() {
231
  global $wpdb;
232
- return ($wpdb->get_var("show tables like '". CCF_STYLES_TABLE . "'") == CCF_STYLES_TABLE);
233
  }
234
 
235
  function fieldOptionsTableExists() {
236
  global $wpdb;
237
- return ($wpdb->get_var("show tables like '". CCF_FIELD_OPTIONS_TABLE . "'") == CCF_FIELD_OPTIONS_TABLE);
238
- }
239
-
240
- function userDataTableExists() {
241
- global $wpdb;
242
- return ($wpdb->get_var("show tables like '". CCF_USER_DATA_TABLE . "'") == CCF_USER_DATA_TABLE);
243
  }
244
 
245
  function updateForm($form, $fid) {
@@ -249,9 +255,8 @@ if (!class_exists('CustomContactFormsDB')) {
249
  if (!empty($test) and $test->id != $fid) return false;
250
  $form[form_slug] = $this->formatSlug($form[form_slug]);
251
  }
252
- foreach ($form as $key => $value)
253
- $form[$key] = CustomContactFormsStatic::encodeOption($value);
254
- $wpdb->update(CCF_FORMS_TABLE, $form, array('id' => $fid));
255
  return true;
256
  }
257
 
@@ -259,13 +264,12 @@ if (!class_exists('CustomContactFormsDB')) {
259
  global $wpdb;
260
  if (!empty($field[field_slug])) {
261
  $test = $this->selectField('', $this->formatSlug($field[field_slug]));
262
- if ((!empty($test) and $test->id != $fid) or array_key_exists($this->formatSlug($field[field_slug]), $GLOBALS[ccf_fixed_fields]))
263
  return false;
264
  $field[field_slug] = $this->formatSlug($field[field_slug]);
265
  }
266
- foreach ($field as $key => $value)
267
- $field[$key] = CustomContactFormsStatic::encodeOption($value);
268
- $wpdb->update(CCF_FIELDS_TABLE, $field, array('id' => $fid));
269
  return true;
270
  }
271
 
@@ -277,9 +281,8 @@ if (!class_exists('CustomContactFormsDB')) {
277
  return false;
278
  $option[option_slug] = $this->formatSlug($option[option_slug]);
279
  }
280
- foreach ($option as $key => $value)
281
- $option[$key] = CustomContactFormsStatic::encodeOption($value);
282
- $wpdb->update(CCF_FIELD_OPTIONS_TABLE, $option, array('id' => $oid));
283
  return true;
284
  }
285
 
@@ -290,16 +293,18 @@ if (!class_exists('CustomContactFormsDB')) {
290
  if (!empty($test) and $test->id != $sid) // if style_slug is different then make sure it is unique
291
  return false;
292
  $style[style_slug] = $this->formatSlug($style[style_slug]);
293
- foreach ($style as $key => $value)
294
- $style[$key] = CustomContactFormsStatic::encodeOption($value);
295
- $wpdb->update(CCF_STYLES_TABLE, $style, array('id' => $sid));
 
 
296
  return true;
297
  }
298
 
299
  function deleteForm($fid, $slug = NULL) {
300
  global $wpdb;
301
  $where_params = ($slug == NULL) ? "id='$fid'" : "form_slug='$slug'";
302
- $wpdb->query("DELETE FROM " . CCF_FORMS_TABLE . ' WHERE ' . $where_params);
303
  return true;
304
  }
305
 
@@ -307,21 +312,15 @@ if (!class_exists('CustomContactFormsDB')) {
307
  global $wpdb;
308
  $this->dettachFieldAll($fid);
309
  $where_params = ($slug == NULL) ? "id='$fid'" : "field_slug='$slug'";
310
- $wpdb->query("DELETE FROM " . CCF_FIELDS_TABLE . ' WHERE ' . $where_params);
311
  return false;
312
  }
313
 
314
- function query($query) {
315
- global $wpdb;
316
- if (empty($query)) return false;
317
- return ($wpdb->query($query) != false) ? $wpdb->insert_id : false;
318
- }
319
-
320
  function deleteStyle($sid, $slug = NULL) {
321
  global $wpdb;
322
  $this->dettachStyleAll($sid);
323
  $where_params = ($slug == NULL) ? "id='$sid'" : "style_slug='$slug'";
324
- $wpdb->query("DELETE FROM " . CCF_STYLES_TABLE . ' WHERE ' . $where_params);
325
  return true;
326
  }
327
 
@@ -329,80 +328,56 @@ if (!class_exists('CustomContactFormsDB')) {
329
  global $wpdb;
330
  $this->dettachFieldOptionAll($oid);
331
  $where_params = ($slug == NULL) ? "id='$oid'" : "option_slug='$slug'";
332
- $wpdb->query("DELETE FROM " . CCF_FIELD_OPTIONS_TABLE . ' WHERE ' . $where_params);
333
- return true;
334
- }
335
-
336
- function deleteUserData($uid) {
337
- global $wpdb;
338
- $wpdb->query("DELETE FROM " . CCF_USER_DATA_TABLE . " WHERE id='$uid'");
339
  return true;
340
  }
341
 
342
- function selectAllFromTable($table, $output_type = OBJECT) {
343
- global $wpdb;
344
- return $wpdb->get_results('SELECT * FROM ' . $table, $output_type);
345
- }
346
-
347
  function selectAllForms() {
348
  global $wpdb;
349
- return $wpdb->get_results("SELECT * FROM " . CCF_FORMS_TABLE . " ORDER BY form_slug ASC");
350
  }
351
 
352
  function selectAllFields() {
353
  global $wpdb;
354
- return $wpdb->get_results("SELECT * FROM " . CCF_FIELDS_TABLE . " ORDER BY field_slug ASC");
355
  }
356
 
357
  function selectAllFieldOptions() {
358
  global $wpdb;
359
- return $wpdb->get_results("SELECT * FROM " . CCF_FIELD_OPTIONS_TABLE . " ORDER BY option_slug ASC");
360
  }
361
 
362
  function selectAllStyles() {
363
  global $wpdb;
364
- return $wpdb->get_results("SELECT * FROM " . CCF_STYLES_TABLE . " ORDER BY style_slug ASC");
365
- }
366
-
367
- function selectAllUserData() {
368
- global $wpdb;
369
- return $wpdb->get_results("SELECT * FROM " . CCF_USER_DATA_TABLE . " ORDER BY data_time DESC");
370
  }
371
 
372
  function selectForm($fid, $form_slug = '') {
373
  global $wpdb;
374
  $extra = (!empty($form_slug)) ? " or form_slug = '$form_slug'" : '';
375
- return $wpdb->get_row("SELECT * FROM " . CCF_FORMS_TABLE . " WHERE id='$fid' $extra");
376
  }
377
 
378
  function selectStyle($sid, $style_slug = '') {
379
  global $wpdb;
380
  $extra = (!empty($style_slug)) ? " or style_slug = '$style_slug'" : '';
381
- return $wpdb->get_row("SELECT * FROM " . CCF_STYLES_TABLE . " WHERE id='$sid' $extra");
382
  }
383
 
384
  function selectField($fid, $field_slug = '') {
385
  global $wpdb;
386
  $extra = (!empty($field_slug)) ? " or field_slug = '$field_slug'" : '';
387
- return $wpdb->get_row("SELECT * FROM " . CCF_FIELDS_TABLE . " WHERE id='$fid'" . $extra);
388
  }
389
 
390
  function selectFieldOption($oid, $option_slug = '') {
391
  global $wpdb;
392
  $extra = (!empty($option_slug)) ? " or option_slug = '$option_slug'" : '';
393
- return $wpdb->get_row("SELECT * FROM " . CCF_FIELD_OPTIONS_TABLE . " WHERE id='$oid'" . $extra);
394
- }
395
-
396
- function selectUserData($uid) {
397
- global $wpdb;
398
- return $wpdb->get_row("SELECT * FROM " . CCF_USER_DATA_TABLE . " WHERE id='$uid'");
399
  }
400
 
401
  function addFieldToForm($field_id, $form_id) {
402
- $field = $this->selectField($field_id);
403
- if (empty($field)) return false;
404
- $form = $this->selectForm($form_id);
405
- if (empty($form)) return false;
406
  $fields = $this->getAttachedFieldsArray($form_id);
407
  if (!in_array($field_id, $fields)) {
408
  $new_fields = $form->form_fields . $field_id . ',';
@@ -413,10 +388,7 @@ if (!class_exists('CustomContactFormsDB')) {
413
  }
414
 
415
  function addFieldOptionToField($option_id, $field_id) {
416
- $option = $this->selectFieldOption($option_id);
417
- if (empty($option)) return false;
418
  $field = $this->selectField($field_id);
419
- if (empty($field)) return false;
420
  $options = $this->getAttachedFieldOptionsArray($field_id);
421
  if (!in_array($option_id, $options)) {
422
  $new_options = $field->field_options . $option_id . ',';
@@ -508,14 +480,6 @@ if (!class_exists('CustomContactFormsDB')) {
508
  return (!empty($test));
509
  }
510
 
511
- function insertUserData($data_object) {
512
- global $wpdb;
513
- //$wpdb->show_errors();
514
- $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()));
515
- //$wpdb->print_error();
516
- return $wpdb->insert_id;
517
- }
518
-
519
  function insertDefaultContent($overwrite = false) {
520
  $field_slugs = array('name' => 'ccf_name', 'message' => 'ccf_message',
521
  'website' => 'ccf_website', 'phone' => 'ccf_phone', 'google' => 'ccf_google',
@@ -541,7 +505,7 @@ if (!class_exists('CustomContactFormsDB')) {
541
  'field_maxlength' => 30, 'field_type' => 'Text');
542
  $google_field = array('field_slug' => $field_slugs[google], 'field_label' => 'Did you find my website through Google?',
543
  'field_required' => 0, 'field_instructions' => 'If you found my website through Google, check this box.',
544
- 'field_maxlength' => 0, 'field_type' => 'Checkbox', 'field_value' => 'Yes');
545
  $contact_method_field = array('field_slug' => $field_slugs[contact_method], 'field_label' => 'How should we contact you?',
546
  'field_required' => 1, 'field_instructions' => 'By which method we should contact you?',
547
  'field_maxlength' => 0, 'field_type' => 'Dropdown');
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
  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
  ) 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
  ) 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
 
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
  $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
  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
  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
  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
  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
  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
  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
  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
  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
  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
  }
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
  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
  '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');
custom-contact-forms-export.php DELETED
@@ -1,101 +0,0 @@
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
-
13
- function CustomContactFormsExport() {
14
- $this->exports_path = CCF_BASE_PATH . 'export/';
15
- }
16
-
17
- function exportAll() {
18
- $out = '';
19
- foreach ($GLOBALS[ccf_tables_array] as $table)
20
- $out .= $this->exportTable($table);
21
- $this->last_export_content = $out;
22
- return $out;
23
- }
24
-
25
- function exportTable($table) {
26
- $out = '';
27
- $data = parent::selectAllFromTable($table, ARRAY_A);
28
- foreach ($data as $row) {
29
- $no_insert = 0;
30
- $cols = '';
31
- $vals = '';
32
- foreach ($row as $k => $v) {
33
- if (array_key_exists($k, $GLOBALS[ccf_fixed_fields])) {
34
- $no_insert = 1;
35
- break;
36
- }
37
- $v = str_replace(';', '\;', $v);
38
- $cols .= "$k, ";
39
- $vals .= "'$v', ";
40
- } if ($no_insert != 1) {
41
- $vals = substr($vals, 0, strlen($vals) - 2);
42
- $cols = substr($cols, 0, strlen($cols) - 2);
43
- $statement = 'INSERT INTO `' . $table . '` (' . $cols . ') VALUES (' . CustomContactFormsStatic::escapeSemiColons($vals) . ');';
44
- $statement = $statement . "\n\n";
45
- $out .= $statement;
46
- }
47
- }
48
- return $out;
49
- }
50
-
51
- function exportToFile($export_content = NULL) {
52
- if ($export_content == NULL) $export_content = $this->getLastExportContent();
53
- $export_file = "ccf-export-" . strtolower(date('j-M-Y--h-i-s')) . '.sql';
54
- if (($export_handle = @fopen($this->getExportsPath() . $export_file, 'w')) == false)
55
- return false;
56
- fwrite($export_handle, $export_content);
57
- fclose($export_handle);
58
- $this->last_export_file = $export_file;
59
- return $export_file;
60
- }
61
-
62
- function getExportsPath() {
63
- return $this->exports_path;
64
- }
65
-
66
- function getLastExportContent() {
67
- return $this->last_export_content;
68
- }
69
-
70
- function importFromFile($file) {
71
- $path = CCF_BASE_PATH. 'import/';
72
- $file_name = basename(time() . $file['name']);
73
- if (move_uploaded_file($file['tmp_name'], $path . $file_name)) {
74
- $data = file_get_contents($path . $file_name);
75
- $commands = $this->parseMultiQuery($data);
76
- $errors = 0;
77
- foreach($commands as $command) {
78
- if (!parent::query($command)) $errors++;
79
- }
80
- return ($errors == 0) ? true : $errors;
81
- }
82
- return false;
83
- }
84
-
85
- function parseMultiQuery($sql, $unescape_semicolons = true, $replace_table_prefix = true) {
86
- if (empty($sql)) return false;
87
- $prefix = CustomContactFormsStatic::getWPTablePrefix();
88
- $commands = preg_split('/\);[\n\r]*/ims', $sql);
89
- foreach ($commands as $k => $v) {
90
- $commands[$k] = $v . ')';
91
- if ($unescape_semicolons)
92
- $commands[$k] = CustomContactFormsStatic::unescapeSemiColons($commands[$k]);
93
- if ($replace_table_prefix)
94
- $commands[$k] = preg_replace('/^INSERT INTO `.+?customcontactforms_(.+?)`/is', 'INSERT INTO `' . $prefix . 'customcontactforms_$1`', $commands[$k]);
95
- }
96
- array_pop($commands);
97
- return $commands;
98
- }
99
-
100
- }
101
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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 DELETED
@@ -1,69 +0,0 @@
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 DELETED
@@ -1,96 +0,0 @@
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, 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. <a href="options-general.php?page=custom-contact-forms">Settings</a>
6
- Version: 4.0.0.b2
7
  Author: Taylor Lovett
8
  Author URI: http://www.taylorlovett.com
9
  */
@@ -21,17 +21,27 @@
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 $version = '4.0.0';
31
- var $form_errors = array();
32
  var $error_return;
33
  var $current_form;
34
  var $current_thank_you_message;
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  function activatePlugin() {
37
  $admin_options = $this->getAdminOptions();
@@ -46,7 +56,7 @@ if (!class_exists('CustomContactForms')) {
46
  $admin_email = get_option('admin_email');
47
  $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!',
48
  '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',
49
- 'show_install_popover' => 0, 'email_form_submissions' => 1); // default general settings
50
  $customcontactOptions = get_option($this->adminOptionsName);
51
  if (!empty($customcontactOptions)) {
52
  foreach ($customcontactOptions as $key => $option)
@@ -59,18 +69,6 @@ if (!class_exists('CustomContactForms')) {
59
  if (!is_admin()) {
60
  $this->startSession();
61
  $this->processForms();
62
- } else {
63
- $this->downloadExportFile();
64
- }
65
- }
66
-
67
- function downloadExportFile() {
68
- if ($_POST[ccf_export]) {
69
- require_once('custom-contact-forms-export.php');
70
- $transit = new CustomContactFormsExport();
71
- $transit->exportAll();
72
- $file = $transit->exportToFile();
73
- CustomContactFormsStatic::redirect(get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/download.php?location=export/' . $file);
74
  }
75
  }
76
 
@@ -93,20 +91,11 @@ if (!class_exists('CustomContactForms')) {
93
  }
94
 
95
  function insertAdminScripts() {
96
- if (is_admin()) {
97
- ?>
98
- <script type="text/javascript" language="javascript">
99
- var ccf_plugin_dir = "<?php echo get_option('siteurl') . '/wp-content/plugins/custom-contact-forms'; ?>";
100
- var ccf_file = "<?php echo get_option('siteurl') . '/wp-admin/options-general.php?page=custom-contact-forms'; ?>";
101
- </script>
102
- <?php
103
- wp_enqueue_script('ccf-admin-inc', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/custom-contact-forms-admin-inc.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'/*, 'jquery-ui-draggable', 'jquery-ui-resizable', 'jquery-ui-dialog'*/), '1.0');
104
- wp_enqueue_script('ccf-admin', 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');
105
- wp_enqueue_script('ccf-colorpicker', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/colorpicker.js');
106
- wp_enqueue_script('ccf-eye', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/eye.js');
107
- wp_enqueue_script('ccf-utils', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/utils.js');
108
- wp_enqueue_script('ccf-layout', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/layout.js?ver=1.0.2');
109
- }
110
  }
111
 
112
  function insertFrontEndScripts() {
@@ -144,24 +133,15 @@ if (!class_exists('CustomContactForms')) {
144
  <a href="javascript:void(0)" class="close">[close]</a>
145
  </div>
146
  <div class="popover-body">
147
- <ul id="popover-tof">
148
- <li><a href="#pop-forms">Forms</a></li>
149
- <li><a href="#pop-fields">Fields</a></li>
150
- <li><a href="#pop-field-options">Field Options</a></li>
151
- <li><a href="#pop-styles">Styles</a></li>
152
- <li><a href="#pop-custom-html">Custom HTML Forms</a></li>
153
- <li><a href="#pop-import-export">Import / Export</a></li>
154
- <li><a href="#pop-form-submissions">Form Submissions</a></li>
155
- </ul>
156
  <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.
157
  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>
158
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
159
  <input type="submit" class="insert-default-content-button" value="Insert Default Content" name="insert_default_content" />
160
  </form>
161
- <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>
162
  <ul>
163
  <li>
164
- <h3>Fields<a name="pop-fields"></a></h3>
165
  <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>
166
  <ul>
167
  <li><span>Text:</span>
@@ -190,7 +170,7 @@ if (!class_exists('CustomContactForms')) {
190
  <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>
191
  </li>
192
  <li>
193
- <h3>Field Options<a name="pop-field-options"></a></h3>
194
  <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>
195
  <ul>
196
  <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>
@@ -200,7 +180,7 @@ if (!class_exists('CustomContactForms')) {
200
  <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>
201
  </li>
202
  <li>
203
- <h3>Forms<a name="pop-forms"></a></h3>
204
  <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>
205
  <ul>
206
  <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>
@@ -220,13 +200,13 @@ if (!class_exists('CustomContactForms')) {
220
  <div class="ccf-success-popover-example"></div>
221
  </li>
222
  <li>
223
- <h3>Style Manager<a name="pop-styles"></a></h3>
224
  <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>
225
  <p>The image below will help you better understand how each style option will change your forms.</p>
226
  <div class="ccf-style-example"></div>
227
  </li>
228
  <li>
229
- <h3>Custom HTML Forms Feature (advanced)<a name="pop-custom-html"></a></h3>
230
  <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>
231
  <ul>
232
  <li>Keep the form action/method the same (yes the action is supposed to be empty).</li>
@@ -235,14 +215,6 @@ if (!class_exists('CustomContactForms')) {
235
  </ul>
236
  <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>
237
  </li>
238
- <li>
239
- <h3>Saved Form Submissions<a name="pop-form-submissions"></a></h3>
240
- <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>
241
- </li>
242
- <li>
243
- <h3>Import / Export<a name="pop-import-export"></a></h3>
244
- <p>Import/export is a new field 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. 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.</p>
245
- </li>
246
  </ul>
247
  </div>
248
  </div>
@@ -275,7 +247,6 @@ if (!class_exists('CustomContactForms')) {
275
  $admin_options[show_widget_archives] = $_POST[show_widget_archives];
276
  $admin_options[show_widget_home] = $_POST[show_widget_home];
277
  $admin_options[custom_thank_you] = $_POST[custom_thank_you];
278
- $admin_options[email_form_submissions] = $_POST[email_form_submissions];
279
  $admin_options[author_link] = $_POST[author_link];
280
  $admin_options[enable_jquery] = $_POST[enable_jquery];
281
  $admin_options[code_type] = $_POST[code_type];
@@ -318,58 +289,6 @@ if (!class_exists('CustomContactForms')) {
318
  parent::updateFieldOption($_POST[option], $_POST[oid]);
319
  } elseif ($_POST[create_field_option]) {
320
  parent::insertFieldOption($_POST[option]);
321
- } elseif ($_POST[form_submission_delete]) {
322
- parent::deleteUserData($_POST[uid]);
323
- } elseif ($_POST[ccf_import]) {
324
- require_once('custom-contact-forms-export.php');
325
- $transit = new CustomContactFormsExport();
326
- $transit->importFromFile($_FILES[import_file]);
327
- } elseif ($_POST[ajax_action]) {
328
- switch ($_POST[ajax_action]) {
329
- case 'delete':
330
- if (empty($_POST[object_id])) exit;
331
- switch($_POST[object_type]) {
332
- case 'form':
333
- parent::deleteForm($_POST[object_id]);
334
- break;
335
- case 'field':
336
- parent::deleteField($_POST[object_id]);
337
- break;
338
- case 'field_option':
339
- parent::deleteFieldOption($_POST[object_id]);
340
- break;
341
- case 'form_submission':
342
- parent::deleteUserData($_POST[object_id]);
343
- break;
344
- case 'style':
345
- parent::deleteStyle($_POST[object_id]);
346
- break;
347
- }
348
- break;
349
- case 'create_field_option':
350
- parent::insertFieldOption($_POST[option]);
351
- break;
352
- case 'edit':
353
- echo '<div style="margin-left:100px">';
354
- print_r($_POST);
355
- echo '</div>';
356
- if (empty($_POST[object_id])) exit;
357
- switch($_POST[object_type]) {
358
- case 'form':
359
- if (!empty($_POST[form])) parent::updateForm($_POST[form], $_POST[object_id]);
360
- break;
361
- case 'field':
362
- if (!empty($_POST[field])) parent::updateField($_POST[field], $_POST[object_id]);
363
- break;
364
- case 'field_option':
365
- if (!empty($_POST[option])) parent::updateFieldOption($_POST[option], $_POST[object_id]);
366
- break;
367
- case 'style':
368
- if (!empty($_POST[style])) parent::updateStyle($_POST[style], $_POST[object_id]);
369
- break;
370
- }
371
- break;
372
- }
373
  }
374
  $styles = parent::selectAllStyles();
375
  $style_options = '<option value="0">Default</option>';
@@ -387,16 +306,17 @@ if (!class_exists('CustomContactForms')) {
387
  <li><a href="#manage-fields">Manage Fields</a></li>
388
  <li><a href="#manage-fixed-fields">Manage Fixed Fields</a></li>
389
  <li><a href="#manage-forms">Manage Forms</a></li>
390
- <li><a href="#form-submissions">Saved Form Submissions (New!)</a></li>
391
  <li><a href="#create-styles">Create Styles</a></li>
392
  <li><a href="#manage-styles">Manage Styles</a></li>
393
  <li><a href="#manage-field-options">Manage Field Options</a></li>
394
  <li><a href="#contact-author">Suggest a Feature</a></li>
395
  <li><a href="#contact-author">Bug Report</a></li>
396
- <li><a href="#custom-html">Custom HTML Forms</a></li>
397
- <li><a href="#import-export">Import / Export (New!)</a></li>
398
  <li class="last"><a href="#plugin-news">Plugin News</a></li>
399
- </ul><a name="create-fields"></a>
 
 
 
400
  <div id="create-fields" class="postbox">
401
  <h3 class="hndle"><span>Create A Form Field</span></h3>
402
  <div class="inside">
@@ -532,7 +452,7 @@ if (!class_exists('CustomContactForms')) {
532
 
533
  ?>
534
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
535
- <tr<?php if ($z % 2 == 1) echo ' class="evenrow"'; ?>>
536
 
537
  <td><input type="text" name="field[field_slug]" class="width100" maxlength="50" value="<?php echo $fields[$i]->field_slug; ?>" /></td>
538
  <td><input type="text" name="field[field_label]" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" /></td>
@@ -548,15 +468,14 @@ if (!class_exists('CustomContactForms')) {
548
  <input type="text" class="width50" name="field[field_maxlength]" value="<?php echo $fields[$i]->field_maxlength; ?>" />
549
  <?php } ?>
550
  </td>
551
- <td><input type="hidden" class="object-type" name="object_type" value="field" />
552
- <input type="hidden" class="object-id" name="fid" value="<?php echo $fields[$i]->id; ?>" />
553
  <span class="fields-options-expand"></span>
554
- <input type="submit" class="edit-button" name="field_edit" value="Save" />
555
- <input type="submit" name="field_delete" class="delete-button" value="Delete" /></td>
556
 
557
  </tr>
558
  <tr<?php if ($z % 2 == 1) echo ' class="evenrow"'; ?>>
559
- <td class="fields-extra-options" colspan="7">
560
  <div class="field-instructions">
561
  <label for="field_instructions">Field Instructions:</label>
562
  <input type="text" class="width150" name="field[field_instructions]" value="<?php echo $fields[$i]->field_instructions; ?>" />
@@ -635,7 +554,7 @@ if (!class_exists('CustomContactForms')) {
635
 
636
  ?>
637
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
638
- <tr <?php if ($z % 2 == 0) echo ' class="evenrow"'; ?>>
639
 
640
  <td><?php echo $fields[$i]->field_slug; ?></td>
641
  <td><input type="text" name="field[field_label]" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" /></td>
@@ -661,13 +580,12 @@ if (!class_exists('CustomContactForms')) {
661
  <?php } ?>
662
  </td>
663
 
664
- <td><input type="hidden" class="object-type" name="object_type" value="field" />
665
- <input type="hidden" class="object-id" name="fid" value="<?php echo $fields[$i]->id; ?>" />
666
  <span class="fixed-fields-options-expand"></span>
667
- <input type="submit" name="field_edit" class="edit-button" value="Save" /></td>
668
  </tr>
669
- <tr <?php if ($z % 2 == 0) echo ' class="evenrow"'; ?>>
670
- <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>
671
  </tr>
672
  </form>
673
  <?php
@@ -707,11 +625,10 @@ if (!class_exists('CustomContactForms')) {
707
  <td class="label"><input type="text" name="option[option_label]" value="<?php echo $option->option_label; ?>" class="width100" /></td>
708
  <td class="option-value"><input type="text" name="option[option_value]" value="<?php echo $option->option_value; ?>" class="width100" /></td>
709
  <td class="action">
710
- <input type="submit" value="Save" class="edit-button" name="edit_field_option" />
711
- <input type="submit" class="delete-button" value="Delete" name="delete_field_option" />
712
  </td>
713
- <input type="hidden" class="object-type" name="object_type" value="field_option" />
714
- <input type="hidden" class="object-id" name="oid" value="<?php echo $option->id; ?>" />
715
  </form>
716
  </tr>
717
  <?php
@@ -730,7 +647,6 @@ if (!class_exists('CustomContactForms')) {
730
  <div class="action">Action</div>
731
  </div>
732
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']?>">
733
- <input type="hidden" name="object_type" value="field_option" />
734
  <div class="create-field-options-header">Create a Field Option</div>
735
  <ul id="create-field-options">
736
  <li><label for="option[option_slug]">* Option Slug:</label> <input maxlength="20" type="text" name="option[option_slug]" /><br />
@@ -739,7 +655,7 @@ if (!class_exists('CustomContactForms')) {
739
  (This is what is shown to the user in the dropdown or radio field. Example:)</li>
740
  <li><label for="option[option_value]">Option Value:</label> <input type="text" name="option[option_value]" /><br />
741
  (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>
742
- <li><input type="submit" class="create-button" name="create_field_option" value="Create Field Option" /></li>
743
  </ul>
744
  <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>
745
  </form>
@@ -775,15 +691,14 @@ if (!class_exists('CustomContactForms')) {
775
  <td><input type="text" class="width125" name="form[form_title]" value="<?php echo $forms[$i]->form_title; ?>" /></td>
776
  <td><input class="width100" type="text" name="form[submit_button_text]" value="<?php echo $forms[$i]->submit_button_text; ?>" /></td>
777
  <td><select name="form[form_style]"><?php echo $sty_opt; ?></select></td>
778
- <td><input type="hidden" class="object-id" name="fid" value="<?php echo $forms[$i]->id; ?>" />
779
- <input type="hidden" class="object-type" name="object_type" value="form" />
780
  <span class="form-options-expand"></span>
781
- <input type="submit" name="form_edit" class="edit-button" value="Save" />
782
- <input type="submit" name="form_delete" class="delete-button" value="Delete" />
783
  </td>
784
  </tr>
785
  <tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
786
- <td class="form-extra-options textcenter" colspan="8">
787
  <table class="form-extra-options-table">
788
  <tbody>
789
  <tr>
@@ -856,95 +771,12 @@ if (!class_exists('CustomContactForms')) {
856
  </tr>
857
 
858
  </tfoot>
859
- </table>
860
- <?php
861
- require_once('custom-contact-forms-user-data.php');
862
- $user_data_array = parent::selectAllUserData();
863
- ?>
864
- <a name="form-submissions"></a>
865
- <h3 class="manage-h3">Saved Form Submissions</h3>
866
- <table class="widefat post" id="form-submissions" cellspacing="0">
867
- <thead>
868
- <tr>
869
- <th scope="col" class="manage-column width250">Date Submitted</th>
870
- <th scope="col" class="manage-column width150">Form Submitted</th>
871
- <th scope="col" class="manage-column width250">Form Page</th>
872
- <th scope="col" class="manage-column "><div class="alignright">Action</div></th>
873
- </tr>
874
- </thead>
875
- <tbody>
876
- <?php
877
- $i = 0;
878
- foreach ($user_data_array as $data_object) {
879
- $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));
880
- ?>
881
- <tr class="submission-top <?php if ($i % 2 == 0) echo 'evenrow'; ?>">
882
- <td><?php echo date('F d, Y h:i:s A', $data->getDataTime()); ?></td>
883
- <td>
884
- <?php
885
- if ($data->getFormID() > 0) {
886
- $data_form = parent::selectForm($data->getFormID());
887
- echo $data_form->form_slug;
888
- } else
889
- echo 'Custom HTML Form'
890
- ?>
891
- </td>
892
- <td>
893
- <?php echo $data->getFormPage(); ?>
894
- </td>
895
- <td class="alignright">
896
- <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
897
- <span class="submission-content-expand"></span>
898
- <input type="submit" class="delete-button" value="Delete" name="form_submission_delete" />
899
- <input type="hidden" class="object-type" name="object_type" value="form_submission" />
900
- <input type="hidden" class="object-id" value="<?php echo $data_object->id; ?>" name="uid" />
901
- </form>
902
- </td>
903
- </tr>
904
- <tr class="submission-content <?php if ($i % 2 == 0) echo 'evenrow'; ?>">
905
- <td colspan="4">
906
- <ul>
907
- <?php
908
- $data_array = $data->getDataArray();
909
- foreach ($data_array as $item_key => $item_value) {
910
- ?>
911
- <li>
912
- <div><?php echo $item_key; ?></div>
913
- <p><?php echo $item_value; ?></p>
914
- </li>
915
- <?php
916
- }
917
- ?>
918
- </ul>
919
- </td>
920
- </tr>
921
- <?php
922
- $i++;
923
- }
924
- ?>
925
- </tbody>
926
- <tfoot>
927
- <tr>
928
- <th scope="col" class="manage-column width250">Date Submitted</th>
929
- <th scope="col" class="manage-column width150">Form Submitted</th>
930
- <th scope="col" class="manage-column width250">Form Page</th>
931
- <th scope="col" class="manage-column "><div class="alignright">Action</div></th>
932
- </tr>
933
- </tfoot>
934
- </table>
935
-
936
- <a name="general-settings"></a>
937
  <div id="general-settings" class="postbox">
938
  <h3 class="hndle"><span>General Settings</span></h3>
939
  <div class="inside">
940
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
941
  <ul>
942
- <li>
943
- <label for="email_form_submissions">Email Form Submissions:</label>
944
- <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>
945
- </li>
946
- <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>
947
-
948
  <li>
949
  <label for="default_to_email">Default Email:</label>
950
  <input name="default_to_email" value="<?php echo $admin_options[default_to_email]; ?>" type="text" maxlength="100" />
@@ -1030,7 +862,7 @@ if (!class_exists('CustomContactForms')) {
1030
  On Archives</label>
1031
  </li>
1032
  <li>
1033
- <input type="submit" value="Update" name="general_settings" />
1034
  </li>
1035
  </ul>
1036
  </form>
@@ -1065,9 +897,8 @@ if (!class_exists('CustomContactForms')) {
1065
  <div id="create-styles" class="postbox">
1066
  <h3 class="hndle"><span>Create A Style for Your Forms</span></h3>
1067
  <div class="inside">
1068
- <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>
1069
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1070
- <ul class="style_left">
1071
  <li>
1072
  <label for="style_slug">* Style Slug:</label>
1073
  <input type="text" maxlength="30" class="width75" name="style[style_slug]" />
@@ -1082,7 +913,7 @@ if (!class_exists('CustomContactForms')) {
1082
  (ex: FF0000)</li>
1083
  <li>
1084
  <label for="label_width">Label Width:</label>
1085
- <input type="text" maxlength="20" value="200px" class="width75" name="style[label_width]" />
1086
  (ex: 100px or 20%)</li>
1087
  <li>
1088
  <label for="label_fontsize">Label Font Size:</label>
@@ -1102,11 +933,11 @@ if (!class_exists('CustomContactForms')) {
1102
  (ex: 100px or 100%)</li>
1103
  <li>
1104
  <label for="textarea_height">Textarea Field Height:</label>
1105
- <input type="text" maxlength="20" value="90px" class="width75" name="style[textarea_height]" />
1106
  (ex: 100px or 100%)</li>
1107
  <li>
1108
  <label for="field_fontsize">Field Font Size:</label>
1109
- <input type="text" maxlength="20" value="1.3em" class="width75" name="style[field_fontsize]" />
1110
  (ex: 10px, 10pt, 1em</li>
1111
  <li>
1112
  <label for="field_fontcolor">Field Font Color:</label>
@@ -1118,15 +949,15 @@ if (!class_exists('CustomContactForms')) {
1118
  </li>
1119
  <li>
1120
  <label for="form_margin">Form Margin:</label>
1121
- <input type="text" maxlength="20" value="7px" class="width75" name="style[form_margin]" />
1122
  (ex: 5px or 1em)</li>
1123
  <li>
1124
  <label for="label_margin">Label Margin:</label>
1125
- <input type="text" maxlength="20" value="5px" class="width75" name="style[label_margin]" />
1126
  (ex: 5px or 1em)</li>
1127
  <li>
1128
  <label for="textarea_backgroundcolor">Textarea Background Color:</label>
1129
- <input type="text" maxlength="20" value="f5f5f5" class="width75 colorfield" name="style[textarea_backgroundcolor]" />
1130
  (ex: FF0000)</li>
1131
  <li>
1132
  <label for="success_popover_fontcolor">Success Popover Font Color:</label>
@@ -1134,49 +965,41 @@ if (!class_exists('CustomContactForms')) {
1134
  (ex: 333333)</li>
1135
  <li>
1136
  <label for="success_popover_title_fontsize">Success Popover Title Font Size:</label>
1137
- <input type="text" maxlength="20" value="15px" class="width75" name="style[success_popover_title_fontsize]" />
1138
- (ex: 12px, 1em, 100%)</li>
1139
- <li>
1140
- <label for="form_backgroundcolor">Form Background Color:</label>
1141
- <input type="text" maxlength="20" value="ffffff" class="width75 colorfield" name="style[form_backgroundcolor]" />
1142
  (ex: 12px, 1em, 100%)</li>
1143
- <li>
1144
- <label for="field_borderround">Field Border Roundness:</label>
1145
- <input type="text" maxlength="20" value="6px" class="width75" name="style[field_borderround]" />
1146
- (ex: 6px, or 0px)</li>
1147
  </ul>
1148
  <ul class="style_right">
1149
  <li>
1150
  <label for="input_width">Field Border Color:</label>
1151
- <input type="text" maxlength="20" value="999999" class="width75 colorfield" name="style[field_bordercolor]" />
1152
  (ex: 100px or 100%)</li>
1153
  <li>
1154
  <label for="form_borderstyle">Form Border Style:</label>
1155
- <select class="width75" name="style[form_borderstyle]"><?php echo $border_style_options; ?></select>
1156
  </li>
1157
  <li>
1158
  <label for="form_bordercolor">Form Border Color:</label>
1159
- <input type="text" maxlength="20" value="ffffff" class="width75 colorfield" name="style[form_bordercolor]" />
1160
  (ex: 000000)</li>
1161
  <li>
1162
  <label for="form_borderwidth">Form Border Width:</label>
1163
- <input type="text" maxlength="20" value="0px" class="width75" name="style[form_borderwidth]" />
1164
  (ex: 1px)</li>
1165
  <li>
1166
  <label for="form_borderwidth">Form Width:</label>
1167
- <input type="text" maxlength="20" value="100%" class="width75" name="style[form_width]" />
1168
  (ex: 100px or 50%)</li>
1169
  <li>
1170
  <label for="form_borderwidth">Form Font Family:</label>
1171
- <input type="text" maxlength="120" value="Verdana, tahoma, arial" class="width75" name="style[form_fontfamily]" />
1172
  (ex: Verdana, Tahoma, Arial)</li>
1173
  <li>
1174
  <label for="submit_width">Button Width:</label>
1175
- <input type="text" maxlength="20" value="auto" class="width75" name="style[submit_width]" />
1176
- (ex: 100px, 30%, auto)</li>
1177
  <li>
1178
  <label for="submit_height">Button Height:</label>
1179
- <input type="text" maxlength="20" value="30px" class="width75" name="style[submit_height]" />
1180
  (ex: 100px or 30%)</li>
1181
  <li>
1182
  <label for="submit_fontsize">Button Font Size:</label>
@@ -1188,15 +1011,15 @@ if (!class_exists('CustomContactForms')) {
1188
  (ex: FF0000)</li>
1189
  <li>
1190
  <label for="field_backgroundcolor">Field Background Color:</label>
1191
- <input type="text" maxlength="20" value="f5f5f5" class="width75 colorfield" name="style[field_backgroundcolor]" />
1192
  (ex: FF0000)</li>
1193
  <li>
1194
  <label for="form_padding">Form Padding:</label>
1195
- <input type="text" maxlength="20" value="8px" class="width75" name="style[form_padding]" />
1196
  (ex: 5px or 1em)</li>
1197
  <li>
1198
  <label for="title_margin">Title Margin:</label>
1199
- <input type="text" maxlength="20" value="5px" class="width75" name="style[title_margin]" />
1200
  (ex: 5px or 1em)</li>
1201
  <li>
1202
  <label for="title_margin">Dropdown Width:</label>
@@ -1210,6 +1033,10 @@ if (!class_exists('CustomContactForms')) {
1210
  <label for="success_popover_fontsize">Success Popover Font Size:</label>
1211
  <input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_fontsize]" />
1212
  (ex: 12px, 1em, 100%)</li>
 
 
 
 
1213
  <li>
1214
  <label for="success_popover_height">Success Popover Height:</label>
1215
  <input type="text" maxlength="20" value="200px" class="width75" name="style[success_popover_height]" />
@@ -1242,11 +1069,11 @@ if (!class_exists('CustomContactForms')) {
1242
  <tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
1243
  <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1244
  <td><label>* Slug:</label> <input type="text" maxlength="30" value="<?php echo $style->style_slug; ?>" name="style[style_slug]" /><br />
1245
- <label>Font Family:</label><input type="text" maxlength="120" value="<?php echo $style->form_fontfamily; ?>" name="style[form_fontfamily]" /><br />
1246
  <label>Textarea Background<br />Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->textarea_backgroundcolor; ?>" name="style[textarea_backgroundcolor]" /><br />
1247
  <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 />
1248
- <input type="submit" class="submit-styles edit-button" name="style_edit" value="Save" /><br />
1249
- <input type="submit" class="submit-styles delete-button" name="style_delete" value="Delete Style" />
1250
  </td>
1251
 
1252
  <td>
@@ -1265,7 +1092,6 @@ if (!class_exists('CustomContactForms')) {
1265
  <label>Field Background Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_backgroundcolor; ?>" name="style[field_backgroundcolor]" /><br />
1266
  <label>Title Margin:</label><input type="text" maxlength="20" value="<?php echo $style->title_margin; ?>" name="style[title_margin]" /><br />
1267
  <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]" />
1268
- <label>Form Background Color:</label><input type="text" class="colorfield" maxlength="20" value="<?php echo $style->form_backgroundcolor; ?>" name="style[form_backgroundcolor]" />
1269
  </td>
1270
 
1271
  <td>
@@ -1292,9 +1118,7 @@ if (!class_exists('CustomContactForms')) {
1292
  <label>Field Border Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_bordercolor; ?>" name="style[field_bordercolor]" /><br />
1293
  <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 />
1294
  <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 />
1295
- <label>Field Border Roundness:</label><input name="style[field_borderround]" value="<?php echo $style->field_borderround; ?>" type="text" maxlength="20" /><br />
1296
- <input type="hidden" class="object-type" name="object_type" value="style" />
1297
- <input name="sid" type="hidden" class="object-id" value="<?php echo $style->id; ?>" />
1298
  </td>
1299
 
1300
  </form>
@@ -1326,7 +1150,7 @@ if (!class_exists('CustomContactForms')) {
1326
  <input id="email" type="text" value="<?php echo get_option('admin_email'); ?>" name="email" maxlength="100" /></li>
1327
  <li><label for="message">* Your Message:</label>
1328
  <textarea id="message" name="message"></textarea></li>
1329
- <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>
1330
  </ul>
1331
  <p><input type="submit" name="contact_author" value="Send Message" /></p>
1332
  </form>
@@ -1356,25 +1180,6 @@ the field names you want required by commas. Remember to use underscores instead
1356
  &lt;/form&gt;</textarea>
1357
  </div>
1358
  </div>
1359
- <a name="import-export"></a>
1360
- <div id="import-export" class="postbox">
1361
- <h3 class="hndle"><span>Import / Export</span></h3>
1362
- <div class="inside">
1363
- <form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1364
- <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
1365
- <div class="import">
1366
- <p>Browse to a CCF .sql export file to import Custom Contact Form data from another Wordpress installation to this one.</p>
1367
- <input type="file" name="import_file" /> <input name="ccf_import" type="submit" value="Import" />
1368
- </div>
1369
- <div class="export">
1370
- <p>Preforming a Custom Contact Forms export will create a file of the form
1371
- ccf-export-xxxx.sql on your web server. The file created contains SQL that
1372
- will recreate all the plugin data on any Wordpress installation.</p>
1373
- <input type="submit" name="ccf_export" value="Export All CCF Plugin Content" />
1374
- </div>
1375
- </form>
1376
- </div>
1377
- </div>
1378
  <a name="plugin-news"></a>
1379
  <div id="plugin-news" class="postbox">
1380
  <h3 class="hndle"><span>Custom Contact Forms Plugin News</span></h3>
@@ -1511,10 +1316,10 @@ the field names you want required by commas. Remember to use underscores instead
1511
  $style = parent::selectStyle($form->form_style, '');
1512
  $style_class = $style->style_slug;
1513
  }
1514
- $form_title = CustomContactFormsStatic::decodeOption($form->form_title, 1, 1);
1515
  $action = (!empty($form->form_action)) ? $form->form_action : $_SERVER['REQUEST_URI'];
1516
  $out .= '<form id="'.$form_id.'" method="'.strtolower($form->form_method).'" action="'.$action.'" class="'.$style_class.'">' . "\n";
1517
- $out .= CustomContactFormsStatic::decodeOption($form->custom_code, 1, 1) . "\n";
1518
  if (!empty($form_title)) $out .= '<h4 id="h4-' . $form->id . '-' . $form_key . '">' . $form_title . '</h4>' . "\n";
1519
  $fields = parent::getAttachedFieldsArray($fid);
1520
  $hiddens = '';
@@ -1523,8 +1328,8 @@ the field names you want required by commas. Remember to use underscores instead
1523
  $field = parent::selectField($field_id, '');
1524
  $req = ($field->field_required == 1 or $field->field_slug == 'ishuman') ? '* ' : '';
1525
  $req_long = ($field->field_required == 1) ? ' (required)' : '';
1526
- $input_id = 'id="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'-'.$form_key.'"';
1527
- $field_value = CustomContactFormsStatic::decodeOption($field->field_value, 1, 1);
1528
  $instructions = (empty($field->field_instructions)) ? '' : 'title="' . $field->field_instructions . $req_long . '" class="ccf-tooltip-field"';
1529
  if ($admin_options[enable_widget_tooltips] == 0 && $is_sidebar) $instructions = '';
1530
  if ($_SESSION[fields][$field->field_slug]) {
@@ -1534,13 +1339,13 @@ the field names you want required by commas. Remember to use underscores instead
1534
  $out .= '<div>' . "\n" . $this->getCaptchaCode($form->id) . "\n" . '</div>' . "\n";
1535
  } elseif ($field->field_type == 'Text') {
1536
  $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="'.$field->field_maxlength.'"';
1537
- $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";
1538
  } elseif ($field->field_type == 'Hidden') {
1539
- $hiddens .= '<input type="hidden" name="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'" '.$input_id.''.$code_type.'>' . "\n";
1540
  } elseif ($field->field_type == 'Checkbox') {
1541
- $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";
1542
  } elseif ($field->field_type == 'Textarea') {
1543
- $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";
1544
  } elseif ($field->field_type == 'Dropdown') {
1545
  $field_options = '';
1546
  $options = parent::getAttachedFieldOptionsArray($field->id);
@@ -1551,8 +1356,8 @@ the field names you want required by commas. Remember to use underscores instead
1551
  $field_options .= '<option'.$option_sel.''.$option_value.'>' . $option->option_label . '</option>' . "\n";
1552
  }
1553
  if (!empty($options)) {
1554
- 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";
1555
- 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";
1556
  }
1557
  } elseif ($field->field_type == 'Radio') {
1558
  $field_options = '';
@@ -1560,33 +1365,30 @@ the field names you want required by commas. Remember to use underscores instead
1560
  foreach ($options as $option_id) {
1561
  $option = parent::selectFieldOption($option_id);
1562
  $option_sel = ($field->field_value == $option->option_slug) ? ' checked="checked"' : '';
1563
- $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";
1564
  }
1565
- $field_label = (!empty($field->field_label)) ? '<label for="'.CustomContactFormsStatic::decodeOption($field->field_slug, 1, 1).'">'. $req .CustomContactFormsStatic::decodeOption($field->field_label, 1, 1).'</label>' : '';
1566
  if (!empty($options)) $out .= '<div>'."\n".$field_label."\n".$field_options."\n".'</div>' . "\n";
1567
  }
1568
  }
1569
- $submit_text = (!empty($form->submit_button_text)) ? CustomContactFormsStatic::decodeOption($form->submit_button_text, 1, 0) : 'Submit';
1570
  $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>';
1571
  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>';
1572
 
1573
  if ($form->form_style != 0) {
1574
- $no_border = array('', '0', '0px', '0%', '0pt', '0em');
1575
- $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.'; ' : '';
1576
- $round_border_none = '-moz-border-radius:0px; -khtml-border-radius:0px; -webkit-border-radius:0px; ';
1577
  $form_styles .= '<style type="text/css">' . "\n";
1578
- $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";
1579
- $form_styles .= '#' . $form_id . " div { margin-bottom:6px; background-color:inherit; }\n";
1580
- $form_styles .= '#' . $form_id . " div div { margin:0; background-color:inherit; padding:0; }\n";
1581
- $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";
1582
- $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";
1583
  $form_styles .= '#' . $form_id . " div div input { margin-bottom:2px; line-height:normal; }";
1584
  $form_styles .= '#' . $form_id . " input[type=checkbox] { margin:0; }";
1585
  $form_styles .= '#' . $form_id . " label.checkbox, #" . $form_id . " label.radio, #" . $form_id . " label.select { display:inline; } \n";
1586
- $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";
1587
- $form_styles .= '#' . $form_id . " select { ".$round_border_none." width:".$style->dropdown_width."; }\n";
1588
  $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";
1589
- $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)."; height:".$style->textarea_height."; font-size:".$style->field_fontsize."; border:1px ".$style->field_borderstyle." #".parent::formatStyle($style->field_bordercolor)."; } \n";
1590
  $form_styles .= '</style>' . "\n";
1591
  }
1592
 
@@ -1617,7 +1419,7 @@ the field names you want required by commas. Remember to use underscores instead
1617
  $body .= "Message: $message\n";
1618
  $body .= "Message Type: $type\n";
1619
  $body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
1620
- $mailer = new CustomContactFormsMailer('admin@taylorlovett.com', $email, "CCF Message: $type", stripslashes($body), $admin_options[wp_mail_function]);
1621
  $mailer->send();
1622
  return true;
1623
  }
@@ -1679,22 +1481,17 @@ the field names you want required by commas. Remember to use underscores instead
1679
  if (in_array($key, $req_fields) && !empty($value))
1680
  unset($req_fields[array_search($key, $req_fields)]);
1681
  $body .= ucwords(str_replace('_', ' ', $key)) . ': ' . $value . "\n";
1682
- $data_array[$key] = $value;
1683
  }
1684
  } foreach($req_fields as $err)
1685
  $this->setFormError($err, 'You left the "' . $err . '" field blank.');
1686
  $errors = $this->getAllFormErrors();
1687
  if (empty($errors)) {
1688
- require_once('custom-contact-forms-user-data.php');
1689
  require_once('custom-contact-forms-mailer.php');
1690
- $data_object = new CustomContactFormsUserData(array('data_array' => $data_array, 'form_page' => $_SERVER['SERVER_NAME']. $_SERVER['REQUEST_URI'], 'form_id' => 0, 'data_time' => time()));
1691
- parent::insertUserData($data_object);
1692
  $body .= "\n" . 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
1693
- if ($admin_options[email_form_submissions] == 1) {
1694
- $mailer = new CustomContactFormsMailer($_POST[destination_email], $admin_options[default_from_email], $admin_options[default_form_subject], stripslashes($body), $admin_options[wp_mail_function]);
1695
- $mailer->send();
1696
- } if ($_POST[thank_you_page])
1697
- CustomContactFormsStatic::redirect($_POST[thank_you_page]);
1698
  $this->current_thank_you_message = (!empty($_POST[success_message])) ? $_POST[success_message] : $admin_options[form_success_message];
1699
  $this->current_form = 0;
1700
  add_action('wp_footer', array(&$this, 'insertFormSuccessCode'), 1);
@@ -1728,38 +1525,31 @@ the field names you want required by commas. Remember to use underscores instead
1728
  $checks[] = $field->field_slug;
1729
  }
1730
  $body = '';
1731
- $data_array = array();
1732
  foreach ($_POST as $key => $value) {
1733
  $_SESSION[fields][$key] = $value;
1734
  $field = parent::selectField('', $key);
1735
- if (!array_key_exists($key, $GLOBALS[ccf_fixed_fields]) or $key == 'fixedEmail') {
1736
  $mail_field_label = (empty($field->field_label)) ? $field->field_slug : $field->field_label;
1737
  $body .= $mail_field_label . ': ' . $value . "\n";
1738
- $data_array[$key] = $value;
1739
  } if (in_array($key, $checks)) {
1740
  $checks_key = array_search($key, $checks);
1741
  unset($checks[$checks_key]);
1742
  }
1743
  } foreach ($checks as $check_key) {
1744
  $field = parent::selectField('', $check_key);
1745
- $data_array[$check_key] = 'Not Checked';
1746
- $body .= ucwords(str_replace('_', ' ', $field->field_label)) . ': Not Checked' . "\n";
1747
  }
1748
  $errors = $this->getAllFormErrors();
1749
  if (empty($errors)) {
1750
  require_once('custom-contact-forms-mailer.php');
1751
- require_once('custom-contact-forms-user-data.php');
1752
  unset($_SESSION['captcha_' . $_POST[fid]]);
1753
  unset($_SESSION[fields]);
1754
- $data_object = new CustomContactFormsUserData(array('data_array' => $data_array, 'form_page' => $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'], 'form_id' => $form->id, 'data_time' => time()));
1755
- parent::insertUserData($data_object);
1756
  $body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
1757
  $to_email = (!empty($form->form_email)) ? $form->form_email : $admin_options[default_to_email];
1758
- if ($admin_options[email_form_submission] == 1) {
1759
- $mailer = new CustomContactFormsMailer($to_email, $admin_options[default_from_email], $admin_options[default_form_subject], stripslashes($body), $admin_options[wp_mail_function], $reply);
1760
- $mailer->send();
1761
- } if (!empty($form->form_thank_you_page)) {
1762
- CustomContactFormsStatic::redirect($form->form_thank_you_page);
1763
  }
1764
  $this->current_form = $form->id;
1765
  add_action('wp_footer', array(&$this, 'insertFormSuccessCode'), 1);
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
  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() {
47
  $admin_options = $this->getAdminOptions();
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
  if (!is_admin()) {
70
  $this->startSession();
71
  $this->processForms();
 
 
 
 
 
 
 
 
 
 
 
 
72
  }
73
  }
74
 
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() {
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
  <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
  <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
  <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
  </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
  $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];
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>';
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>
322
  <div class="inside">
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
  <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; ?>" />
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
  <?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
  <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
  <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
  (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
  <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>
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" />
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
  <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
  (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
  (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
  </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
  (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
  (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
  <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]" />
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
  <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>
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
  <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
  &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>
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
  $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
  $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
  $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
  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
  $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
  }
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
  $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);
download.php DELETED
@@ -1,19 +0,0 @@
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 DELETED
File without changes
images/wpspin_light.gif DELETED
Binary file
import/index.htm DELETED
File without changes
js/custom-contact-forms-admin-inc.js DELETED
@@ -1,48 +0,0 @@
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() {
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('Saving <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,5 +1,9 @@
 
 
 
 
 
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,18 +16,6 @@ $j(document).ready(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,122 +45,4 @@ $j(document).ready(function(){
53
  $j("#ccf-usage-popover .close").click(function() {
54
  $j("#ccf-usage-popover").fadeOut();
55
  });
56
-
57
- $j(".delete-button").each(function(){
58
- var name = $j(this).attr('name');
59
- var value = $j(this).attr('value');
60
- var html = '<input class="delete-button" type="button" name="'+name+'" value="'+value+'" />';
61
- $j(this).after(html).remove(); // add new, then remove original input
62
- });
63
- $j(".delete-button").live("click", function(event) {
64
- var object_id = $j(this).parents().find(".object-id").attr("value");
65
- var object_type = $j(this).parents().find(".object-type").attr("value");
66
- var parent_row = $j(this).parents("tr:eq(0)");
67
- var modal = fx.initModal();
68
- $j("<a>")
69
- .attr("href", "#")
70
- .addClass("modal-close-btn")
71
- .html("&times")
72
- .click(function(event) { fx.boxOut(event); })
73
- .appendTo(modal);
74
- $j("<p>")
75
- .html("Are you sure you want to delete this " + object_type.replace("_", " ") + "?")
76
- .appendTo(modal);
77
- $j("<input>").attr({
78
- type: "button",
79
- value: "Click to Confirm"
80
- }).addClass("delete-button-confirm").appendTo(modal);
81
- $j(".delete-button-confirm").click(function() {
82
- $j.ajax({
83
- type: "POST",
84
- url: ccf_file,
85
- data: "ajax_action=delete&object_id=" + object_id + "&object_type=" + object_type,
86
- success: function(data) {
87
- if (object_type == "form" || object_type == "field" || object_type == "form_submission")
88
- parent_row.next().remove();
89
- parent_row.remove();
90
- modal.remove();
91
- },
92
- error: function() {
93
- modal.append("An error has occured, please try again later.");
94
- }
95
- });
96
- });
97
- });
98
- $j(".edit-button").each(function(){
99
- var name = $j(this).attr('name');
100
- var value = $j(this).attr('value');
101
- var html = '<input class="edit-button" type="button" name="'+name+'" value="'+value+'" />';
102
- $j(this).after(html).remove(); // add new, then remove original input
103
- });
104
- $j(".edit-button").live("click", function(event) {
105
- save_box = fx.initSaveBox();
106
- //salert("sdf");
107
- var object_id = $j(this).parents().find(".object-id").attr("value");
108
- var object_type = $j(this).parents().find(".object-type").attr("value");
109
- var values = "object_id=" + object_id + "&object_type=" + object_type + "&ajax_action=edit";
110
- var object_rows = $j(this).parents("tr:eq(0)");
111
- if (object_type == "form" || object_type == "field")
112
- object_rows = object_rows.add(object_rows.next());
113
- object_rows.find("input, select, textarea").each(function() {
114
- if ($j(this).attr("name").match(/\[/) && $j(this).attr("type") != "submit" && $j(this).attr("type") != "button") {
115
- key = $j(this).attr("name");;
116
- values = values + "&" + key + "=" + $j(this).attr("value");
117
- }
118
- });
119
- $j.ajax({
120
- type: "POST",
121
- url: ccf_file,
122
- data: values,
123
- success: function(data) {
124
- //debug = fx.initDebugWindow();
125
- //$j("<div>").html(data).appendTo(debug);
126
- $j(".save-box").fadeOut().remove();
127
- },
128
- error: function() {
129
- modal.append("An error has occured, please try again later.");
130
- }
131
- });
132
- });
133
- /*
134
- $j(".create-button").each(function(){
135
- var name = $j(this).attr('name');
136
- var value = $j(this).attr('value');
137
- var html = '<input class="create-button" type="button" name="'+name+'" value="'+value+'" />';
138
- $j(this).after(html).remove(); // add new, then remove original input
139
- });
140
- $j(".create-button").live("click", function(event) {
141
- var icon = fx.getLoadingIcon().insertBefore(this);
142
- var object_type = $j(this).parents().find("input[name=object_type]").attr("value");
143
- if (object_type == "field_option") {
144
- var values = "ajax_action=create_field_option";
145
- var value_array = [];
146
- var new_row = $j('#edit-field-options tr:first').clone(true).addClass("new-object").hide().insertBefore('#edit-field-options tr:first');
147
- $j(this).parents("form:eq(0)").find("input").each(function() {
148
- if ($j(this).attr("name").match(/^option\[/)) {
149
- values = values + "&" + $j(this).attr("name") + "=" + $j(this).attr("value");
150
- key = $j(this).attr("name").replace(/^option\[(.*)\]$/, "$1");
151
- value_array[key] = $j(this).attr("value");
152
- $j(".new-object input[name=\"option[" + key + "]\"]").attr("value", value_array[key]);
153
- }
154
- });
155
- // Try to get first row of field options table to use its html as a framework for new row
156
- }
157
- //new_row = $j("#edit-field-options tr:first").html().appendTo("body").hide();
158
-
159
- // Create generic class of objects/functions to add delete/edit/insert capabilities on certain tables
160
- $j.ajax({
161
- type: "POST",
162
- url: ccf_file,
163
- data: values,
164
- success: function(data) {
165
-
166
- },
167
- error: function() {
168
- alert("An error has occured, please try again later.");
169
- }
170
- });
171
- new_row.fadeIn("slow").removeClass("new-object");
172
- $j(".ccf-loading-icon").remove();
173
- });*/
174
  });
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
  .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
  $j("#ccf-usage-popover .close").click(function() {
46
  $j("#ccf-usage-popover").fadeOut();
47
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  });
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: 4.0.0.b2
8
 
9
  Gauranteed to be the most customizable and intuitive contact form plugin for Wordpress.
10
 
@@ -14,15 +14,12 @@ Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact
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,7 +42,6 @@ Custom Contact Forms 4.0 will revolutionize the idea of a Wordpress plugin.
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,12 +76,20 @@ Visit http://www.taylorlovett.com/wordpress-plugins for screenshots. Right now a
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
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
 
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
  * 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
 
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