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

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.7
Comparing to
See all releases

Code changes from version 1.5.6 to 1.5.7

Submissions.php CHANGED
@@ -303,7 +303,7 @@ function save_submit($id) {
303
  if ($result) {
304
  //$query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
305
  $wpdb->update($wpdb->prefix . "formmaker_submits", array(
306
- 'element_value' => $element_value,
307
  ), array(
308
  'group_id' => $id,
309
  'element_label' => $label_id_1
@@ -318,7 +318,7 @@ function save_submit($id) {
318
  $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
319
  'form_id' => $form_id,
320
  'element_label' => $label_id_1,
321
- 'element_value' => $element_value,
322
  'group_id' => $id,
323
  'date' => $date,
324
  'ip' => $ip
@@ -347,7 +347,7 @@ function save_submit($id) {
347
  if ($result) {
348
  $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . $element_value . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
349
  $wpdb->update($wpdb->prefix . "formmaker_submits", array(
350
- 'element_value' => $element_value,
351
  ), array(
352
  'group_id' => $id,
353
  'element_label' => $label_id_1
@@ -363,7 +363,7 @@ function save_submit($id) {
363
  $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
364
  'form_id' => $form_id,
365
  'element_label' => $label_id_1,
366
- 'element_value' => $element_value,
367
  'group_id' => $id,
368
  'date' => $date,
369
  'ip' => $ip
303
  if ($result) {
304
  //$query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
305
  $wpdb->update($wpdb->prefix . "formmaker_submits", array(
306
+ 'element_value' => stripslashes($element_value),
307
  ), array(
308
  'group_id' => $id,
309
  'element_label' => $label_id_1
318
  $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
319
  'form_id' => $form_id,
320
  'element_label' => $label_id_1,
321
+ 'element_value' => stripslashes($element_value),
322
  'group_id' => $id,
323
  'date' => $date,
324
  'ip' => $ip
347
  if ($result) {
348
  $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . $element_value . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
349
  $wpdb->update($wpdb->prefix . "formmaker_submits", array(
350
+ 'element_value' => stripslashes($element_value),
351
  ), array(
352
  'group_id' => $id,
353
  'element_label' => $label_id_1
363
  $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
364
  'form_id' => $form_id,
365
  'element_label' => $label_id_1,
366
+ 'element_value' => stripslashes($element_value),
367
  'group_id' => $id,
368
  'date' => $date,
369
  'ip' => $ip
contact_form.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Contact Form FREE
4
  Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
- Version: 1.5.6
6
  Author: http://web-dorado.com/
7
  License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
8
  */
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
  */
front_end_contact_form.php CHANGED
@@ -321,7 +321,7 @@ function contact_form_save_db($counter, $id) {
321
  $save_or_no = $wpdb->insert($r, array(
322
  'form_id' => $id_old,
323
  'element_label' => $i,
324
- 'element_value' => addslashes($value),
325
  'group_id' => ($max + 1),
326
  'date' => date('Y-m-d H:i:s'),
327
  'ip' => $ip,
321
  $save_or_no = $wpdb->insert($r, array(
322
  'form_id' => $id_old,
323
  'element_label' => $i,
324
+ 'element_value' => stripslashes($value),
325
  'group_id' => ($max + 1),
326
  'date' => date('Y-m-d H:i:s'),
327
  'ip' => $ip,
js/main_front_end.js CHANGED
@@ -46,7 +46,7 @@ function set_sel_am_pm(select_)
46
 
47
  function check_isnum_point(e) {
48
  var chCode1 = e.which || e.keyCode;
49
- if (chCode1 == 46) {
50
  return true;
51
  }
52
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
@@ -819,7 +819,7 @@ function page_previous(id, form_id, form_view_count, form_view_max)
819
  table.removeChild(table.firstChild);
820
 
821
  generate_page_nav(table.firstChild.id.replace(form_id+'form_view', ""),form_id, form_view_count, form_view_max);
822
- window.scrollTo(0, 0);
823
  }
824
 
825
  function page_next(id, form_id, form_view_count, form_view_max)
@@ -836,7 +836,17 @@ function page_next(id, form_id, form_view_count, form_view_max)
836
  table.removeChild(table.firstChild);
837
 
838
  generate_page_nav(table.firstChild.id.replace(form_id+'form_view', ""), form_id, form_view_count, form_view_max);
839
- window.scrollTo(0, 0);
 
 
 
 
 
 
 
 
 
 
840
  }
841
 
842
  function randomSort(a,b) {
46
 
47
  function check_isnum_point(e) {
48
  var chCode1 = e.which || e.keyCode;
49
+ if (chCode1 == 46 || chCode1 == 45) {
50
  return true;
51
  }
52
  if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
819
  table.removeChild(table.firstChild);
820
 
821
  generate_page_nav(table.firstChild.id.replace(form_id+'form_view', ""),form_id, form_view_count, form_view_max);
822
+ window.scroll(0, form_maker_findPos(document.getElementById("form" + form_id)));
823
  }
824
 
825
  function page_next(id, form_id, form_view_count, form_view_max)
836
  table.removeChild(table.firstChild);
837
 
838
  generate_page_nav(table.firstChild.id.replace(form_id+'form_view', ""), form_id, form_view_count, form_view_max);
839
+ window.scroll(0, form_maker_findPos(document.getElementById("form" + form_id)));
840
+ }
841
+
842
+ function form_maker_findPos(obj) {
843
+ var curtop = 0;
844
+ if (obj.offsetParent) {
845
+ do {
846
+ curtop += obj.offsetTop;
847
+ } while (obj = obj.offsetParent);
848
+ return [curtop];
849
+ }
850
  }
851
 
852
  function randomSort(a,b) {
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.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -16,7 +16,7 @@ WordPress Contact Form Maker is an advanced and easy-to-use tool for creating f
16
  [User Manual](http://web-dorado.com/wordpress-form-maker-guide-1.html)
17
  [Frequently Asked Questions](http://web-dorado.com/forum/form-maker/316-form-maker-faq.html)
18
  [Support Forum](http://web-dorado.com/forum/26-form-maker.html)
19
- Contact Form Maker is a sophisticated and user-friendly contact form builder for making application forms. You can add an unlimited number of fields, including different types of text input fields (password, address, e-mail, phone, etc.), captcha, map (multiple locations are supported), and submission buttons. The back-end interface of the WordPress Contact Form Maker is intuitive and easy-to-use. As a result, the users who are not really familiar with scripting and programming can easily create complex application contact forms.
20
 
21
  A number of parameters of the WordPress Contact Form Maker are customizable (e.g. colors and fonts, element size).
22
 
@@ -260,28 +260,28 @@ Theme. A distinct theme can be applied to each new contact form. The themes can
260
  Text Area: This field of contact form can be used for typing some text. The difference between Text Area and Simple Text in Contact Forms is that Simple Text has only one row while Text Area can have several rows. It has several attributes: Field Id, Field Name, Field Label,Field Label Position, Field Size, Value If Empty, Class Name, Required, Allow only unique values, Additional Attributes
261
  Name: This field of contact form can be used for typing a name. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Value If Empty, Field Size, Name Format, Class Name, Required, Allow only unique values, Additional Attributes
262
  Address: This field of contact form can be used for adding an address. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Overall Size, Class Name, Required, Additional Attributes
263
- Address (Mark on Map): This filed of contact form can be used for adding an address by directly marking it on the map. It has several attributes: Field Label, ield Label Position, Default Location, Map Size, Marker Info, Class Name, Additional Attributes
264
  E-mail:This field of contact form can be used for typing the submitter�s e-mail. The submitted e-mail validation of the Contact form is checked. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Field Size, Value If Empty, Class Name, Send mail to submitter, Required, Allow only unique values, Additional Attributes.
265
- Number: This field of contact form can be used to provide numbers for different purposes (e.g. serial number). It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Field Size, Value If Empty, Class Name, Required, Allow only unique values, Additional Attributes
266
  Phone: This field of contact form can be used to provide a phone number. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Value If Empty, Field Size, Class Name, Required, Allow only unique values, Additional Attributes
267
- Hidden Field: This field of contact form can be used to store additional information that does not need to be displayed. It has several attributes : Field ld, Field Name, Field Value, Additional Attributes.
268
 
269
  3.3 Time and Date: Choose the Field Type of contact form according to your preference. There are several options:
270
- Date (single field with a picker): This field of contact form can be used for typing a date or choosing by the picker. It has several attributes: Field Id, Field Name, Field Label, ield Label Position, Date format, Date Picker Label, Class Name, Required, Additional Attributes.
271
- Date (3 separate fields): This field of contact form can be used for typing a date in 3 field format(day, month, year). Each of the 3 fields can be set as text input or select list. Each of the 3 fields has the attributes Contact form Field Size and Contact form Field Label. For year Contact form field the select list interval can be defined. These 3 Contact form fields can be separated in the format set by the fields separator attribute. The Contact form field has several attributes: Field Id, Field Name, Field Label, Field Label Position, Class Name, Required, Additional Attributes.
272
- Time: This field of contact form can be used for typing a time. Time can be shown in 24 hour or 12 hour formats by setting the time format attribute. The seconds preview can be enabled/disabled by setting the Display Seconds attribute. The field has several standard attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Class Name, Required, Additional Attributes.
273
  3.4 Select: Choose the Field Type of contact form according to your preference. There are several options:
274
- Custom select: This field of contact form can be used for selecting the values from a list. The list can be defined by Options attribute. You can easily add and remove list items. The checked items are considered as empty values. The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Contact form Field Size, Class Name, Required, Additional Attributes.
275
- Country list: This field of contact form can be used for selecting a country from a list. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Field Size, Class Name, Required, Additional Attributes.
276
- 3.5 Checkbox: This field of contact form can be used for selecting the values from a list of checkboxes. The list can be defined by Options attribute. You can easily add and remove list items. The list can be displayed in horizontal/vertical positions by setting the Relative Position attribute.The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Contact form Field Size, Class Name, Required, Randomize in frontend, Allow other, Additional Attributes.
277
 
278
- 3.6 Radio: This field of contact form can be used for selecting the values from a list of radio buttons. The list can be defined by Options attribute. You can easily add and remove list items. The list can be displayed in horizontal/vertical positions by setting the Relative Position attribute.The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Contact form Field Size, Class Name, Required, Randomize in frontend, Allow other, Additional Attributes.
279
 
280
- 3.7 File Upload: This field of contact form can be used for uploading a file. The size of the uploaded file can be limited by setting the value of Maximum Size attribute in KB. The upload folder can be mentioned by setting the Destination attribute. Only files with extensions listed in Allowed file extensions attribute can be uploaded. The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Class Name, Required, Additional Attributes.
281
 
282
  3.8 Captcha:This field of contact form can be used for the ensuring that the submission is generated by a person. Choose the Field Type according to your preference. There are several options:
283
  Simple Captcha: This is an easy way to configure Simple Captcha for Contact form. The number of randomly generated symbols can be set by the value of Captcha size attribute. The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Class Name, Additional Attributes.
284
- Recaptcha This is an alternative option for Captcha that uses Public and Private Keys. You will need to create reCaptcha keys for your Contact form with the help of a dedicated tool.The tool can be found on https://www.google.com/recaptcha/admin/create.
285
 
286
  3.9 Page Break: This can be used to break the contact form into distinct pages. Use Page Title to provide a title for the given page. Furthermore, the following parameters of the "Next" and "Previous" navigation buttons can be customized:
287
  Type, Name, Class Name, Check the required fields , Additional Attributes.
@@ -292,7 +292,7 @@ Theme. A distinct theme can be applied to each new contact form. The themes can
292
  Location, Map Size, Marker Info, Class Name, Additional Attributes.
293
 
294
  3.12 Button: Choose the Field of the contact form Type according to your preference. There are several options:
295
- Submit and Reset: This field can be used for inserting a submit/reset buttons. You can display reset button by checking the box called Display reset button. Type the name of the submit and reset buttons in Submit button label and Reset button label. The field also has several attributes: Class Name and Additional Attributes.
296
  Custom: This field of contact form can be used for inserting custom buttons. Type the name of each button in button name field. You can define click functions for each button. The field of the contact form also has several attributes: Class Name and Additional Attributes.
297
 
298
  ==Contact Form Maker Step by step guide Step 4 ==
@@ -320,7 +320,7 @@ Alternatively, you can use Contact Form Maker without the button on the toolbar:
320
  - Views: The number of times the contact form has been viewed.
321
  - Converasion Rate: The percentage of submitted contact forms to the overall number of views.
322
 
323
- 5.4 For the contact forms that contain checkboxes or radio buttons a separate statistics is available. It shows how many times a particular checkbox/radio button of the Contact form has been checked, and what is the ratio of that number to the overall number of checks of the Contact form.
324
 
325
  5.5 There is a possibility to search the submissions database by all the relevant contact form fields of the given contact form. Submissions can be sorted by any of the fields of the contact form by clicking the labels.
326
 
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
 
16
  [User Manual](http://web-dorado.com/wordpress-form-maker-guide-1.html)
17
  [Frequently Asked Questions](http://web-dorado.com/forum/form-maker/316-form-maker-faq.html)
18
  [Support Forum](http://web-dorado.com/forum/26-form-maker.html)
19
+ Contact Form Maker is a sophisticated and user-friendly contact form builder for making application forms. You can add an unlimited number of form fields, including different types of text input form fields (password, address, e-mail, phone, etc.), captcha, map (multiple locations are supported), and form submission buttons. The back-end interface of the WordPress Contact Form Maker is intuitive and easy-to-use. As a result, the users who are not really familiar with scripting and programming can easily create complex application contact forms.
20
 
21
  A number of parameters of the WordPress Contact Form Maker are customizable (e.g. colors and fonts, element size).
22
 
260
  Text Area: This field of contact form can be used for typing some text. The difference between Text Area and Simple Text in Contact Forms is that Simple Text has only one row while Text Area can have several rows. It has several attributes: Field Id, Field Name, Field Label,Field Label Position, Field Size, Value If Empty, Class Name, Required, Allow only unique values, Additional Attributes
261
  Name: This field of contact form can be used for typing a name. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Value If Empty, Field Size, Name Format, Class Name, Required, Allow only unique values, Additional Attributes
262
  Address: This field of contact form can be used for adding an address. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Overall Size, Class Name, Required, Additional Attributes
263
+ Address (Mark on Map): This filed of contact form can be used for adding an address by directly marking it on the map in contact form. It has several attributes: Field Label, ield Label Position, Default Location, Map Size, Marker Info, Class Name, Additional Attributes
264
  E-mail:This field of contact form can be used for typing the submitter�s e-mail. The submitted e-mail validation of the Contact form is checked. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Field Size, Value If Empty, Class Name, Send mail to submitter, Required, Allow only unique values, Additional Attributes.
265
+ Number: This field of contact form can be used to provide numbers for different purposes (e.g. serial number) in contact form. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Field Size, Value If Empty, Class Name, Required, Allow only unique values, Additional Attributes
266
  Phone: This field of contact form can be used to provide a phone number. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Value If Empty, Field Size, Class Name, Required, Allow only unique values, Additional Attributes
267
+ Hidden Field: This field of contact form can be used to store additional information that does not need to be displayed in contact form. It has several attributes : Field ld, Field Name, Field Value, Additional Attributes.
268
 
269
  3.3 Time and Date: Choose the Field Type of contact form according to your preference. There are several options:
270
+ Date (single field with a picker): This field of contact form can be used for typing a date or choosing by the picker in contact form. It has several attributes: Field Id, Field Name, Field Label, ield Label Position, Date format, Date Picker Label, Class Name, Required, Additional Attributes.
271
+ Date (3 separate fields): This field of contact form can be used for typing a date in 3 field format(day, month, year) in contact form . Each of the 3 fields can be set as text input or select list. Each of the 3 fields has the attributes Contact form Field Size and Contact form Field Label. For year Contact form field the select list interval can be defined. These 3 Contact form fields can be separated in the format set by the fields separator attribute. The Contact form field has several attributes: Field Id, Field Name, Field Label, Field Label Position, Class Name, Required, Additional Attributes.
272
+ Time: This field of contact form can be used for typing a time in contact form. Time can be shown in 24 hour or 12 hour formats by setting the time format attribute in contact form. The seconds preview can be enabled/disabled by setting the Display Seconds attribute in contact form. The field has several standard attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Class Name, Required, Additional Attributes.
273
  3.4 Select: Choose the Field Type of contact form according to your preference. There are several options:
274
+ Custom select: This field of contact form can be used for selecting the values from a list in contact form. The list can be defined by Options attribute. You can easily add and remove list items in contact form. The checked items are considered as empty values. The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Contact form Field Size, Class Name, Required, Additional Attributes.
275
+ Country list: This field of contact form can be used for selecting a country from a list in contact form. It has several attributes: Field Id, Field Name, Field Label, Field Label Position, Field Size, Class Name, Required, Additional Attributes.
276
+ 3.5 Checkbox: This field of contact form can be used for selecting the values from a list of checkboxes in contact form. The list can be defined by Options attribute. You can easily add and remove list items. The list can be displayed in horizontal/vertical positions by setting the Relative Position attribute.The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Contact form Field Size, Class Name, Required, Randomize in frontend, Allow other, Additional Attributes.
277
 
278
+ 3.6 Radio: This field of contact form can be used for selecting the values from a list of radio buttons in contact form. The list can be defined by Options attribute. You can easily add and remove list items. The list can be displayed in horizontal/vertical positions by setting the Relative Position attribute.The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Contact form Field Size, Class Name, Required, Randomize in frontend, Allow other, Additional Attributes.
279
 
280
+ 3.7 File Upload: This field of contact form can be used for uploading a file in contact form. The size of the uploaded file can be limited by setting the value of Maximum Size attribute in KB in contact form. The upload folder can be mentioned by setting the Destination attribute. Only files with extensions listed in Allowed file extensions attribute can be uploaded. The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Class Name, Required, Additional Attributes.
281
 
282
  3.8 Captcha:This field of contact form can be used for the ensuring that the submission is generated by a person. Choose the Field Type according to your preference. There are several options:
283
  Simple Captcha: This is an easy way to configure Simple Captcha for Contact form. The number of randomly generated symbols can be set by the value of Captcha size attribute. The field has several attributes: Contact form Field Id, Contact form Field Name, Contact form Field Label, Contact form Field Label Position, Class Name, Additional Attributes.
284
+ Recaptcha This is an alternative option for Captcha that uses Public and Private Keys in contact form. You will need to create reCaptcha keys for your Contact form with the help of a dedicated tool.The tool can be found on https://www.google.com/recaptcha/admin/create.
285
 
286
  3.9 Page Break: This can be used to break the contact form into distinct pages. Use Page Title to provide a title for the given page. Furthermore, the following parameters of the "Next" and "Previous" navigation buttons can be customized:
287
  Type, Name, Class Name, Check the required fields , Additional Attributes.
292
  Location, Map Size, Marker Info, Class Name, Additional Attributes.
293
 
294
  3.12 Button: Choose the Field of the contact form Type according to your preference. There are several options:
295
+ Submit and Reset: This field can be used for inserting a submit/reset buttons. You can display reset button by checking the box called Display reset button in contact form. Type the name of the submit and reset buttons in Submit button label and Reset button label. The field also has several attributes: Class Name and Additional Attributes.
296
  Custom: This field of contact form can be used for inserting custom buttons. Type the name of each button in button name field. You can define click functions for each button. The field of the contact form also has several attributes: Class Name and Additional Attributes.
297
 
298
  ==Contact Form Maker Step by step guide Step 4 ==
320
  - Views: The number of times the contact form has been viewed.
321
  - Converasion Rate: The percentage of submitted contact forms to the overall number of views.
322
 
323
+ 5.4 For the contact forms that contain checkboxes or radio buttons a separate statistics is available in contact form. It shows how many times a particular checkbox/radio button of the Contact form has been checked, and what is the ratio of that number to the overall number of checks of the Contact form.
324
 
325
  5.5 There is a possibility to search the submissions database by all the relevant contact form fields of the given contact form. Submissions can be sorted by any of the fields of the contact form by clicking the labels.
326
 
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
  ?>