Contact Form by WD – responsive drag & drop contact form builder tool - Version 1.5.8

Version Description

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Contact Form by WD – responsive drag & drop contact form builder tool
Version 1.5.8
Comparing to
See all releases

Code changes from version 1.5.7 to 1.5.8

contact_form.php CHANGED
@@ -2,10 +2,18 @@
2
  /*
3
  Plugin Name: Contact Form FREE
4
  Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
- Version: 1.5.7
 
6
  Author: http://web-dorado.com/
7
  License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
8
  */
 
 
 
 
 
 
 
9
  //// load languages
10
  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// css
11
  $first_css = ".wdform_table1
@@ -207,12 +215,6 @@ function contact_form_language_load() {
207
  load_plugin_textdomain('form_maker', FALSE, basename(dirname(__FILE__)) . '/languages');
208
  }
209
 
210
- function contact_form_sesseion_path() {
211
- @session_start();
212
- session_save_path(ABSPATH . 'wp-content/plugins/contact-form-maker');
213
- }
214
- add_action('init', 'contact_form_sesseion_path');
215
-
216
  function spider_contact_form_output_buffer() {
217
  ob_start();
218
  }
@@ -242,7 +244,7 @@ function Contact_Form_maker_fornt_end_main($content) {
242
  function contact_form_scripts_method() {
243
  if (!get_option('form_maker_pro_active', FALSE)) {
244
  wp_enqueue_style("gmap_styles_", plugins_url("css/style_for_map.css", __FILE__), FALSE);
245
- wp_enqueue_script("main_g_js", plugins_url("js/main_front_end.js", __FILE__), FALSE);
246
  wp_enqueue_script("Gmap", "http://maps.google.com/maps/api/js?sensor=false", FALSE);
247
  wp_enqueue_script("if_gmap", plugins_url("js/if_gmap_front_end.js", __FILE__), FALSE);
248
  wp_enqueue_script("Calendar", plugins_url("js/calendar.js", __FILE__), FALSE);
@@ -267,7 +269,7 @@ function print_massage_contact_form($content) {
267
  if (is_plugin_active('wordpress-seo/wp-seo.php') && $_SESSION['form_submit_type']) {
268
  global $check_seo;
269
  if ($check_seo++ != 1) {
270
- return;
271
  }
272
  }
273
  if (!get_option('form_maker_pro_active', FALSE)) {
@@ -568,7 +570,7 @@ function Manage_contact_form() {
568
  save_form();
569
  $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
570
  }
571
- form_options($id);
572
  break;
573
  case "Save_form_options" :
574
  Apply_form_options($id);
@@ -576,7 +578,7 @@ function Manage_contact_form() {
576
  break;
577
  case "Apply_form_options" :
578
  Apply_form_options($id);
579
- form_options($id);
580
  break;
581
  case "save_as_copy":
582
  save_as_copy();
2
  /*
3
  Plugin Name: Contact Form FREE
4
  Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
+ Description: WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
+ Version: 1.5.8
7
  Author: http://web-dorado.com/
8
  License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
9
  */
10
+
11
+ function contact_form_sesseion_path() {
12
+ @session_start();
13
+ session_save_path(ABSPATH . 'wp-content/plugins/contact-form-maker/session');
14
+ }
15
+ add_action('init', 'contact_form_sesseion_path');
16
+
17
  //// load languages
18
  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// css
19
  $first_css = ".wdform_table1
215
  load_plugin_textdomain('form_maker', FALSE, basename(dirname(__FILE__)) . '/languages');
216
  }
217
 
 
 
 
 
 
 
218
  function spider_contact_form_output_buffer() {
219
  ob_start();
220
  }
244
  function contact_form_scripts_method() {
245
  if (!get_option('form_maker_pro_active', FALSE)) {
246
  wp_enqueue_style("gmap_styles_", plugins_url("css/style_for_map.css", __FILE__), FALSE);
247
+ wp_enqueue_script("contact_main_g_js", plugins_url("js/main_front_end.js", __FILE__), FALSE);
248
  wp_enqueue_script("Gmap", "http://maps.google.com/maps/api/js?sensor=false", FALSE);
249
  wp_enqueue_script("if_gmap", plugins_url("js/if_gmap_front_end.js", __FILE__), FALSE);
250
  wp_enqueue_script("Calendar", plugins_url("js/calendar.js", __FILE__), FALSE);
269
  if (is_plugin_active('wordpress-seo/wp-seo.php') && $_SESSION['form_submit_type']) {
270
  global $check_seo;
271
  if ($check_seo++ != 1) {
272
+ // return;
273
  }
274
  }
275
  if (!get_option('form_maker_pro_active', FALSE)) {
570
  save_form();
571
  $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
572
  }
573
+ wd_form_options($id);
574
  break;
575
  case "Save_form_options" :
576
  Apply_form_options($id);
578
  break;
579
  case "Apply_form_options" :
580
  Apply_form_options($id);
581
+ wd_form_options($id);
582
  break;
583
  case "save_as_copy":
584
  save_as_copy();
contact_form_functions.html.php CHANGED
@@ -804,7 +804,10 @@ jQuery(document).ready(function ($) {
804
  <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"><img src="<?php echo plugins_url("images/paypal.png",__FILE__); ?>" style="margin:5px" id="img_paypal"/></td>
805
  </tr>
806
  <tr>
807
- <td align="center" onClick="addRow('button')" colspan=2 id="table_button" class="field_buttons"><img
 
 
 
808
  src="<?php echo plugins_url("images/button.png", __FILE__); ?>" style="margin:5px" id="img_button"/>
809
  </td>
810
  </tr>
@@ -1641,7 +1644,10 @@ jQuery(document).ready(function ($) {
1641
  </td>
1642
  </tr>
1643
  <tr>
1644
- <td align="center" onClick="addRow('button')" colspan=2 style="cursor:pointer" id="table_button"
 
 
 
1645
  class="field_buttons"><img src="<?php echo plugins_url("images/button.png", __FILE__) ?>"
1646
  style="margin:5px" id="img_button"/></td>
1647
  </tr>
804
  <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"><img src="<?php echo plugins_url("images/paypal.png",__FILE__); ?>" style="margin:5px" id="img_paypal"/></td>
805
  </tr>
806
  <tr>
807
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor:pointer; background-color: rgb(114, 113, 113) !important;" class="field_buttons" id="table_survey">
808
+ <img src="<?php echo plugins_url("images/survey.png", __FILE__); ?>" style="margin:5px" id="img_survey"/>
809
+ </td>
810
+ <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons"><img
811
  src="<?php echo plugins_url("images/button.png", __FILE__); ?>" style="margin:5px" id="img_button"/>
812
  </td>
813
  </tr>
1644
  </td>
1645
  </tr>
1646
  <tr>
1647
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor:pointer; background-color: rgb(114, 113, 113) !important;" class="field_buttons" id="table_survey">
1648
+ <img src="<?php echo plugins_url("images/survey.png", __FILE__); ?>" style="margin:5px" id="img_survey"/>
1649
+ </td>
1650
+ <td align="center" onClick="addRow('button')" style="cursor:pointer" id="table_button"
1651
  class="field_buttons"><img src="<?php echo plugins_url("images/button.png", __FILE__) ?>"
1652
  style="margin:5px" id="img_button"/></td>
1653
  </tr>
contact_form_functions.php CHANGED
@@ -461,7 +461,7 @@ function gotoedit() {
461
  }
462
 
463
  // Form options.
464
- function form_options($id) {
465
  global $wpdb;
466
  $row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "'");
467
  $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY title";
@@ -482,7 +482,7 @@ function Apply_form_options($id) {
482
  'mail' => $_POST["mail"],
483
  'theme' => $_POST["theme"],
484
  'javascript' => stripslashes($_POST["javascript"]),
485
- 'submit_text' => $_POST["content"],
486
  'url' => $_POST["url"],
487
  'submit_text_type' => $_POST["submit_text_type"],
488
  'script_mail' => stripslashes($_POST["script_mail"]),
461
  }
462
 
463
  // Form options.
464
+ function wd_form_options($id) {
465
  global $wpdb;
466
  $row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "'");
467
  $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY title";
482
  'mail' => $_POST["mail"],
483
  'theme' => $_POST["theme"],
484
  'javascript' => stripslashes($_POST["javascript"]),
485
+ 'submit_text' => stripslashes($_POST["content"]),
486
  'url' => $_POST["url"],
487
  'submit_text_type' => $_POST["submit_text_type"],
488
  'script_mail' => stripslashes($_POST["script_mail"]),
front_end_contact_form.php CHANGED
@@ -707,7 +707,7 @@ function contact_form_gen_mail($counter, $all_files, $id, $str) {
707
  $new_script = str_replace("%all%", $list, $new_script);
708
  }
709
  $body = $new_script;
710
- $send = wp_mail($recipient, $subject, stripslashes($body), $headers, $attachment);
711
  }
712
  if ($row->mail) {
713
  if ($c) {
@@ -873,7 +873,7 @@ function contact_form_gen_mail($counter, $all_files, $id, $str) {
873
  }
874
  $body = $new_script;
875
  $mode = 1;
876
- $send = wp_mail($recipient, $subject, stripslashes($body), $headers, $attachment);
877
  $row_mail_one_time = 0;
878
  }
879
  }
@@ -1037,7 +1037,7 @@ function contact_form_gen_mail($counter, $all_files, $id, $str) {
1037
  $new_script = str_replace("%all%", $list, $new_script);
1038
  }
1039
  $body = $new_script;
1040
- $send = wp_mail($recipient, $subject, stripslashes($body), $headers, $attachment);
1041
  }
1042
  }
1043
  if ($row->mail) {
@@ -1347,7 +1347,7 @@ formLoadBody' . $id . '();';
1347
  $recaptcha_response_field = esc_html($_POST["recaptcha_response_field"]);
1348
  }
1349
  if (isset($_POST["counter" . $id])) {
1350
- $counter = esc_html($_POST["counter" . $id]);
1351
  }
1352
  $old_key = -1;
1353
  if (isset($counter)) {
@@ -1554,12 +1554,12 @@ formLoadBody' . $id . '();';
1554
  }
1555
  case "type_date_fields":
1556
  {
1557
- $date_fields = explode('-', $_POST[$label_id[$key] . "_element" . $id]);
1558
  $form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_day" . $id . "'))
1559
  {
1560
- document.getElementById('" . $label_id[$key] . "_day" . $id . "').value='" . $date_fields[0] . "';
1561
- document.getElementById('" . $label_id[$key] . "_month" . $id . "').value='" . $date_fields[1] . "';
1562
- document.getElementById('" . $label_id[$key] . "_year" . $id . "').value='" . $date_fields[2] . "';
1563
  }";
1564
  break;
1565
  }
707
  $new_script = str_replace("%all%", $list, $new_script);
708
  }
709
  $body = $new_script;
710
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
711
  }
712
  if ($row->mail) {
713
  if ($c) {
873
  }
874
  $body = $new_script;
875
  $mode = 1;
876
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
877
  $row_mail_one_time = 0;
878
  }
879
  }
1037
  $new_script = str_replace("%all%", $list, $new_script);
1038
  }
1039
  $body = $new_script;
1040
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
1041
  }
1042
  }
1043
  if ($row->mail) {
1347
  $recaptcha_response_field = esc_html($_POST["recaptcha_response_field"]);
1348
  }
1349
  if (isset($_POST["counter" . $id])) {
1350
+ $counter = $_POST["counter" . $id];
1351
  }
1352
  $old_key = -1;
1353
  if (isset($counter)) {
1554
  }
1555
  case "type_date_fields":
1556
  {
1557
+ // $date_fields = explode('-', $_POST[$label_id[$key] . "_element" . $id]);
1558
  $form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_day" . $id . "'))
1559
  {
1560
+ document.getElementById('" . $label_id[$key] . "_day" . $id . "').value='" . $_POST[$label_id[$key] . "_day" . $id] . "';
1561
+ document.getElementById('" . $label_id[$key] . "_month" . $id . "').value='" . $_POST[$label_id[$key] . "_month" . $id] . "';
1562
+ document.getElementById('" . $label_id[$key] . "_year" . $id . "').value='" . $_POST[$label_id[$key] . "_year" . $id] . "';
1563
  }";
1564
  break;
1565
  }
images/survey.png ADDED
Binary file
js/formmaker_free.js CHANGED
@@ -14732,7 +14732,7 @@ function refresh_pages_without_deleting(id) {
14732
 
14733
  var img_DUBLICATE = document.createElement("img");
14734
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
14735
- img_DUBLICATE.setAttribute("title", "Dublicate the field");
14736
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
14737
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
14738
 
@@ -14969,7 +14969,7 @@ function add(key) {
14969
 
14970
  var img_DUBLICATE = document.createElement("img");
14971
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
14972
- img_DUBLICATE.setAttribute("title", "Dublicate the field");
14973
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
14974
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
14975
 
@@ -15106,7 +15106,7 @@ function add(key) {
15106
 
15107
  var img_DUBLICATE = document.createElement("img");
15108
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
15109
- img_DUBLICATE.setAttribute("title", "Dublicate the field");
15110
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
15111
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
15112
 
@@ -15552,7 +15552,7 @@ function add(key) {
15552
 
15553
  var img_DUBLICATE = document.createElement("img");
15554
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
15555
- img_DUBLICATE.setAttribute("title", "Dublicate the field");
15556
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
15557
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
15558
 
@@ -15726,7 +15726,7 @@ function add(key) {
15726
 
15727
  var img_DUBLICATE = document.createElement("img");
15728
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
15729
- img_DUBLICATE.setAttribute("title", "Dublicate the field");
15730
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
15731
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
15732
 
@@ -15954,7 +15954,7 @@ function add(key) {
15954
 
15955
  var img_DUBLICATE = document.createElement("img");
15956
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
15957
- img_DUBLICATE.setAttribute("title", "Dublicate the field");
15958
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
15959
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
15960
 
@@ -16182,7 +16182,7 @@ function add(key) {
16182
 
16183
  var img_DUBLICATE = document.createElement("img");
16184
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
16185
- img_DUBLICATE.setAttribute("title", "Dublicate the field");
16186
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
16187
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
16188
 
14732
 
14733
  var img_DUBLICATE = document.createElement("img");
14734
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
14735
+ img_DUBLICATE.setAttribute("title", "Duplicate the field");
14736
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
14737
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
14738
 
14969
 
14970
  var img_DUBLICATE = document.createElement("img");
14971
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
14972
+ img_DUBLICATE.setAttribute("title", "Duplicate the field");
14973
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
14974
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
14975
 
15106
 
15107
  var img_DUBLICATE = document.createElement("img");
15108
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
15109
+ img_DUBLICATE.setAttribute("title", "Duplicate the field");
15110
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
15111
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
15112
 
15552
 
15553
  var img_DUBLICATE = document.createElement("img");
15554
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
15555
+ img_DUBLICATE.setAttribute("title", "Duplicate the field");
15556
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
15557
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
15558
 
15726
 
15727
  var img_DUBLICATE = document.createElement("img");
15728
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
15729
+ img_DUBLICATE.setAttribute("title", "Duplicate the field");
15730
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
15731
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
15732
 
15954
 
15955
  var img_DUBLICATE = document.createElement("img");
15956
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
15957
+ img_DUBLICATE.setAttribute("title", "Duplicate the field");
15958
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
15959
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
15960
 
16182
 
16183
  var img_DUBLICATE = document.createElement("img");
16184
  img_DUBLICATE.setAttribute("src", plugin_url + "/images/dublicate.png");
16185
+ img_DUBLICATE.setAttribute("title", "Duplicate the field");
16186
  img_DUBLICATE.style.cssText = "margin:2px;cursor:pointer";
16187
  img_DUBLICATE.setAttribute("onclick", 'dublicate("' + i + '")');
16188
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://web-dorado.com/products/wordpress-contact-form-maker-plugin.
4
  Tags: form, forms, contact form, contact forms, contact form plugin,contact forms plugin, forms plugin, Contact Form Builder, contact form manager, multiple contac forms, custom form,Contact Form Maker with recaptcha, contact form with google map, feedback form, feedback forms,contact us
5
  Requires at least: 3.0
6
  Tested up to: 3.6
7
- Stable tag: 1.5.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Tags: form, forms, contact form, contact forms, contact form plugin,contact forms plugin, forms plugin, Contact Form Builder, contact form manager, multiple contac forms, custom form,Contact Form Maker with recaptcha, contact form with google map, feedback form, feedback forms,contact us
5
  Requires at least: 3.0
6
  Tested up to: 3.6
7
+ Stable tag: 1.5.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
session/index.html ADDED
@@ -0,0 +1 @@
 
1
+ <html><body bgcolor="#FFFFFF"></body></html>
update_sql.php CHANGED
@@ -1,140 +1,140 @@
1
- <?php
2
-
3
- function contact_form_check_update() {
4
- global $wpdb;
5
- if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker_sessions'") != $wpdb->prefix . "formmaker_sessions") {
6
- if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker'") == $wpdb->prefix . "formmaker") {
7
- $form_properties = $wpdb->get_results("DESCRIBE " . $wpdb->prefix . "formmaker", ARRAY_A);
8
- foreach ($form_properties as $prop) {
9
- $exists_paypal_mode = (($prop['Field'] == 'paypal_mode') ? 1 : 0);
10
- $exists_checkout_mode = (($prop['Field'] == 'checkout_mode') ? 1 : 0);
11
- $exists_paypal_email = (($prop['Field'] == 'paypal_email') ? 1 : 0);
12
- $exists_payment_currency = (($prop['Field'] == 'payment_currency') ? 1 : 0);
13
- $exists_tax = (($prop['Field'] == 'tax') ? 1 : 0);
14
- $exists_script_mail = (($prop['Field'] == 'script_mail') ? 1 : 0);
15
- $exists_script_mail_user = (($prop['Field'] == 'script_mail_user') ? 1 : 0);
16
- $exists_label_order_current = (($prop['Field'] == 'label_order_current') ? 1 : 0);
17
- }
18
- if (!$exists_paypal_mode) {
19
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `paypal_mode` int(11) NOT NULL AFTER `recaptcha_theme`");
20
- }
21
- if (!$exists_checkout_mode) {
22
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `checkout_mode` varchar(20) NOT NULL AFTER `recaptcha_theme`");
23
- }
24
- if (!$exists_paypal_email) {
25
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `paypal_email` varchar(128) NOT NULL AFTER `recaptcha_theme`");
26
- }
27
- if (!$exists_payment_currency) {
28
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `payment_currency` varchar(20) NOT NULL AFTER `recaptcha_theme`");
29
- }
30
- if (!$exists_tax) {
31
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `tax` int(11) NOT NULL AFTER `recaptcha_theme`");
32
- }
33
- if (!$exists_script_mail) {
34
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `script_mail` text NOT NULL AFTER `recaptcha_theme`");
35
- }
36
- if (!$exists_script_mail_user) {
37
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `script_mail_user` text NOT NULL AFTER `recaptcha_theme`");
38
- }
39
- if (!$exists_label_order_current) {
40
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `label_order_current` text NOT NULL AFTER `recaptcha_theme`");
41
- }
42
- }
43
- $form_maker_sessions_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "formmaker_sessions` (
44
- `id` int(11) NOT NULL AUTO_INCREMENT,
45
- `form_id` int(11) NOT NULL,
46
- `group_id` int(11) NOT NULL,
47
- `ip` varchar(20) NOT NULL,
48
- `ord_date` varchar(20) NOT NULL,
49
- `ord_last_modified` varchar(20) NOT NULL,
50
- `status` varchar(50) NOT NULL,
51
- `full_name` varchar(256) NOT NULL,
52
- `email` varchar(256) NOT NULL,
53
- `phone` varchar(50) NOT NULL,
54
- `mobile_phone` varchar(255) NOT NULL,
55
- `fax` varchar(255) NOT NULL,
56
- `address` varchar(300) NOT NULL,
57
- `paypal_info` text NOT NULL,
58
- `without_paypal_info` text NOT NULL,
59
- `ipn` varchar(20) NOT NULL,
60
- `checkout_method` varchar(20) NOT NULL,
61
- `tax` varchar(50) NOT NULL,
62
- `shipping` varchar(50) NOT NULL,
63
- `shipping_type` varchar(200) NOT NULL,
64
- `read` int(11) NOT NULL,
65
- `total` varchar(200) NOT NULL,
66
- `currency` varchar(24) NOT NULL,
67
- PRIMARY KEY (`id`)
68
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=17";
69
- $wpdb->query($form_maker_sessions_table);
70
- $form_rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker");
71
- foreach ($form_rows as $form_row) {
72
- $wpdb->update($wpdb->prefix . "formmaker", array(
73
- 'paypal_mode' => 0,
74
- 'checkout_mode' => 'testmode',
75
- 'paypal_email' => '',
76
- 'payment_currency' => '',
77
- 'tax' => 0,
78
- 'script_mail' => $form_row->script1 . '%all%' . $form_row->script2,
79
- 'script_mail_user' => $form_row->script_user1 . '%all%' . $form_row->script_user2,
80
- 'label_order_current' => $form_row->label_order,
81
- ), array(
82
- 'id' => $form_row->id,
83
- ), array(
84
- '%d',
85
- '%s',
86
- '%s',
87
- '%s',
88
- '%d',
89
- '%s',
90
- '%s',
91
- '%s',
92
- ), array(
93
- '%d',
94
- ));
95
- }
96
- if (!get_site_option('contact_formmaker_cureent_version')) {
97
- // if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker_themes'") == $wpdb->prefix . "formmaker_themes")
98
- add_option('contact_formmaker_cureent_version', '2.4.4');
99
- }
100
- else {
101
- // if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker_themes'") == $wpdb->prefix . "formmaker_themes")
102
- update_option('contact_formmaker_cureent_version', '2.4.4');
103
- }
104
- }
105
- $form_properties = $wpdb->get_results("DESCRIBE " . $wpdb->prefix . "formmaker", ARRAY_A);
106
- foreach ($form_properties as $prop) {
107
- $exist_from_mail = (($prop['Field'] == 'from_mail') ? 1 : 0);
108
- $exist_from_name = (($prop['Field'] == 'from_name') ? 1 : 0);
109
- }
110
- if (!$exist_from_mail) {
111
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `from_mail` varchar(255) NOT NULL AFTER `recaptcha_theme`");
112
- }
113
- if (!$exist_from_name) {
114
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `from_name` varchar(255) NOT NULL AFTER `recaptcha_theme`");
115
- }
116
- $form_rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker");
117
- foreach ($form_rows as $form_row) {
118
- $wpdb->update($wpdb->prefix . "formmaker", array(
119
- 'paypal_mode' => (($form_row->paypal_mode == '') ? 0 : $form_row->paypal_mode),
120
- 'checkout_mode' => (($form_row->checkout_mode == '') ? 'testmode' : $form_row->checkout_mode),
121
- 'tax' => (($form_row->tax == '') ? 0 : $form_row->tax),
122
- 'script_mail' => (($form_row->script_mail == '') ? $form_row->script1 . '%all%' . $form_row->script2 : $form_row->script_mail),
123
- 'script_mail_user' => (($form_row->script_mail_user == '') ? $form_row->script_user1 . '%all%' . $form_row->script_user2 : $form_row->script_mail_user),
124
- 'label_order_current' => $form_row->label_order,
125
- ), array(
126
- 'id' => $form_row->id,
127
- ), array(
128
- '%d',
129
- '%s',
130
- '%d',
131
- '%s',
132
- '%s',
133
- '%s',
134
- ), array(
135
- '%d',
136
- ));
137
- }
138
- }
139
-
140
  ?>
1
+ <?php
2
+
3
+ function contact_form_check_update() {
4
+ global $wpdb;
5
+ if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker_sessions'") != $wpdb->prefix . "formmaker_sessions") {
6
+ if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker'") == $wpdb->prefix . "formmaker") {
7
+ $form_properties = $wpdb->get_results("DESCRIBE " . $wpdb->prefix . "formmaker", ARRAY_A);
8
+ foreach ($form_properties as $prop) {
9
+ $exists_paypal_mode = (($prop['Field'] == 'paypal_mode') ? 1 : 0);
10
+ $exists_checkout_mode = (($prop['Field'] == 'checkout_mode') ? 1 : 0);
11
+ $exists_paypal_email = (($prop['Field'] == 'paypal_email') ? 1 : 0);
12
+ $exists_payment_currency = (($prop['Field'] == 'payment_currency') ? 1 : 0);
13
+ $exists_tax = (($prop['Field'] == 'tax') ? 1 : 0);
14
+ $exists_script_mail = (($prop['Field'] == 'script_mail') ? 1 : 0);
15
+ $exists_script_mail_user = (($prop['Field'] == 'script_mail_user') ? 1 : 0);
16
+ $exists_label_order_current = (($prop['Field'] == 'label_order_current') ? 1 : 0);
17
+ }
18
+ if (!$exists_paypal_mode) {
19
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `paypal_mode` int(11) NOT NULL AFTER `recaptcha_theme`");
20
+ }
21
+ if (!$exists_checkout_mode) {
22
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `checkout_mode` varchar(20) NOT NULL AFTER `recaptcha_theme`");
23
+ }
24
+ if (!$exists_paypal_email) {
25
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `paypal_email` varchar(128) NOT NULL AFTER `recaptcha_theme`");
26
+ }
27
+ if (!$exists_payment_currency) {
28
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `payment_currency` varchar(20) NOT NULL AFTER `recaptcha_theme`");
29
+ }
30
+ if (!$exists_tax) {
31
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `tax` int(11) NOT NULL AFTER `recaptcha_theme`");
32
+ }
33
+ if (!$exists_script_mail) {
34
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `script_mail` text NOT NULL AFTER `recaptcha_theme`");
35
+ }
36
+ if (!$exists_script_mail_user) {
37
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `script_mail_user` text NOT NULL AFTER `recaptcha_theme`");
38
+ }
39
+ if (!$exists_label_order_current) {
40
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `label_order_current` text NOT NULL AFTER `recaptcha_theme`");
41
+ }
42
+ }
43
+ $form_maker_sessions_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "formmaker_sessions` (
44
+ `id` int(11) NOT NULL AUTO_INCREMENT,
45
+ `form_id` int(11) NOT NULL,
46
+ `group_id` int(11) NOT NULL,
47
+ `ip` varchar(20) NOT NULL,
48
+ `ord_date` varchar(20) NOT NULL,
49
+ `ord_last_modified` varchar(20) NOT NULL,
50
+ `status` varchar(50) NOT NULL,
51
+ `full_name` varchar(256) NOT NULL,
52
+ `email` varchar(256) NOT NULL,
53
+ `phone` varchar(50) NOT NULL,
54
+ `mobile_phone` varchar(255) NOT NULL,
55
+ `fax` varchar(255) NOT NULL,
56
+ `address` varchar(300) NOT NULL,
57
+ `paypal_info` text NOT NULL,
58
+ `without_paypal_info` text NOT NULL,
59
+ `ipn` varchar(20) NOT NULL,
60
+ `checkout_method` varchar(20) NOT NULL,
61
+ `tax` varchar(50) NOT NULL,
62
+ `shipping` varchar(50) NOT NULL,
63
+ `shipping_type` varchar(200) NOT NULL,
64
+ `read` int(11) NOT NULL,
65
+ `total` varchar(200) NOT NULL,
66
+ `currency` varchar(24) NOT NULL,
67
+ PRIMARY KEY (`id`)
68
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=17";
69
+ $wpdb->query($form_maker_sessions_table);
70
+ $form_rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker");
71
+ foreach ($form_rows as $form_row) {
72
+ $wpdb->update($wpdb->prefix . "formmaker", array(
73
+ 'paypal_mode' => 0,
74
+ 'checkout_mode' => 'testmode',
75
+ 'paypal_email' => '',
76
+ 'payment_currency' => '',
77
+ 'tax' => 0,
78
+ 'script_mail' => $form_row->script1 . '%all%' . $form_row->script2,
79
+ 'script_mail_user' => $form_row->script_user1 . '%all%' . $form_row->script_user2,
80
+ 'label_order_current' => $form_row->label_order,
81
+ ), array(
82
+ 'id' => $form_row->id,
83
+ ), array(
84
+ '%d',
85
+ '%s',
86
+ '%s',
87
+ '%s',
88
+ '%d',
89
+ '%s',
90
+ '%s',
91
+ '%s',
92
+ ), array(
93
+ '%d',
94
+ ));
95
+ }
96
+ if (!get_site_option('contact_formmaker_cureent_version')) {
97
+ // if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker_themes'") == $wpdb->prefix . "formmaker_themes")
98
+ add_option('contact_formmaker_cureent_version', '2.4.4');
99
+ }
100
+ else {
101
+ // if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker_themes'") == $wpdb->prefix . "formmaker_themes")
102
+ update_option('contact_formmaker_cureent_version', '2.4.4');
103
+ }
104
+ }
105
+ $form_properties = $wpdb->get_results("DESCRIBE " . $wpdb->prefix . "formmaker", ARRAY_A);
106
+ foreach ($form_properties as $prop) {
107
+ $exist_from_mail = (($prop['Field'] == 'from_mail') ? 1 : 0);
108
+ $exist_from_name = (($prop['Field'] == 'from_name') ? 1 : 0);
109
+ }
110
+ if (!$exist_from_mail) {
111
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `from_mail` varchar(255) NOT NULL AFTER `recaptcha_theme`");
112
+ }
113
+ if (!$exist_from_name) {
114
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "formmaker ADD `from_name` varchar(255) NOT NULL AFTER `recaptcha_theme`");
115
+ }
116
+ $form_rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker");
117
+ foreach ($form_rows as $form_row) {
118
+ $wpdb->update($wpdb->prefix . "formmaker", array(
119
+ 'paypal_mode' => (($form_row->paypal_mode == '') ? 0 : $form_row->paypal_mode),
120
+ 'checkout_mode' => (($form_row->checkout_mode == '') ? 'testmode' : $form_row->checkout_mode),
121
+ 'tax' => (($form_row->tax == '') ? 0 : $form_row->tax),
122
+ 'script_mail' => (($form_row->script_mail == '') ? $form_row->script1 . '%all%' . $form_row->script2 : $form_row->script_mail),
123
+ 'script_mail_user' => (($form_row->script_mail_user == '') ? $form_row->script_user1 . '%all%' . $form_row->script_user2 : $form_row->script_mail_user),
124
+ 'label_order_current' => $form_row->label_order,
125
+ ), array(
126
+ 'id' => $form_row->id,
127
+ ), array(
128
+ '%d',
129
+ '%s',
130
+ '%d',
131
+ '%s',
132
+ '%s',
133
+ '%s',
134
+ ), array(
135
+ '%d',
136
+ ));
137
+ }
138
+ }
139
+
140
  ?>