PluginProbe
Contact Form by BestWebSoft – Advanced WP Contact Form Builder for WordPress / 3.78
Contact Form by BestWebSoft – Advanced WP Contact Form Builder for WordPress v3.78
3.76 3.77 3.78 3.79 3.80 3.81 3.82 3.83 3.84 3.85 3.86 3.87 3.88 3.89 3.90 3.91 3.92 3.93 3.94 3.95 3.96 3.97 3.98 3.99 4.0.0 All 150 releases
contact-form-plugin / contact_form.php

contact_form.php in Contact Form by BestWebSoft – Advanced WP Contact Form Builder for WordPress 3.78, at contact_form.php

2,583 lines 182.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Contact Form
4 Plugin URI: http://bestwebsoft.com/plugin/
5 Description: Plugin for Contact Form.
6 Author: BestWebSoft
7 Version: 3.78
8 Author URI: http://bestwebsoft.com/
9 License: GPLv2 or later
10 */
11
12 /* @ Copyright 2014 BestWebSoft ( http://support.bestwebsoft.com )
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License, version 2, as
16 published by the Free Software Foundation.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 */
27
28 /* Add option page in admin menu */
29 if ( ! function_exists( 'cntctfrm_admin_menu' ) ) {
30 function cntctfrm_admin_menu() {
31 global $bstwbsftwppdtplgns_options, $wpmu, $bstwbsftwppdtplgns_added_menu;
32 $bws_menu_info = get_plugin_data( plugin_dir_path( __FILE__ ) . "bws_menu/bws_menu.php" );
33 $bws_menu_version = $bws_menu_info["Version"];
34 $base = plugin_basename(__FILE__);
35
36 if ( ! isset( $bstwbsftwppdtplgns_options ) ) {
37 if ( 1 == $wpmu ) {
38 if ( ! get_site_option( 'bstwbsftwppdtplgns_options' ) )
39 add_site_option( 'bstwbsftwppdtplgns_options', array(), '', 'yes' );
40 $bstwbsftwppdtplgns_options = get_site_option( 'bstwbsftwppdtplgns_options' );
41 } else {
42 if ( ! get_option( 'bstwbsftwppdtplgns_options' ) )
43 add_option( 'bstwbsftwppdtplgns_options', array(), '', 'yes' );
44 $bstwbsftwppdtplgns_options = get_option( 'bstwbsftwppdtplgns_options' );
45 }
46 }
47
48 if ( isset( $bstwbsftwppdtplgns_options['bws_menu_version'] ) ) {
49 $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] = $bws_menu_version;
50 unset( $bstwbsftwppdtplgns_options['bws_menu_version'] );
51 update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options, '', 'yes' );
52 require_once( dirname( __FILE__ ) . '/bws_menu/bws_menu.php' );
53 } else if ( ! isset( $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] ) || $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] < $bws_menu_version ) {
54 $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] = $bws_menu_version;
55 update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options, '', 'yes' );
56 require_once( dirname( __FILE__ ) . '/bws_menu/bws_menu.php' );
57 } else if ( ! isset( $bstwbsftwppdtplgns_added_menu ) ) {
58 $plugin_with_newer_menu = $base;
59 foreach ( $bstwbsftwppdtplgns_options['bws_menu']['version'] as $key => $value ) {
60 if ( $bws_menu_version < $value && is_plugin_active( $base ) ) {
61 $plugin_with_newer_menu = $key;
62 }
63 }
64 $plugin_with_newer_menu = explode( '/', $plugin_with_newer_menu );
65 $wp_content_dir = defined( 'WP_CONTENT_DIR' ) ? basename( WP_CONTENT_DIR ) : 'wp-content';
66 if ( file_exists( ABSPATH . $wp_content_dir . '/plugins/' . $plugin_with_newer_menu[0] . '/bws_menu/bws_menu.php' ) )
67 require_once( ABSPATH . $wp_content_dir . '/plugins/' . $plugin_with_newer_menu[0] . '/bws_menu/bws_menu.php' );
68 else
69 require_once( dirname( __FILE__ ) . '/bws_menu/bws_menu.php' );
70 $bstwbsftwppdtplgns_added_menu = true;
71 }
72
73 add_menu_page( 'BWS Plugins', 'BWS Plugins', 'manage_options', 'bws_plugins', 'bws_add_menu_render', plugins_url( "images/px.png", __FILE__ ), 1001 );
74 add_submenu_page('bws_plugins', __( 'Contact Form Settings', 'contact_form' ), __( 'Contact Form', 'contact_form' ), 'manage_options', "contact_form.php", 'cntctfrm_settings_page' );
75
76 /* Call register settings function */
77 add_action( 'admin_init', 'cntctfrm_settings' );
78 }
79 }
80
81 if ( ! function_exists ( 'cntctfrm_init' ) ) {
82 function cntctfrm_init() {
83 /* Internationalization, first(!) */
84 if ( ! session_id() )
85 @session_start();
86
87 load_plugin_textdomain( 'contact_form', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
88
89 if ( ! is_admin() )
90 cntctfrm_check_and_send();
91 }
92 }
93
94 if ( ! function_exists ( 'cntctfrm_admin_init' ) ) {
95 function cntctfrm_admin_init() {
96 global $bws_plugin_info, $cntctfrm_plugin_info;
97 /* Add variable for bws_menu */
98 $cntctfrm_plugin_info = get_plugin_data( __FILE__ );
99
100 if ( ! isset( $bws_plugin_info ) || empty( $bws_plugin_info ) )
101 $bws_plugin_info = array( 'id' => '77', 'version' => $cntctfrm_plugin_info["Version"] );
102
103 /* Function check if plugin is compatible with current WP version */
104 cntctfrm_version_check();
105
106 /* Call register settings function */
107 if ( isset( $_REQUEST['page'] ) && ( 'contact_form.php' == $_REQUEST['page'] ) )
108 cntctfrm_settings();
109 }
110 }
111
112 /* Register settings for plugin */
113 if ( ! function_exists( 'cntctfrm_settings' ) ) {
114 function cntctfrm_settings() {
115 global $wpmu, $cntctfrm_options, $cntctfrm_option_defaults, $wpdb, $bws_plugin_info, $cntctfrm_plugin_info;
116 $cntctfrm_db_version = "1.0";
117
118 $cntctfrm_option_defaults = array(
119 'plugin_option_version' => $cntctfrm_plugin_info["Version"],
120 'plugin_db_version' => $cntctfrm_db_version,
121 'cntctfrm_user_email' => 'admin',
122 'cntctfrm_custom_email' => '',
123 'cntctfrm_select_email' => 'user',
124 'cntctfrm_from_email' => 'user',
125 'cntctfrm_custom_from_email' => '',
126 'cntctfrm_additions_options' => 0,
127 'cntctfrm_attachment' => 0,
128 'cntctfrm_attachment_explanations' => 1,
129 'cntctfrm_send_copy' => 0,
130 'cntctfrm_from_field' => get_bloginfo( 'name' ),
131 'cntctfrm_select_from_field' => 'custom',
132 'cntctfrm_display_name_field' => 1,
133 'cntctfrm_display_address_field' => 0,
134 'cntctfrm_display_phone_field' => 0,
135 'cntctfrm_required_name_field' => 1,
136 'cntctfrm_required_address_field' => 0,
137 'cntctfrm_required_email_field' => 1,
138 'cntctfrm_required_phone_field' => 0,
139 'cntctfrm_required_subject_field' => 1,
140 'cntctfrm_required_message_field' => 1,
141 'cntctfrm_required_symbol' => '*',
142 'cntctfrm_display_add_info' => 1,
143 'cntctfrm_display_sent_from' => 1,
144 'cntctfrm_display_date_time' => 1,
145 'cntctfrm_mail_method' => 'wp-mail',
146 'cntctfrm_display_coming_from' => 1,
147 'cntctfrm_display_user_agent' => 1,
148 'cntctfrm_language' => array(),
149 'cntctfrm_change_label' => 0,
150 'cntctfrm_name_label' => array( 'en' => __( "Name:", 'contact_form' ) ),
151 'cntctfrm_address_label' => array( 'en' => __( "Address:", 'contact_form' ) ),
152 'cntctfrm_email_label' => array( 'en' => __( "Email Address:", 'contact_form' ) ),
153 'cntctfrm_phone_label' => array( 'en' => __( "Phone number:", 'contact_form' ) ),
154 'cntctfrm_subject_label' => array( 'en' => __( "Subject:", 'contact_form' ) ),
155 'cntctfrm_message_label' => array( 'en' => __( "Message:", 'contact_form' ) ),
156 'cntctfrm_attachment_label' => array( 'en' => __( "Attachment:", 'contact_form' ) ),
157 'cntctfrm_attachment_tooltip' => array( 'en' => __( "Supported file types: HTML, TXT, CSS, GIF, PNG, JPEG, JPG, TIFF, BMP, AI, EPS, PS, RTF, PDF, DOC, DOCX, XLS, ZIP, RAR, WAV, MP3, PPT. Max file size: 2MB", 'contact_form' ) ),
158 'cntctfrm_send_copy_label' => array( 'en' => __( "Send me a copy", 'contact_form' ) ),
159 'cntctfrm_submit_label' => array( 'en' => __( "Submit", 'contact_form' ) ),
160 'cntctfrm_name_error' => array( 'en' => __( "Your name is required.", 'contact_form' ) ),
161 'cntctfrm_address_error' => array( 'en' => __( "Address is required.", 'contact_form' ) ),
162 'cntctfrm_email_error' => array( 'en' => __( "A valid email address is required.", 'contact_form' ) ),
163 'cntctfrm_phone_error' => array( 'en' => __( "Phone number is required.", 'contact_form' ) ),
164 'cntctfrm_subject_error' => array( 'en' => __( "Subject is required.", 'contact_form' ) ),
165 'cntctfrm_message_error' => array( 'en' => __( "Message text is required.", 'contact_form' ) ),
166 'cntctfrm_attachment_error' => array( 'en' => __( "File format is not valid.", 'contact_form' ) ),
167 'cntctfrm_attachment_upload_error' => array( 'en' => __( "File upload error.", 'contact_form' ) ),
168 'cntctfrm_attachment_move_error' => array( 'en' => __( "The file could not be uploaded.", 'contact_form' ) ),
169 'cntctfrm_attachment_size_error' => array( 'en' => __( "This file is too large.", 'contact_form' ) ),
170 'cntctfrm_captcha_error' => array( 'en' => __( "Please fill out the CAPTCHA.", 'contact_form' ) ),
171 'cntctfrm_form_error' => array( 'en' => __( "Please make corrections below and try again.", 'contact_form' ) ),
172 'cntctfrm_action_after_send' => 1,
173 'cntctfrm_thank_text' => array( 'en' => __( "Thank you for contacting us.", 'contact_form' ) ),
174 'cntctfrm_redirect_url' => '',
175 'cntctfrm_delete_attached_file' => '0',
176 'cntctfrm_html_email' => 1,
177 'cntctfrm_site_name_parameter' => 'SERVER_NAME'
178 );
179
180 /* Check contact-form-multi plugin */
181 if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) )
182 $contact_form_multi_active = true;
183 if ( is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) )
184 $contact_form_multi_pro_active = true;
185
186 /* Install the option defaults */
187 if ( 1 == $wpmu ) {
188 if ( ! get_site_option( 'cntctfrm_options' ) )
189 add_site_option( 'cntctfrm_options', $cntctfrm_option_defaults, '', 'yes' );
190 } else {
191 if ( ! get_option( 'cntctfrm_options' ) )
192 add_option( 'cntctfrm_options', $cntctfrm_option_defaults, '', 'yes' );
193 }
194
195 /* Get options from the database for default options */
196 if ( isset( $contact_form_multi_active ) || isset( $contact_form_multi_pro_active ) ) {
197 if ( 1 == $wpmu ) {
198 if ( ! get_site_option( 'cntctfrmmlt_options' ) )
199 add_site_option( 'cntctfrmmlt_options', $cntctfrm_option_defaults, '', 'yes' );
200
201 $cntctfrmmlt_options = get_site_option( 'cntctfrmmlt_options' );
202 } else {
203 if ( ! get_option( 'cntctfrmmlt_options' ) )
204 add_option( 'cntctfrmmlt_options', $cntctfrm_option_defaults, '', 'yes' );
205
206 $cntctfrmmlt_options = get_option( 'cntctfrmmlt_options' );
207 }
208
209 if ( ! isset( $cntctfrmmlt_options['plugin_option_version'] ) || $cntctfrmmlt_options['plugin_option_version'] != $cntctfrm_plugin_info["Version"] ) {
210 $cntctfrmmlt_options = array_merge( $cntctfrm_option_defaults, $cntctfrmmlt_options );
211 $cntctfrmmlt_options['plugin_option_version'] = $cntctfrm_plugin_info["Version"];
212 update_option( 'cntctfrmmlt_options', $cntctfrmmlt_options );
213 }
214
215 /* Get options from the database */
216 if ( 1 == $wpmu ) {
217 if ( get_site_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] ) )
218 $cntctfrm_options = get_site_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] );
219 else
220 $cntctfrm_options = get_site_option( 'cntctfrmmlt_options' );
221 } else {
222 if ( get_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] ) )
223 $cntctfrm_options = get_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] );
224 else
225 $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
226 }
227 } else {
228 /* Get options from the database */
229 if ( 1 == $wpmu )
230 $cntctfrm_options = get_site_option( 'cntctfrm_options' );
231 else
232 $cntctfrm_options = get_option( 'cntctfrm_options' );
233 }
234
235 if ( empty( $cntctfrm_options['cntctfrm_language'] ) && ! is_array( $cntctfrm_options['cntctfrm_name_label'] ) ) {
236 $cntctfrm_options['cntctfrm_name_label'] = array( 'en' => $cntctfrm_options['cntctfrm_name_label'] );
237 $cntctfrm_options['cntctfrm_address_label'] = array( 'en' => $cntctfrm_options['cntctfrm_address_label'] );
238 $cntctfrm_options['cntctfrm_email_label'] = array( 'en' => $cntctfrm_options['cntctfrm_email_label'] );
239 $cntctfrm_options['cntctfrm_phone_label'] = array( 'en' => $cntctfrm_options['cntctfrm_phone_label'] );
240 $cntctfrm_options['cntctfrm_subject_label'] = array( 'en' => $cntctfrm_options['cntctfrm_subject_label'] );
241 $cntctfrm_options['cntctfrm_message_label'] = array( 'en' => $cntctfrm_options['cntctfrm_message_label'] );
242 $cntctfrm_options['cntctfrm_attachment_label'] = array( 'en' => $cntctfrm_options['cntctfrm_attachment_label'] );
243 $cntctfrm_options['cntctfrm_attachment_tooltip'] = array( 'en' => $cntctfrm_options['cntctfrm_attachment_tooltip'] );
244 $cntctfrm_options['cntctfrm_send_copy_label'] = array( 'en' => $cntctfrm_options['cntctfrm_send_copy_label'] );
245 $cntctfrm_options['cntctfrm_thank_text'] = array( 'en' => $cntctfrm_options['cntctfrm_thank_text'] );
246 $cntctfrm_options['cntctfrm_submit_label'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_submit_label']['en'] );
247 $cntctfrm_options['cntctfrm_name_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_name_error']['en'] );
248 $cntctfrm_options['cntctfrm_address_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_address_error']['en'] );
249 $cntctfrm_options['cntctfrm_email_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_email_error']['en'] );
250 $cntctfrm_options['cntctfrm_phone_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_phone_error']['en'] );
251 $cntctfrm_options['cntctfrm_subject_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_subject_error']['en'] );
252 $cntctfrm_options['cntctfrm_message_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_message_error']['en'] );
253 $cntctfrm_options['cntctfrm_attachment_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_attachment_error']['en'] );
254 $cntctfrm_options['cntctfrm_attachment_upload_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_attachment_upload_error']['en'] );
255 $cntctfrm_options['cntctfrm_attachment_move_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_attachment_move_error']['en'] );
256 $cntctfrm_options['cntctfrm_attachment_size_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_attachment_size_error']['en'] );
257 $cntctfrm_options['cntctfrm_captcha_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_captcha_error']['en'] );
258 $cntctfrm_options['cntctfrm_form_error'] = array( 'en' => $cntctfrm_option_defaults['cntctfrm_form_error']['en'] );
259 }
260
261 if ( ! isset( $cntctfrm_options['plugin_option_version'] ) || $cntctfrm_options['plugin_option_version'] != $cntctfrm_plugin_info["Version"] ) {
262 $cntctfrm_options = array_merge( $cntctfrm_option_defaults, $cntctfrm_options );
263 $cntctfrm_options['plugin_option_version'] = $cntctfrm_plugin_info["Version"];
264
265 if ( isset( $cntctfrm_options['cntctfrm_required_symbol'] ) && '1' == $cntctfrm_options['cntctfrm_required_symbol'] )
266 $cntctfrm_options['cntctfrm_required_symbol'] = '*';
267 elseif ( isset( $cntctfrm_options['cntctfrm_required_symbol'] ) && '0' == $cntctfrm_options['cntctfrm_required_symbol'] )
268 $cntctfrm_options['cntctfrm_required_symbol'] = '';
269
270 if ( isset( $contact_form_multi_active ) || isset( $contact_form_multi_pro_active ) ) {
271 if ( get_site_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] ) )
272 update_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] , $cntctfrm_options, '', 'yes' );
273 else
274 update_option( 'cntctfrmmlt_options', $cntctfrm_options );
275 } else
276 update_option( 'cntctfrm_options', $cntctfrm_options );
277 }
278
279 /* Create db table of fields list */
280 if ( ! isset( $cntctfrm_options['plugin_db_version'] ) || $cntctfrm_options['plugin_db_version'] != $cntctfrm_db_version ) {
281 cntctfrm_db_create();
282 $cntctfrm_options['plugin_db_version'] = $cntctfrm_db_version;
283 update_option( 'cntctfrm_options', $cntctfrm_options );
284 }
285 }
286 }
287
288 /* Function check if plugin is compatible with current WP version */
289 if ( ! function_exists ( 'cntctfrm_db_create' ) ) {
290 function cntctfrm_db_create() {
291 global $wpdb;
292 $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "cntctfrm_field" );
293 $sql = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "cntctfrm_field` (
294 id int NOT NULL AUTO_INCREMENT,
295 name CHAR(100) NOT NULL,
296 UNIQUE KEY id (id)
297 );";
298 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
299 dbDelta( $sql );
300 $fields = array(
301 'name',
302 'email',
303 'subject',
304 'message',
305 'address',
306 'phone',
307 'attachment',
308 'attachment_explanations',
309 'send_copy',
310 'sent_from',
311 'date_time',
312 'coming_from',
313 'user_agent'
314 );
315 foreach ( $fields as $key => $value ) {
316 $db_row = $wpdb->get_row( "SELECT * FROM " . $wpdb->prefix . "cntctfrm_field WHERE `name` = '" . $value . "'", ARRAY_A );
317 if ( !isset( $db_row ) || empty( $db_row ) ) {
318 $wpdb->insert( $wpdb->prefix . "cntctfrm_field", array( 'name' => $value ), array( '%s' ) );
319 }
320 }
321 }
322 }
323
324 /* Function check if plugin is compatible with current WP version */
325 if ( ! function_exists ( 'cntctfrm_version_check' ) ) {
326 function cntctfrm_version_check() {
327 global $wp_version, $cntctfrm_plugin_info;
328 $require_wp = "3.1"; /* Wordpress at least requires version */
329 $plugin = plugin_basename( __FILE__ );
330 if ( version_compare( $wp_version, $require_wp, "<" ) ) {
331 if ( is_plugin_active( $plugin ) ) {
332 deactivate_plugins( $plugin );
333 wp_die( "<strong>" . $cntctfrm_plugin_info['Name'] . " </strong> " . __( 'requires', 'contact_form' ) . " <strong>WordPress " . $require_wp . "</strong> " . __( 'or higher, that is why it has been deactivated! Please upgrade WordPress and try again.', 'contact_form') . "<br /><br />" . __( 'Back to the WordPress', 'contact_form') . " <a href='" . get_admin_url( null, 'plugins.php' ) . "'>" . __( 'Plugins page', 'contact_form') . "</a>." );
334 }
335 }
336 }
337 }
338
339 /* Add settings page in admin area */
340 if ( ! function_exists( 'cntctfrm_settings_page' ) ) {
341 function cntctfrm_settings_page() {
342 global $cntctfrm_options, $wpdb, $cntctfrm_option_defaults, $wp_version, $cntctfrm_plugin_info, $wpmu;
343 $error = "";
344
345 if ( ! function_exists( 'get_plugins' ) || ! function_exists( 'is_plugin_active_for_network' ) )
346 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
347
348 $all_plugins = get_plugins();
349 $active_plugins = get_option( 'active_plugins' );
350
351 /* Check contact-form-multi plugin */
352 if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) )
353 $contact_form_multi_active = true;
354 if ( is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) )
355 $contact_form_multi_pro_active = true;
356
357 /* Get Captcha options */
358 if ( get_option( 'cptch_options' ) )
359 $cptch_options = get_option( 'cptch_options' );
360 if ( get_option( 'cptchpr_options' ) )
361 $cptchpr_options = get_option( 'cptchpr_options' );
362 /* Get Contact Form to DB options */
363 if ( get_option( 'cntctfrmtdb_options' ) )
364 $cntctfrmtdb_options = get_option( 'cntctfrmtdb_options' );
365 if ( get_option( 'cntctfrmtdbpr_options' ) )
366 $cntctfrmtdbpr_options = get_option( 'cntctfrmtdbpr_options' );
367
368 // $userslogin = $wpdb->get_col( "SELECT `user_login` FROM $wpdb->users ", 0 );
369 $userslogin = get_users( 'blog_id=' . $GLOBALS['blog_id'] . '&who=authors' );
370
371 /* Save data for settings page */
372 if ( isset( $_POST['cntctfrm_form_submit'] ) && check_admin_referer( plugin_basename(__FILE__), 'cntctfrm_nonce_name' ) ) {
373 $cntctfrm_options_submit['cntctfrm_user_email'] = $_POST['cntctfrm_user_email'];
374 $cntctfrm_options_submit['cntctfrm_custom_email'] = stripslashes( $_POST['cntctfrm_custom_email'] );
375 $cntctfrm_options_submit['cntctfrm_select_email'] = $_POST['cntctfrm_select_email'];
376 $cntctfrm_options_submit['cntctfrm_from_email'] = $_POST['cntctfrm_from_email'];
377 $cntctfrm_options_submit['cntctfrm_custom_from_email'] = stripslashes( $_POST['cntctfrm_custom_from_email'] );
378 $cntctfrm_options_submit['cntctfrm_additions_options'] = isset( $_POST['cntctfrm_additions_options']) ? $_POST['cntctfrm_additions_options'] : 0;
379 if ( 0 == $cntctfrm_options_submit['cntctfrm_additions_options'] ) {
380 $cntctfrm_options_submit['cntctfrm_attachment'] = 0;
381 $cntctfrm_options_submit['cntctfrm_attachment_explanations'] = 1;
382 $cntctfrm_options_submit['cntctfrm_send_copy'] = 0;
383 $cntctfrm_options_submit['cntctfrm_from_field'] = get_bloginfo( 'name' );
384 $cntctfrm_options_submit['cntctfrm_select_from_field'] = 'custom';
385 $cntctfrm_options_submit['cntctfrm_display_name_field'] = 1;
386 $cntctfrm_options_submit['cntctfrm_display_address_field'] = 0;
387 $cntctfrm_options_submit['cntctfrm_display_phone_field'] = 0;
388 $cntctfrm_options_submit['cntctfrm_required_name_field'] = 1;
389 $cntctfrm_options_submit['cntctfrm_required_address_field'] = 0;
390 $cntctfrm_options_submit['cntctfrm_required_email_field'] = 1;
391 $cntctfrm_options_submit['cntctfrm_required_phone_field'] = 0;
392 $cntctfrm_options_submit['cntctfrm_required_subject_field'] = 1;
393 $cntctfrm_options_submit['cntctfrm_required_message_field'] = 1;
394 $cntctfrm_options_submit['cntctfrm_required_symbol'] = '*';
395 $cntctfrm_options_submit['cntctfrm_display_add_info'] = 1;
396 $cntctfrm_options_submit['cntctfrm_display_sent_from'] = 1;
397 $cntctfrm_options_submit['cntctfrm_display_date_time'] = 1;
398 $cntctfrm_options_submit['cntctfrm_mail_method'] = 'wp-mail';
399 $cntctfrm_options_submit['cntctfrm_display_coming_from'] = 1;
400 $cntctfrm_options_submit['cntctfrm_display_user_agent'] = 1;
401 $cntctfrm_options_submit['cntctfrm_change_label'] = 0;
402 $cntctfrm_options_submit['cntctfrm_action_after_send'] = 1;
403 $cntctfrm_options_submit['cntctfrm_delete_attached_file'] = 0;
404 $cntctfrm_options_submit['cntctfrm_html_email'] = 1;
405 $cntctfrm_options_submit['cntctfrm_site_name_parameter'] = 'SERVER_NAME';
406 if ( empty( $cntctfrm_options['cntctfrm_language'] ) ) {
407 $cntctfrm_options_submit['cntctfrm_name_label'] = $cntctfrm_option_defaults['cntctfrm_name_label'];
408 $cntctfrm_options_submit['cntctfrm_address_label'] = $cntctfrm_option_defaults['cntctfrm_address_label'];
409 $cntctfrm_options_submit['cntctfrm_email_label'] = $cntctfrm_option_defaults['cntctfrm_email_label'];
410 $cntctfrm_options_submit['cntctfrm_phone_label'] = $cntctfrm_option_defaults['cntctfrm_phone_label'];
411 $cntctfrm_options_submit['cntctfrm_subject_label'] = $cntctfrm_option_defaults['cntctfrm_subject_label'];
412 $cntctfrm_options_submit['cntctfrm_message_label'] = $cntctfrm_option_defaults['cntctfrm_message_label'];
413 $cntctfrm_options_submit['cntctfrm_attachment_label'] = $cntctfrm_option_defaults['cntctfrm_attachment_label'];
414 $cntctfrm_options_submit['cntctfrm_attachment_tooltip'] = $cntctfrm_option_defaults['cntctfrm_attachment_tooltip'];
415 $cntctfrm_options_submit['cntctfrm_send_copy_label'] = $cntctfrm_option_defaults['cntctfrm_send_copy_label'];
416 $cntctfrm_options_submit['cntctfrm_thank_text'] = $cntctfrm_option_defaults['cntctfrm_thank_text'];
417 $cntctfrm_options_submit['cntctfrm_submit_label'] = $cntctfrm_option_defaults['cntctfrm_submit_label'];
418 $cntctfrm_options_submit['cntctfrm_name_error'] = $cntctfrm_option_defaults['cntctfrm_name_error'];
419 $cntctfrm_options_submit['cntctfrm_address_error'] = $cntctfrm_option_defaults['cntctfrm_address_error'];
420 $cntctfrm_options_submit['cntctfrm_email_error'] = $cntctfrm_option_defaults['cntctfrm_email_error'];
421 $cntctfrm_options_submit['cntctfrm_phone_error'] = $cntctfrm_option_defaults['cntctfrm_phone_error'];
422 $cntctfrm_options_submit['cntctfrm_subject_error'] = $cntctfrm_option_defaults['cntctfrm_subject_error'];
423 $cntctfrm_options_submit['cntctfrm_message_error'] = $cntctfrm_option_defaults['cntctfrm_message_error'];
424 $cntctfrm_options_submit['cntctfrm_attachment_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_error'];
425 $cntctfrm_options_submit['cntctfrm_attachment_upload_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_upload_error'];
426 $cntctfrm_options_submit['cntctfrm_attachment_move_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_move_error'];
427 $cntctfrm_options_submit['cntctfrm_attachment_size_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_size_error'];
428 $cntctfrm_options_submit['cntctfrm_captcha_error'] = $cntctfrm_option_defaults['cntctfrm_captcha_error'];
429 $cntctfrm_options_submit['cntctfrm_form_error'] = $cntctfrm_option_defaults['cntctfrm_form_error'];
430 } else {
431 $cntctfrm_options_submit['cntctfrm_name_label']['en'] = $cntctfrm_option_defaults['cntctfrm_name_label']['en'];
432 $cntctfrm_options_submit['cntctfrm_address_label']['en'] = $cntctfrm_option_defaults['cntctfrm_address_label']['en'];
433 $cntctfrm_options_submit['cntctfrm_email_label']['en'] = $cntctfrm_option_defaults['cntctfrm_email_label']['en'];
434 $cntctfrm_options_submit['cntctfrm_phone_label']['en'] = $cntctfrm_option_defaults['cntctfrm_phone_label']['en'];
435 $cntctfrm_options_submit['cntctfrm_subject_label']['en'] = $cntctfrm_option_defaults['cntctfrm_subject_label']['en'];
436 $cntctfrm_options_submit['cntctfrm_message_label']['en'] = $cntctfrm_option_defaults['cntctfrm_message_label']['en'];
437 $cntctfrm_options_submit['cntctfrm_attachment_label']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_label']['en'];
438 $cntctfrm_options_submit['cntctfrm_attachment_tooltip']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_tooltip']['en'];
439 $cntctfrm_options_submit['cntctfrm_send_copy_label']['en'] = $cntctfrm_option_defaults['cntctfrm_send_copy_label']['en'];
440 $cntctfrm_options_submit['cntctfrm_thank_text']['en'] = $cntctfrm_option_defaults['cntctfrm_thank_text']['en'];
441 $cntctfrm_options_submit['cntctfrm_submit_label']['en'] = $cntctfrm_option_defaults['cntctfrm_submit_label']['en'];
442 $cntctfrm_options_submit['cntctfrm_name_error']['en'] = $cntctfrm_option_defaults['cntctfrm_name_error']['en'];
443 $cntctfrm_options_submit['cntctfrm_address_error']['en'] = $cntctfrm_option_defaults['cntctfrm_address_error']['en'];
444 $cntctfrm_options_submit['cntctfrm_email_error']['en'] = $cntctfrm_option_defaults['cntctfrm_email_error']['en'];
445 $cntctfrm_options_submit['cntctfrm_phone_error']['en'] = $cntctfrm_option_defaults['cntctfrm_phone_error']['en'];
446 $cntctfrm_options_submit['cntctfrm_subject_error']['en'] = $cntctfrm_option_defaults['cntctfrm_subject_error']['en'];
447 $cntctfrm_options_submit['cntctfrm_message_error']['en'] = $cntctfrm_option_defaults['cntctfrm_message_error']['en'];
448 $cntctfrm_options_submit['cntctfrm_attachment_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_error']['en'];
449 $cntctfrm_options_submit['cntctfrm_attachment_upload_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_upload_error']['en'];
450 $cntctfrm_options_submit['cntctfrm_attachment_move_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_move_error']['en'];
451 $cntctfrm_options_submit['cntctfrm_attachment_size_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_size_error']['en'];
452 $cntctfrm_options_submit['cntctfrm_captcha_error']['en'] = $cntctfrm_option_defaults['cntctfrm_captcha_error']['en'];
453 $cntctfrm_options_submit['cntctfrm_form_error']['en'] = $cntctfrm_option_defaults['cntctfrm_form_error']['en'];
454 }
455 $cntctfrm_options_submit['cntctfrm_redirect_url'] = '';
456 } else {
457
458 $cntctfrm_options_submit['cntctfrm_mail_method'] = $_POST['cntctfrm_mail_method'];
459 $cntctfrm_options_submit['cntctfrm_from_field'] = $_POST['cntctfrm_from_field'];
460 $cntctfrm_options_submit['cntctfrm_select_from_field'] = $_POST['cntctfrm_select_from_field'];
461 $cntctfrm_options_submit['cntctfrm_display_name_field'] = isset( $_POST['cntctfrm_display_name_field']) ? 1 : 0;
462 $cntctfrm_options_submit['cntctfrm_display_address_field'] = isset( $_POST['cntctfrm_display_address_field']) ? 1 : 0;
463 $cntctfrm_options_submit['cntctfrm_display_phone_field'] = isset( $_POST['cntctfrm_display_phone_field']) ? 1 : 0;
464 $cntctfrm_options_submit['cntctfrm_attachment'] = isset( $_POST['cntctfrm_attachment']) ? $_POST['cntctfrm_attachment'] : 0;
465 $cntctfrm_options_submit['cntctfrm_attachment_explanations'] = isset( $_POST['cntctfrm_attachment_explanations']) ? $_POST['cntctfrm_attachment_explanations'] : 0;
466 $cntctfrm_options_submit['cntctfrm_send_copy'] = isset( $_POST['cntctfrm_send_copy']) ? $_POST['cntctfrm_send_copy'] : 0;
467
468 $cntctfrm_options_submit['cntctfrm_delete_attached_file'] = isset( $_POST['cntctfrm_delete_attached_file']) ? $_POST['cntctfrm_delete_attached_file'] : 0;
469
470 if ( isset( $_POST['cntctfrm_display_captcha'] ) ) {
471 if ( get_option( 'cptch_options' ) ) {
472 $cptch_options['cptch_contact_form'] = 1;
473 update_option( 'cptch_options', $cptch_options, '', 'yes' );
474 }
475 if ( get_option( 'cptchpr_options' ) ) {
476 $cptchpr_options['cptchpr_contact_form'] = 1;
477 update_option( 'cptchpr_options', $cptchpr_options, '', 'yes' );
478 }
479 } else {
480 if ( get_option( 'cptch_options' ) ) {
481 $cptch_options['cptch_contact_form'] = 0;
482 update_option( 'cptch_options', $cptch_options, '', 'yes' );
483 }
484 if ( get_option( 'cptchpr_options' ) ) {
485 $cptchpr_options['cptchpr_contact_form'] = 0;
486 update_option( 'cptchpr_options', $cptchpr_options, '', 'yes' );
487 }
488 }
489
490 if ( isset( $_POST['cntctfrm_save_email_to_db'] ) ) {
491 if ( get_option( 'cntctfrmtdb_options' ) ) {
492 $cntctfrmtdb_options['cntctfrmtdb_save_messages_to_db'] = 1;
493 update_option( 'cntctfrmtdb_options', $cntctfrmtdb_options, '', 'yes' );
494 }
495 if ( get_option( 'cntctfrmtdbpr_options' ) ) {
496 $cntctfrmtdbpr_options['save_messages_to_db'] = 1;
497 update_option( 'cntctfrmtdbpr_options', $cntctfrmtdbpr_options, '', 'yes' );
498 }
499 } else {
500 if ( get_option( 'cntctfrmtdb_options' ) ) {
501 $cntctfrmtdb_options['cntctfrmtdb_save_messages_to_db'] = 0;
502 update_option( 'cntctfrmtdb_options', $cntctfrmtdb_options, '', 'yes' );
503 }
504 if ( get_option( 'cntctfrmtdbpr_options' ) ) {
505 $cntctfrmtdbpr_options['save_messages_to_db'] = 0;
506 update_option( 'cntctfrmtdbpr_options', $cntctfrmtdbpr_options, '', 'yes' );
507 }
508 }
509
510 if ( 0 == $cntctfrm_options_submit['cntctfrm_display_name_field'] ) {
511 $cntctfrm_options_submit['cntctfrm_required_name_field'] = 0;
512 } else {
513 $cntctfrm_options_submit['cntctfrm_required_name_field'] = isset( $_POST['cntctfrm_required_name_field']) ? 1 : 0;
514 }
515 if ( 0 == $cntctfrm_options_submit['cntctfrm_display_address_field'] ) {
516 $cntctfrm_options_submit['cntctfrm_required_address_field'] = 0;
517 } else {
518 $cntctfrm_options_submit['cntctfrm_required_address_field'] = isset( $_POST['cntctfrm_required_address_field']) ? 1 : 0;
519 }
520 $cntctfrm_options_submit['cntctfrm_required_email_field'] = isset( $_POST['cntctfrm_required_email_field']) ? 1 : 0;
521 if ( 0 == $cntctfrm_options_submit['cntctfrm_display_phone_field'] ) {
522 $cntctfrm_options_submit['cntctfrm_required_phone_field'] = 0;
523 } else {
524 $cntctfrm_options_submit['cntctfrm_required_phone_field'] = isset( $_POST['cntctfrm_required_phone_field']) ? 1 : 0;
525 }
526 $cntctfrm_options_submit['cntctfrm_required_subject_field'] = isset( $_POST['cntctfrm_required_subject_field']) ? 1 : 0;
527 $cntctfrm_options_submit['cntctfrm_required_message_field'] = isset( $_POST['cntctfrm_required_message_field']) ? 1 : 0;
528
529 $cntctfrm_options_submit['cntctfrm_required_symbol'] = isset( $_POST['cntctfrm_required_symbol']) ? $_POST['cntctfrm_required_symbol'] : '*';
530 $cntctfrm_options_submit['cntctfrm_html_email'] = isset( $_POST['cntctfrm_html_email']) ? 1 : 0;
531 $cntctfrm_options_submit['cntctfrm_site_name_parameter'] = $_POST['cntctfrm_site_name_parameter'];
532 $cntctfrm_options_submit['cntctfrm_display_add_info'] = isset( $_POST['cntctfrm_display_add_info']) ? 1 : 0;
533
534 if ( 1 == $cntctfrm_options_submit['cntctfrm_display_add_info'] ) {
535 $cntctfrm_options_submit['cntctfrm_display_sent_from'] = isset( $_POST['cntctfrm_display_sent_from']) ? 1 : 0;
536 $cntctfrm_options_submit['cntctfrm_display_date_time'] = isset( $_POST['cntctfrm_display_date_time']) ? 1 : 0;
537 $cntctfrm_options_submit['cntctfrm_display_coming_from'] = isset( $_POST['cntctfrm_display_coming_from']) ? 1 : 0;
538 $cntctfrm_options_submit['cntctfrm_display_user_agent'] = isset( $_POST['cntctfrm_display_user_agent']) ? 1 : 0;
539 } else {
540 $cntctfrm_options_submit['cntctfrm_display_sent_from'] = 1;
541 $cntctfrm_options_submit['cntctfrm_display_date_time'] = 1;
542 $cntctfrm_options_submit['cntctfrm_display_coming_from'] = 1;
543 $cntctfrm_options_submit['cntctfrm_display_user_agent'] = 1;
544 }
545
546 $cntctfrm_options_submit['cntctfrm_change_label'] = isset( $_POST['cntctfrm_change_label']) ? 1 : 0;
547
548 if ( 1 == $cntctfrm_options_submit['cntctfrm_change_label'] ) {
549 foreach ( $_POST['cntctfrm_name_label'] as $key => $val ) {
550 $cntctfrm_options_submit['cntctfrm_name_label'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_name_label'][ $key ] ) );
551 $cntctfrm_options_submit['cntctfrm_address_label'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_address_label'][ $key ] ) );
552 $cntctfrm_options_submit['cntctfrm_email_label'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_email_label'][ $key ] ) );
553 $cntctfrm_options_submit['cntctfrm_phone_label'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_phone_label'][ $key ] ) );
554 $cntctfrm_options_submit['cntctfrm_subject_label'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_subject_label'][ $key ] ) );
555 $cntctfrm_options_submit['cntctfrm_message_label'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_message_label'][ $key ] ) );
556 $cntctfrm_options_submit['cntctfrm_attachment_label'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_attachment_label'][ $key ] ) );
557 $cntctfrm_options_submit['cntctfrm_attachment_tooltip'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_attachment_tooltip'][ $key ] ) );
558 $cntctfrm_options_submit['cntctfrm_send_copy_label'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_send_copy_label'][ $key ] ) );
559 $cntctfrm_options_submit['cntctfrm_thank_text'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_thank_text'][ $key ] ) );
560 $cntctfrm_options_submit['cntctfrm_submit_label'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_submit_label'][ $key ] ) );
561 $cntctfrm_options_submit['cntctfrm_name_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_name_error'][ $key ] ) );
562 $cntctfrm_options_submit['cntctfrm_address_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_address_error'][ $key ] ) );
563 $cntctfrm_options_submit['cntctfrm_email_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_email_error'][ $key ] ) );
564 $cntctfrm_options_submit['cntctfrm_phone_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_phone_error'][ $key ] ) );
565 $cntctfrm_options_submit['cntctfrm_subject_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_subject_error'][ $key ] ) );
566 $cntctfrm_options_submit['cntctfrm_message_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_message_error'][ $key ] ) );
567 $cntctfrm_options_submit['cntctfrm_attachment_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_attachment_error'][ $key ] ) );
568 $cntctfrm_options_submit['cntctfrm_attachment_upload_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_attachment_upload_error'][ $key ] ) );
569 $cntctfrm_options_submit['cntctfrm_attachment_move_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_attachment_move_error'][ $key ] ) );
570 $cntctfrm_options_submit['cntctfrm_attachment_size_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_attachment_size_error'][ $key ] ) );
571 $cntctfrm_options_submit['cntctfrm_captcha_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_captcha_error'][ $key ] ) );
572 $cntctfrm_options_submit['cntctfrm_form_error'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_form_error'][ $key ] ) );
573 }
574 } else {
575 if ( empty( $cntctfrm_options['cntctfrm_language'] ) ) {
576 $cntctfrm_options_submit['cntctfrm_name_label'] = $cntctfrm_option_defaults['cntctfrm_name_label'];
577 $cntctfrm_options_submit['cntctfrm_address_label'] = $cntctfrm_option_defaults['cntctfrm_address_label'];
578 $cntctfrm_options_submit['cntctfrm_email_label'] = $cntctfrm_option_defaults['cntctfrm_email_label'];
579 $cntctfrm_options_submit['cntctfrm_phone_label'] = $cntctfrm_option_defaults['cntctfrm_phone_label'];
580 $cntctfrm_options_submit['cntctfrm_subject_label'] = $cntctfrm_option_defaults['cntctfrm_subject_label'];
581 $cntctfrm_options_submit['cntctfrm_message_label'] = $cntctfrm_option_defaults['cntctfrm_message_label'];
582 $cntctfrm_options_submit['cntctfrm_attachment_label'] = $cntctfrm_option_defaults['cntctfrm_attachment_label'];
583 $cntctfrm_options_submit['cntctfrm_attachment_tooltip'] = $cntctfrm_option_defaults['cntctfrm_attachment_tooltip'];
584 $cntctfrm_options_submit['cntctfrm_send_copy_label'] = $cntctfrm_option_defaults['cntctfrm_send_copy_label'];
585 $cntctfrm_options_submit['cntctfrm_thank_text'] = $_POST['cntctfrm_thank_text'];
586 $cntctfrm_options_submit['cntctfrm_submit_label'] = $cntctfrm_option_defaults['cntctfrm_submit_label'];
587 $cntctfrm_options_submit['cntctfrm_name_error'] = $cntctfrm_option_defaults['cntctfrm_name_error'];
588 $cntctfrm_options_submit['cntctfrm_address_error'] = $cntctfrm_option_defaults['cntctfrm_address_error'];
589 $cntctfrm_options_submit['cntctfrm_email_error'] = $cntctfrm_option_defaults['cntctfrm_email_error'];
590 $cntctfrm_options_submit['cntctfrm_phone_error'] = $cntctfrm_option_defaults['cntctfrm_phone_error'];
591 $cntctfrm_options_submit['cntctfrm_subject_error'] = $cntctfrm_option_defaults['cntctfrm_subject_error'];
592 $cntctfrm_options_submit['cntctfrm_message_error'] = $cntctfrm_option_defaults['cntctfrm_message_error'];
593 $cntctfrm_options_submit['cntctfrm_attachment_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_error'];
594 $cntctfrm_options_submit['cntctfrm_attachment_upload_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_upload_error'];
595 $cntctfrm_options_submit['cntctfrm_attachment_move_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_move_error'];
596 $cntctfrm_options_submit['cntctfrm_attachment_size_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_size_error'];
597 $cntctfrm_options_submit['cntctfrm_captcha_error'] = $cntctfrm_option_defaults['cntctfrm_captcha_error'];
598 $cntctfrm_options_submit['cntctfrm_form_error'] = $cntctfrm_option_defaults['cntctfrm_form_error'];
599 foreach ( $cntctfrm_options_submit['cntctfrm_thank_text'] as $key => $val ) {
600 $cntctfrm_options_submit['cntctfrm_thank_text'][ $key ] = stripcslashes( htmlspecialchars( $val ) );
601 }
602 } else {
603 $cntctfrm_options_submit['cntctfrm_name_label']['en'] = $cntctfrm_option_defaults['cntctfrm_name_label']['en'];
604 $cntctfrm_options_submit['cntctfrm_address_label']['en'] = $cntctfrm_option_defaults['cntctfrm_address_label']['en'];
605 $cntctfrm_options_submit['cntctfrm_email_label']['en'] = $cntctfrm_option_defaults['cntctfrm_email_label']['en'];
606 $cntctfrm_options_submit['cntctfrm_phone_label']['en'] = $cntctfrm_option_defaults['cntctfrm_phone_label']['en'];
607 $cntctfrm_options_submit['cntctfrm_subject_label']['en'] = $cntctfrm_option_defaults['cntctfrm_subject_label']['en'];
608 $cntctfrm_options_submit['cntctfrm_message_label']['en'] = $cntctfrm_option_defaults['cntctfrm_message_label']['en'];
609 $cntctfrm_options_submit['cntctfrm_attachment_label']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_label']['en'];
610 $cntctfrm_options_submit['cntctfrm_attachment_tooltip']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_tooltip']['en'];
611 $cntctfrm_options_submit['cntctfrm_send_copy_label']['en'] = $cntctfrm_option_defaults['cntctfrm_send_copy_label']['en'];
612 $cntctfrm_options_submit['cntctfrm_submit_label']['en'] = $cntctfrm_option_defaults['cntctfrm_submit_label']['en'];
613 $cntctfrm_options_submit['cntctfrm_name_error']['en'] = $cntctfrm_option_defaults['cntctfrm_name_error']['en'];
614 $cntctfrm_options_submit['cntctfrm_address_error']['en'] = $cntctfrm_option_defaults['cntctfrm_address_error']['en'];
615 $cntctfrm_options_submit['cntctfrm_email_error']['en'] = $cntctfrm_option_defaults['cntctfrm_email_error']['en'];
616 $cntctfrm_options_submit['cntctfrm_phone_error']['en'] = $cntctfrm_option_defaults['cntctfrm_phone_error']['en'];
617 $cntctfrm_options_submit['cntctfrm_subject_error']['en'] = $cntctfrm_option_defaults['cntctfrm_subject_error']['en'];
618 $cntctfrm_options_submit['cntctfrm_message_error']['en'] = $cntctfrm_option_defaults['cntctfrm_message_error']['en'];
619 $cntctfrm_options_submit['cntctfrm_attachment_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_error']['en'];
620 $cntctfrm_options_submit['cntctfrm_attachment_upload_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_upload_error']['en'];
621 $cntctfrm_options_submit['cntctfrm_attachment_move_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_move_error']['en'];
622 $cntctfrm_options_submit['cntctfrm_attachment_size_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_size_error']['en'];
623 $cntctfrm_options_submit['cntctfrm_captcha_error']['en'] = $cntctfrm_option_defaults['cntctfrm_captcha_error']['en'];
624 $cntctfrm_options_submit['cntctfrm_form_error']['en'] = $cntctfrm_option_defaults['cntctfrm_form_error']['en'];
625
626 foreach ( $_POST['cntctfrm_thank_text'] as $key => $val ) {
627 $cntctfrm_options_submit['cntctfrm_thank_text'][ $key ] = stripcslashes( htmlspecialchars( $_POST['cntctfrm_thank_text'][ $key ] ) );
628 }
629 }
630 }
631 $cntctfrm_options_submit['cntctfrm_action_after_send'] = $_POST['cntctfrm_action_after_send'];
632 $cntctfrm_options_submit['cntctfrm_redirect_url'] = $_POST['cntctfrm_redirect_url'];
633 }
634 $cntctfrm_options = array_merge( $cntctfrm_options, $cntctfrm_options_submit );
635
636 if ( 0 == $cntctfrm_options_submit['cntctfrm_action_after_send']
637 && ( "" == trim( $cntctfrm_options_submit['cntctfrm_redirect_url'] )
638 || ! preg_match( '@^(?:http://)?([^/]+)@i', trim( $cntctfrm_options_submit['cntctfrm_redirect_url'] ) ) ) ) {
639 $error .=__( "If the 'Redirect to page' option is selected then the URL field should be in the following format", 'contact_form' )." <code>http://your_site/your_page</code>";
640 $cntctfrm_options['cntctfrm_action_after_send'] = 1;
641 }
642 if ( 'user' == $cntctfrm_options_submit['cntctfrm_select_email'] ) {
643 if ( '3.3' > $wp_version && function_exists( 'get_userdatabylogin' ) && false !== get_userdatabylogin( $cntctfrm_options_submit['cntctfrm_user_email'] ) ) {
644 //
645 } else if ( false !== get_user_by( 'login', $cntctfrm_options_submit['cntctfrm_user_email'] ) ) {
646 //
647 } else {
648 $error .= __( "Such user does not exist. Settings are not saved.", 'contact_form' );
649 }
650 } else {
651 if ( "" == $cntctfrm_options_submit['cntctfrm_custom_email'] || ! preg_match( "/^((?:[a-z0-9_']+(?:[a-z0-9\-_\.']+)?@[a-z0-9]+(?:[a-z0-9\-\.]+)?\.[a-z]{2,5})[, ]*)+$/i", trim( $cntctfrm_options_submit['cntctfrm_custom_email'] ) ) ){
652 $error .= __( "Please enter a valid email address in the 'FROM' field. Settings are not saved.", 'contact_form' );
653 }
654 }
655 if ( 'custom' == $cntctfrm_options_submit['cntctfrm_from_email'] ) {
656 if ( "" == $cntctfrm_options_submit['cntctfrm_custom_from_email']
657 && ! preg_match( "/^((?:[a-z0-9_']+(?:[a-z0-9\-_\.']+)?@[a-z0-9]+(?:[a-z0-9\-\.]+)?\.[a-z]{2,5})[, ]*)+$/i", trim( $cntctfrm_options_submit['cntctfrm_custom_from_email'] ) ) ) {
658 $error .= __( "Please enter a valid email address in the 'FROM' field. Settings are not saved.", 'contact_form' );
659 }
660 }
661
662 if ( '' == $error ) {
663 if ( isset( $contact_form_multi_active ) ) {
664
665 $cntctfrmmlt_options_main = get_option( 'cntctfrmmlt_options_main' );
666
667 if ( $cntctfrmmlt_options_main['id_form'] !== $_SESSION['cntctfrmmlt_id_form'] )
668 add_option( 'cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'] , $cntctfrm_options, '', 'yes' );
669 else if ( $cntctfrmmlt_options_main['id_form'] == $_SESSION['cntctfrmmlt_id_form'] )
670 update_option( 'cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'] , $cntctfrm_options, '', 'yes' );
671
672 } elseif ( isset( $contact_form_multi_pro_active ) ) {
673 $cntctfrmmltpr_options_main = get_option( 'cntctfrmmltpr_options_main' );
674
675 if ( $cntctfrmmltpr_options_main['id_form'] !== $_SESSION['cntctfrmmlt_id_form'] )
676 add_option( 'cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'] , $cntctfrm_options, '', 'yes' );
677 else if ( $cntctfrmmltpr_options_main['id_form'] == $_SESSION['cntctfrmmlt_id_form'] )
678 update_option( 'cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'] , $cntctfrm_options, '', 'yes' );
679
680 } else {
681 update_option( 'cntctfrm_options', $cntctfrm_options, '', 'yes' );
682 }
683 $message = __( "Settings saved.", 'contact_form' );
684 }
685 }
686
687 /* Display form on the setting page */
688 $lang_codes = array(
689 'aa' => 'Afar', 'ab' => 'Abkhazian', 'af' => 'Afrikaans', 'ak' => 'Akan', 'sq' => 'Albanian', 'am' => 'Amharic', 'ar' => 'Arabic', 'an' => 'Aragonese', 'hy' => 'Armenian', 'as' => 'Assamese', 'av' => 'Avaric', 'ae' => 'Avestan', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'ba' => 'Bashkir', 'bm' => 'Bambara', 'eu' => 'Basque', 'be' => 'Belarusian', 'bn' => 'Bengali',
690 'bh' => 'Bihari', 'bi' => 'Bislama', 'bs' => 'Bosnian', 'br' => 'Breton', 'bg' => 'Bulgarian', 'my' => 'Burmese', 'ca' => 'Catalan; Valencian', 'ch' => 'Chamorro', 'ce' => 'Chechen', 'zh' => 'Chinese', 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic', 'cv' => 'Chuvash', 'kw' => 'Cornish', 'co' => 'Corsican', 'cr' => 'Cree',
691 'cs' => 'Czech', 'da' => 'Danish', 'dv' => 'Divehi; Dhivehi; Maldivian', 'nl' => 'Dutch; Flemish', 'dz' => 'Dzongkha', 'eo' => 'Esperanto', 'et' => 'Estonian', 'ee' => 'Ewe', 'fo' => 'Faroese', 'fj' => 'Fijjian', 'fi' => 'Finnish', 'fr' => 'French', 'fy' => 'Western Frisian', 'ff' => 'Fulah', 'ka' => 'Georgian', 'de' => 'German', 'gd' => 'Gaelic; Scottish Gaelic',
692 'ga' => 'Irish', 'gl' => 'Galician', 'gv' => 'Manx', 'el' => 'Greek, Modern', 'gn' => 'Guarani', 'gu' => 'Gujarati', 'ht' => 'Haitian; Haitian Creole', 'ha' => 'Hausa', 'he' => 'Hebrew', 'hz' => 'Herero', 'hi' => 'Hindi', 'ho' => 'Hiri Motu', 'hu' => 'Hungarian', 'ig' => 'Igbo', 'is' => 'Icelandic', 'io' => 'Ido', 'ii' => 'Sichuan Yi', 'iu' => 'Inuktitut', 'ie' => 'Interlingue',
693 'ia' => 'Interlingua (International Auxiliary Language Association)', 'id' => 'Indonesian', 'ik' => 'Inupiaq', 'it' => 'Italian', 'jv' => 'Javanese', 'ja' => 'Japanese', 'kl' => 'Kalaallisut; Greenlandic', 'kn' => 'Kannada', 'ks' => 'Kashmiri', 'kr' => 'Kanuri', 'kk' => 'Kazakh', 'km' => 'Central Khmer', 'ki' => 'Kikuyu; Gikuyu', 'rw' => 'Kinyarwanda', 'ky' => 'Kirghiz; Kyrgyz',
694 'kv' => 'Komi', 'kg' => 'Kongo', 'ko' => 'Korean', 'kj' => 'Kuanyama; Kwanyama', 'ku' => 'Kurdish', 'lo' => 'Lao', 'la' => 'Latin', 'lv' => 'Latvian', 'li' => 'Limburgan; Limburger; Limburgish', 'ln' => 'Lingala', 'lt' => 'Lithuanian', 'lb' => 'Luxembourgish; Letzeburgesch', 'lu' => 'Luba-Katanga', 'lg' => 'Ganda', 'mk' => 'Macedonian', 'mh' => 'Marshallese', 'ml' => 'Malayalam',
695 'mi' => 'Maori', 'mr' => 'Marathi', 'ms' => 'Malay', 'mg' => 'Malagasy', 'mt' => 'Maltese', 'mo' => 'Moldavian', 'mn' => 'Mongolian', 'na' => 'Nauru', 'nv' => 'Navajo; Navaho', 'nr' => 'Ndebele, South; South Ndebele', 'nd' => 'Ndebele, North; North Ndebele', 'ng' => 'Ndonga', 'ne' => 'Nepali', 'nn' => 'Norwegian Nynorsk; Nynorsk, Norwegian', 'nb' => 'Bokmål, Norwegian, Norwegian Bokmål',
696 'no' => 'Norwegian', 'ny' => 'Chichewa; Chewa; Nyanja', 'oc' => 'Occitan, Provençal', 'oj' => 'Ojibwa', 'or' => 'Oriya', 'om' => 'Oromo', 'os' => 'Ossetian; Ossetic', 'pa' => 'Panjabi; Punjabi', 'fa' => 'Persian', 'pi' => 'Pali', 'pl' => 'Polish', 'pt' => 'Portuguese', 'ps' => 'Pushto', 'qu' => 'Quechua', 'rm' => 'Romansh', 'ro' => 'Romanian', 'rn' => 'Rundi', 'ru' => 'Russian',
697 'sg' => 'Sango', 'sa' => 'Sanskrit', 'sr' => 'Serbian', 'hr' => 'Croatian', 'si' => 'Sinhala; Sinhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'se' => 'Northern Sami', 'sm' => 'Samoan', 'sn' => 'Shona', 'sd' => 'Sindhi', 'so' => 'Somali', 'st' => 'Sotho, Southern', 'es' => 'Spanish; Castilian', 'sc' => 'Sardinian', 'ss' => 'Swati', 'su' => 'Sundanese', 'sw' => 'Swahili',
698 'sv' => 'Swedish', 'ty' => 'Tahitian', 'ta' => 'Tamil', 'tt' => 'Tatar', 'te' => 'Telugu', 'tg' => 'Tajik', 'tl' => 'Tagalog', 'th' => 'Thai', 'bo' => 'Tibetan', 'ti' => 'Tigrinya', 'to' => 'Tonga (Tonga Islands)', 'tn' => 'Tswana', 'ts' => 'Tsonga', 'tk' => 'Turkmen', 'tr' => 'Turkish', 'tw' => 'Twi', 'ug' => 'Uighur; Uyghur', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek',
699 've' => 'Venda', 'vi' => 'Vietnamese', 'vo' => 'Volapük', 'cy' => 'Welsh','wa' => 'Walloon','wo' => 'Wolof', 'xh' => 'Xhosa', 'yi' => 'Yiddish', 'yo' => 'Yoruba', 'za' => 'Zhuang; Chuang', 'zu' => 'Zulu' );
700
701 /* GO PRO */
702 if ( isset( $_GET['action'] ) && 'go_pro' == $_GET['action'] ) {
703 global $wpmu, $bstwbsftwppdtplgns_options;
704
705 $bws_license_key = ( isset( $_POST['bws_license_key'] ) ) ? trim( $_POST['bws_license_key'] ) : "";
706
707 if ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_license_nonce_name' ) ) {
708 if ( '' != $bws_license_key ) {
709 if ( strlen( $bws_license_key ) != 18 ) {
710 $error = __( "Wrong license key", 'contact_form' );
711 } else {
712 $bws_license_plugin = trim( $_POST['bws_license_plugin'] );
713 if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] < ( time() + (24 * 60 * 60) ) ) {
714 $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] + 1;
715 } else {
716 $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = 1;
717 $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] = time();
718 }
719
720 /* download Pro */
721 if ( ! array_key_exists( $bws_license_plugin, $all_plugins ) ) {
722 $current = get_site_transient( 'update_plugins' );
723 if ( is_array( $all_plugins ) && !empty( $all_plugins ) && isset( $current ) && is_array( $current->response ) ) {
724 $to_send = array();
725 $to_send["plugins"][ $bws_license_plugin ] = array();
726 $to_send["plugins"][ $bws_license_plugin ]["bws_license_key"] = $bws_license_key;
727 $to_send["plugins"][ $bws_license_plugin ]["bws_illegal_client"] = true;
728 $options = array(
729 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3 ),
730 'body' => array( 'plugins' => serialize( $to_send ) ),
731 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) );
732 $raw_response = wp_remote_post( 'http://bestwebsoft.com/wp-content/plugins/paid-products/plugins/update-check/1.0/', $options );
733
734 if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
735 $error = __( "Something went wrong. Try again later. If the error will appear again, please, contact us <a href=http://support.bestwebsoft.com>BestWebSoft</a>. We are sorry for inconvenience.", 'contact_form' );
736 } else {
737 $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
738
739 if ( is_array( $response ) && !empty( $response ) ) {
740 foreach ( $response as $key => $value ) {
741 if ( "wrong_license_key" == $value->package ) {
742 $error = __( "Wrong license key", 'contact_form' );
743 } elseif ( "wrong_domain" == $value->package ) {
744 $error = __( "This license key is bind to another site", 'contact_form' );
745 } elseif ( "you_are_banned" == $value->package ) {
746 $error = __( "Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.", 'contact_form' );
747 }
748 }
749 if ( '' == $error ) {
750 $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
751
752 $url = 'http://bestwebsoft.com/wp-content/plugins/paid-products/plugins/downloads/?bws_first_download=' . $bws_license_plugin . '&bws_license_key=' . $bws_license_key . '&download_from=5';
753 $uploadDir = wp_upload_dir();
754 $zip_name = explode( '/', $bws_license_plugin );
755 if ( file_put_contents( $uploadDir["path"] . "/" . $zip_name[0] . ".zip", file_get_contents( $url ) ) ) {
756 @chmod( $uploadDir["path"] . "/" . $zip_name[0] . ".zip", octdec( 755 ) );
757 if ( class_exists( 'ZipArchive' ) ) {
758 $zip = new ZipArchive();
759 if ( $zip->open( $uploadDir["path"] . "/" . $zip_name[0] . ".zip" ) === TRUE ) {
760 $zip->extractTo( WP_PLUGIN_DIR );
761 $zip->close();
762 } else {
763 $error = __( "Failed to open the zip archive. Please, upload the plugin manually", 'contact_form' );
764 }
765 } elseif ( class_exists( 'Phar' ) ) {
766 $phar = new PharData( $uploadDir["path"] . "/" . $zip_name[0] . ".zip" );
767 $phar->extractTo( WP_PLUGIN_DIR );
768 } else {
769 $error = __( "Your server does not support either ZipArchive or Phar. Please, upload the plugin manually", 'contact_form' );
770 }
771 @unlink( $uploadDir["path"] . "/" . $zip_name[0] . ".zip" );
772 } else {
773 $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'contact_form' );
774 }
775
776 /* activate Pro */
777 if ( file_exists( WP_PLUGIN_DIR . '/' . $zip_name[0] ) ) {
778 array_push( $active_plugins, $bws_license_plugin );
779 update_option( 'active_plugins', $active_plugins );
780 $pro_plugin_is_activated = true;
781 } elseif ( '' == $error ) {
782 $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'contact_form' );
783 }
784 }
785 } else {
786 $error = __( "Something went wrong. Try again later or upload the plugin manually. We are sorry for inconvienience.", 'contact_form' );
787 }
788 }
789 }
790 } else {
791 /* activate Pro */
792 if ( ! ( in_array( $bws_license_plugin, $active_plugins ) || is_plugin_active_for_network( $bws_license_plugin ) ) ) {
793 array_push( $active_plugins, $bws_license_plugin );
794 update_option( 'active_plugins', $active_plugins );
795 $pro_plugin_is_activated = true;
796 }
797 }
798 update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options, '', 'yes' );
799 }
800 } else {
801 $error = __( "Please, enter Your license key", 'contact_form' );
802 }
803 }
804 } ?>
805 <div class="wrap">
806 <div class="icon32 icon32-bws" id="icon-options-general"></div>
807 <h2><?php _e( "Contact Form Settings", 'contact_form' ); ?></h2>
808 <h2 class="nav-tab-wrapper">
809 <a class="nav-tab<?php if ( ! isset( $_GET['action'] ) ) echo ' nav-tab-active'; ?>" href="admin.php?page=contact_form.php"><?php _e( 'Settings', 'contact_form' ); ?></a>
810 <a class="nav-tab<?php if ( isset( $_GET['action'] ) && 'extra' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="admin.php?page=contact_form.php&amp;action=extra"><?php _e( 'Extra settings', 'contact_form' ); ?></a>
811 <a class="nav-tab" href="http://bestwebsoft.com/plugin/contact-form/#faq" target="_blank"><?php _e( 'FAQ', 'contact_form' ); ?></a>
812 <a class="nav-tab bws_go_pro_tab<?php if ( isset( $_GET['action'] ) && 'go_pro' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="admin.php?page=contact_form.php&amp;action=go_pro"><?php _e( 'Go PRO', 'contact_form' ); ?></a>
813 </h2>
814 <div class="updated fade" <?php if ( ! isset( $_POST['cntctfrm_form_submit'] ) || "" != $error ) echo "style=\"display:none\""; ?>><p><strong><?php echo $message; ?></strong></p></div>
815 <div id="cntctfrm_settings_notice" class="updated fade" style="display:none"><p><strong><?php _e( "Notice:", 'contact_form' ); ?></strong> <?php _e( "The plugin's settings have been changed. In order to save them please don't forget to click the 'Save Changes' button.", 'contact_form' ); ?></p></div>
816 <div class="error" <?php if ( "" == $error ) echo "style=\"display:none\""; ?>><p><strong><?php echo $error; ?></strong></p></div>
817 <?php if ( ! isset( $_GET['action'] ) ) {
818 if ( ! isset( $contact_form_multi_active ) && ! isset( $contact_form_multi_pro_active ) ) { ?>
819 <h2 class="nav-tab-wrapper">
820 <li class="nav-tab nav-tab-active">NEW_FORM</li>
821 <a class="nav-tab" target="_new" href="http://bestwebsoft.com/plugin/contact-form-multi/" title="<?php _e( "If you want to create multiple contact forms, please install the Contact Form Multi plugin.", 'contact_form' ); ?>">+</a>
822 </h2>
823 <?php } ?>
824 <form id="cntctfrm_settings_form" method="post" action="admin.php?page=contact_form.php">
825 <span style="margin-bottom:15px;">
826 <?php if ( ! isset( $contact_form_multi_active ) && ! isset( $contact_form_multi_pro_active ) ) { ?>
827 <p><?php _e( "If you would like to add the Contact Form to your website, just copy and paste this shortcode to your post or page or widget:", 'contact_form' ); ?> [contact_form] <?php _e( "or", 'contact_form' ); ?> [contact_form lang=en]<br />
828 <?php _e( "If have any problems with the standard shortcode [contact_form], you should use the shortcode", 'contact_form' ); ?> [bws_contact_form] (<?php _e( "or", 'contact_form' ); ?> [bws_contact_form lang=en]) <?php _e( "or", 'contact_form' ); ?> [bestwebsoft_contact_form] (<?php _e( "or", 'contact_form' ); ?>
829 [bestwebsoft_contact_form lang=en]). <?php _e( "They work the same way.", 'contact_form' ); ?></p>
830 <?php _e( "If you leave the fields empty, the messages will be sent to the email address specified during registration.", 'contact_form' );
831 } else { ?>
832 <p><?php _e( "If you would like to add the Contact Form to your website, just copy and paste this shortcode to your post or page or widget:", 'contact_form' ); ?> [contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?>] <?php _e( "or", 'contact_form' ); ?> [contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?>]<br />
833 <?php _e( "If have any problems with the standard shortcode [contact_form], you should use the shortcode", 'contact_form' ); ?> [bws_contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?>] (<?php _e( "or", 'contact_form' ); ?> [bws_contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?>]) <?php _e( "or", 'contact_form' ); ?> [bestwebsoft_contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?>] (<?php _e( "or", 'contact_form' ); ?>
834 [bestwebsoft_contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?>]). <?php _e( "They work the same way.", 'contact_form' ); ?></p>
835 <?php _e( "If you leave the fields empty, the messages will be sent to the email address specified during registration.", 'contact_form' );
836 } ?>
837 </span>
838 <table class="form-table" style="width:auto;">
839 <tr valign="top">
840 <th scope="row"><?php _e( "The user's email address:", 'contact_form' ); ?> </th>
841 <td colspan="2">
842 <input type="radio" id="cntctfrm_select_email_user" name="cntctfrm_select_email" value="user" <?php if ( $cntctfrm_options['cntctfrm_select_email'] == 'user' ) echo "checked=\"checked\" "; ?>/>
843 <select name="cntctfrm_user_email">
844 <option disabled><?php _e( "Create a username", 'contact_form' ); ?></option>
845 <?php foreach ( $userslogin as $key => $value ) {
846 if ( $value->data->user_email != '' ) { ?>
847 <option value="<?php echo $value->data->user_login; ?>" <?php if ( $cntctfrm_options['cntctfrm_user_email'] == $value->data->user_login ) echo "selected=\"selected\" "; ?>><?php echo $value->data->user_login; ?></option>
848 <?php }
849 } ?>
850 </select>
851 <span class="cntctfrm_info"><?php _e( "Enter a username of the person who should get the messages from the contact form.", 'contact_form' ); ?></span>
852 </td>
853 </tr>
854 <tr valign="top">
855 <th scope="row"><?php _e( "Use this email address:", 'contact_form' ); ?> </th>
856 <td colspan="2">
857 <input type="radio" id="cntctfrm_select_email_custom" name="cntctfrm_select_email" value="custom" <?php if ( 'custom' == $cntctfrm_options['cntctfrm_select_email'] ) echo "checked=\"checked\" "; ?>/> <input type="text" name="cntctfrm_custom_email" value="<?php echo $cntctfrm_options['cntctfrm_custom_email']; ?>" onfocus="document.getElementById('cntctfrm_select_email_custom').checked = true;" />
858 <span class="cntctfrm_info"><?php _e( "Enter the email address you want the messages forwarded to.", 'contact_form' ); ?></span>
859 </td>
860 </tr>
861 </table>
862 <div class="bws_pro_version_bloc">
863 <div class="bws_pro_version_table_bloc">
864 <div class="bws_table_bg"></div>
865 <table class="form-table bws_pro_version">
866 <tr valign="top">
867 <th scope="row"><?php _e( "Add department selectbox to the contact form:", 'contact_form' ); ?></th>
868 <td colspan="2">
869 <input type="radio" id="cntctfrmpr_select_email_department" name="cntctfrmpr_select_email" value="departments" disabled="disabled" />
870 <div class="cntctfrmpr_department_table"><img src="<?php echo plugins_url( 'images/pro_screen_1.png', __FILE__ ); ?>" alt="" /></div>
871 </td>
872 </tr>
873 <tr valign="top">
874 <th scope="row" colspan="2">
875 * <?php _e( 'If you upgrade to Pro version all your settings will be saved.', 'contact_form' ); ?>
876 </th>
877 </tr>
878 </table>
879 </div>
880 <div class="bws_pro_version_tooltip">
881 <div class="bws_info">
882 <?php _e( 'Unlock premium options by upgrading to a PRO version.', 'contact_form' ); ?>
883 <a href="http://bestwebsoft.com/plugin/contact-form-pro/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>" target="_blank" title="Contact Form Pro"><?php _e( 'Learn More', 'contact_form' ); ?></a>
884 </div>
885 <a class="bws_button" href="http://bestwebsoft.com/plugin/contact-form-pro/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>#purchase" target="_blank" title="Contact Form Pro">
886 <?php _e( 'Go', 'contact_form' ); ?> <strong>PRO</strong>
887 </a>
888 <div class="clear"></div>
889 </div>
890 </div>
891 <table class="form-table" style="width:auto;">
892 <tr valign="top">
893 <th scope="row"><?php _e( "Save emails to the database", 'contact_form' ); ?> </th>
894 <td colspan="2">
895 <?php if ( array_key_exists( 'contact-form-to-db/contact_form_to_db.php', $all_plugins ) || array_key_exists( 'contact-form-to-db-pro/contact_form_to_db_pro.php', $all_plugins ) ) {
896 if ( 0 < count( preg_grep( '/contact-form-to-db\/contact_form_to_db.php/', $active_plugins ) ) || 0 < count( preg_grep( '/contact-form-to-db-pro\/contact_form_to_db_pro.php/', $active_plugins ) ) ||
897 is_plugin_active_for_network( 'contact-form-to-db/contact_form_to_db.php' ) || is_plugin_active_for_network( 'contact-form-to-db-pro/contact_form_to_db_pro.php' ) ) { ?>
898 <input type="checkbox" name="cntctfrm_save_email_to_db" value="1" <?php if ( ( isset( $cntctfrmtdb_options ) && 1 == $cntctfrmtdb_options["cntctfrmtdb_save_messages_to_db"] ) || ( isset( $cntctfrmtdbpr_options ) && 1 == $cntctfrmtdbpr_options["save_messages_to_db"] ) ) echo "checked=\"checked\""; ?> />
899 <span style="color: #888888;font-size: 10px;"> (<?php _e( 'Using', 'contact_form' ); ?> <a href="admin.php?page=cntctfrmtdb_manager">Contact Form to DB</a> <?php _e( 'powered by', 'contact_form' ); ?> <a href="http://bestwebsoft.com/plugin/">bestwebsoft.com</a>)</span>
900 <?php } else { ?>
901 <input disabled="disabled" type="checkbox" name="cntctfrm_save_email_to_db" value="1" <?php if ( ( isset( $cntctfrmtdb_options ) && 1 == $cntctfrmtdb_options["cntctfrmtdb_save_messages_to_db"] ) || ( isset( $cntctfrmtdbpr_options ) && 1 == $cntctfrmtdbpr_options["save_messages_to_db"] ) ) echo "checked=\"checked\""; ?> />
902 <span style="color: #888888;font-size: 10px;">(<?php _e( 'Using Contact Form to DB powered by', 'contact_form' ); ?> <a href="http://bestwebsoft.com/plugin/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?>/wp-admin/plugins.php"><?php _e( 'Activate Contact Form to DB', 'contact_form' ); ?></a></span>
903 <?php }
904 } else { ?>
905 <input disabled="disabled" type="checkbox" name="cntctfrm_save_email_to_db" value="1" />
906 <span style="color: #888888;font-size: 10px;">(<?php _e( 'Using Contact Form to DB powered by', 'contact_form' ); ?> <a href="http://bestwebsoft.com/plugin/">bestwebsoft.com</a>) <a href="http://bestwebsoft.com/plugin/contact-form-to-db-pro/?k=19d806f45d866e70545de83169b274f2&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>"><?php _e( 'Download Contact Form to DB', 'contact_form' ); ?></a></span>
907 <?php } ?>
908 </td>
909 </tr>
910 <tr valign="top">
911 <th scope="row"><label><input type="checkbox" id="cntctfrm_additions_options" name="cntctfrm_additions_options" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "checked=\"checked\" "; ?> /> <?php _e( "Additional options", 'contact_form' ); ?></label></th>
912 <td colspan="2">
913 <input id="cntctfrm_show_additional_settings" type="button" class="button-small button" value="<?php _e( "Show", 'contact_form' ); ?>" style="display: none;">
914 <input id="cntctfrm_hide_additional_settings" type="button" class="button-small button" value="<?php _e( "Hide", 'contact_form' ); ?>" style="display: none;">
915 </td>
916 </tr>
917 <tr class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
918 <th scope="row"><?php _e( 'What to use?', 'contact_form' ); ?></th>
919 <td colspan="2">
920 <label><input type='radio' name='cntctfrm_mail_method' value='wp-mail' <?php if ( 'wp-mail' == $cntctfrm_options['cntctfrm_mail_method'] ) echo "checked=\"checked\" "; ?>/>
921 <?php _e( 'Wp-mail', 'contact_form' ); ?></label> <span class="cntctfrm_info">(<?php _e( 'You can use the wp_mail function for mailing', 'contact_form' ); ?>)</span><br />
922 <label><input type='radio' name='cntctfrm_mail_method' value='mail' <?php if ( 'mail' == $cntctfrm_options['cntctfrm_mail_method'] ) echo "checked=\"checked\" "; ?>/>
923 <?php _e( 'Mail', 'contact_form' ); ?> </label> <span class="cntctfrm_info">(<?php _e( 'To send mail you can use the php mail function', 'contact_form' ); ?>)</span><br />
924 </td>
925 </tr>
926 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
927 <th scope="row"><?php _e( "The text in the 'From' field", 'contact_form' ); ?></th>
928 <td colspan="2">
929 <label><input type="radio" id="cntctfrm_select_from_field" name="cntctfrm_select_from_field" value="user_name" <?php if ( 'user_name' == $cntctfrm_options['cntctfrm_select_from_field'] ) echo "checked=\"checked\" "; ?>/> <?php _e( "User name", 'contact_form' ); ?></label>
930 <span class="cntctfrm_info">(<?php _e( "The name of the user who fills the form will be used in the field 'From'.", 'contact_form' ); ?>)</span><br/>
931 <input type="radio" id="cntctfrm_select_from_custom_field" name="cntctfrm_select_from_field" value="custom" <?php if ( 'custom' == $cntctfrm_options['cntctfrm_select_from_field'] ) echo "checked=\"checked\" "; ?>/>
932 <input type="text" style="width:200px;" name="cntctfrm_from_field" value="<?php echo stripslashes( $cntctfrm_options['cntctfrm_from_field'] ); ?>" onfocus="document.getElementById('cntctfrm_select_from_custom_field').checked = true;" />
933 <span class="cntctfrm_info">(<?php _e( "This text will be used in the 'FROM' field", 'contact_form' ); ?>)</span>
934 </td>
935 </tr>
936 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
937 <th scope="row"><?php _e( "The email address in the 'From' field", 'contact_form' ); ?></th>
938 <td colspan="2">
939 <label><input type="radio" id="cntctfrm_from_email" name="cntctfrm_from_email" value="user" <?php if ( 'user' == $cntctfrm_options['cntctfrm_from_email'] ) echo "checked=\"checked\" "; ?>/> <?php _e( "User email", 'contact_form' ); ?> </label>
940 <span class="cntctfrm_info">(<?php _e( "The email address of the user who fills the form will be used in the field 'From'.", 'contact_form' ); ?>)</span><br />
941 <input type="radio" id="cntctfrm_from_custom_email" name="cntctfrm_from_email" value="custom" <?php if ( 'custom' == $cntctfrm_options['cntctfrm_from_email'] ) echo "checked=\"checked\" "; ?>/>
942 <input type="text" name="cntctfrm_custom_from_email" value="<?php echo $cntctfrm_options['cntctfrm_custom_from_email']; ?>" onfocus="document.getElementById('cntctfrm_from_custom_email').checked = true;" />
943 <span class="cntctfrm_info">(<?php _e( "This email address will be used in the 'From' field.", 'contact_form' ); ?>)</span>
944 </td>
945 </tr>
946 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
947 <th scope="row"><?php _e( "Required symbol", 'contact_form' ); ?></th>
948 <td colspan="2">
949 <input type="text" id="cntctfrm_required_symbol" name="cntctfrm_required_symbol" value="<?php echo $cntctfrm_options['cntctfrm_required_symbol']; ?>"/>
950 </td>
951 </tr>
952 </table>
953 <br />
954 <table class="cntctfrm_settings_table cntctfrm_additions_block<?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo " cntctfrm_hidden"; ?>" style="width:auto;">
955 <thead>
956 <tr valign="top">
957 <th scope="row" style="width: 210px;"><?php _e( "Fields", 'contact_form' ); ?></th>
958 <th><?php _e( "Used", 'contact_form' ); ?></th>
959 <th><?php _e( "Required", 'contact_form' ); ?></th>
960 <th><?php _e( "Visible", 'contact_form' ); ?></th>
961 <th><?php _e( "Disabled for editing", 'contact_form' ); ?></th>
962 <th scope="row" style="width:200px;"><?php _e( "Field's default value", 'contact_form' ); ?></th>
963 </tr>
964 </thead>
965 <tbody>
966 <tr valign="top">
967 <td><?php _e( "Name", 'contact_form' ); ?></td>
968 <td><input type="checkbox" name="cntctfrm_display_name_field" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_display_name_field'] ) echo "checked=\"checked\" "; ?>/></td>
969 <td><input type="checkbox" id="cntctfrm_required_name_field" name="cntctfrm_required_name_field" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_required_name_field'] ) echo "checked=\"checked\" "; ?>/></td>
970 <td></td>
971 <td></td>
972 <td></td>
973 </tr>
974 <tr valign="top">
975 <td><?php _e( "Address", 'contact_form' ); ?></td>
976 <td><input type="checkbox" id="cntctfrm_display_address_field" name="cntctfrm_display_address_field" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_display_address_field'] ) echo "checked=\"checked\" "; ?>/></td>
977 <td><input type="checkbox" id="cntctfrm_required_address_field" name="cntctfrm_required_address_field" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_required_address_field'] ) echo "checked=\"checked\" "; ?>/></td>
978 <td></td>
979 <td></td>
980 <td></td>
981 </tr>
982 <tr valign="top">
983 <td><?php _e( "Email Address", 'contact_form' ); ?></td>
984 <td></td>
985 <td><input type="checkbox" id="cntctfrm_required_email_field" name="cntctfrm_required_email_field" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_required_email_field'] ) echo "checked=\"checked\" "; ?>/></td>
986 <td></td>
987 <td></td>
988 <td></td>
989 </tr>
990 <tr valign="top">
991 <td><?php _e( "Phone number", 'contact_form' ); ?></td>
992 <td><input type="checkbox" id="cntctfrm_display_phone_field" name="cntctfrm_display_phone_field" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_display_phone_field'] ) echo "checked=\"checked\" "; ?>/></td>
993 <td><input type="checkbox" id="cntctfrm_required_phone_field" name="cntctfrm_required_phone_field" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_required_phone_field'] ) echo "checked=\"checked\" "; ?>/></td>
994 <td></td>
995 <td></td>
996 <td></td>
997 </tr>
998 <tr valign="top">
999 <td><?php _e( "Subject", 'contact_form' ); ?></td>
1000 <td></td>
1001 <td><input type="checkbox" id="cntctfrm_required_subject_field" name="cntctfrm_required_subject_field" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_required_subject_field'] ) echo "checked=\"checked\" "; ?>/></td>
1002 <td class="bws_pro_version"><input class="subject" disabled="disabled" type="checkbox" name="cntctfrmpr_visible_subject" value="1" /></td>
1003 <td class="bws_pro_version"><input class="subject" disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_subject" value="1" /></td>
1004 <td class="bws_pro_version"><input class="subject" disabled="disabled" type="text" name="cntctfrmpr_default_subject" value="" /></td>
1005 </tr>
1006 <tr valign="top">
1007 <td><?php _e( "Message", 'contact_form' ); ?></td>
1008 <td></td>
1009 <td><input type="checkbox" id="cntctfrm_required_message_field" name="cntctfrm_required_message_field" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_required_message_field'] ) echo "checked=\"checked\" "; ?>/></td>
1010 <td class="bws_pro_version"><input class="message" disabled="disabled" type="checkbox" name="cntctfrmpr_visible_message" value="1" /></td>
1011 <td class="bws_pro_version"><input class="message" disabled="disabled" disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_message" value="1" /></td>
1012 <td class="bws_pro_version"><input class="message" disabled="disabled" type="text" name="cntctfrmpr_default_message" value="" /></td>
1013 </tr>
1014 <tr valign="top">
1015 <td></td>
1016 <td></td>
1017 <td></td>
1018 <td colspan="3" class="bws_pro_version_tooltip">
1019 <div class="bws_info">
1020 <?php _e( 'Unlock premium options by upgrading to a PRO version.', 'contact_form' ); ?>
1021 <a href="http://bestwebsoft.com/plugin/contact-form-pro/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>" target="_blank" title="Contact Form Pro"><?php _e( 'Learn More', 'contact_form' ); ?></a>
1022 </div>
1023 <a class="bws_button" href="http://bestwebsoft.com/plugin/contact-form-pro/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>#purchase" target="_blank" title="Contact Form Pro">
1024 <?php _e( 'Go', 'contact_form' ); ?> <strong>PRO</strong>
1025 </a>
1026 <div class="clear"></div>
1027 </td>
1028 </tr>
1029 <tr valign="top">
1030 <td>
1031 <?php _e( "Attachment block", 'contact_form' ); ?>
1032 <div class="cntctfrm_help_box" style="margin: -3px 0 0; float:right;">
1033 <div class="cntctfrm_hidden_help_text" style="display: none;"><?php echo __( "Users can attach the following file formats", 'contact_form' ) . ": html, txt, css, gif, png, jpeg, jpg, tiff, bmp, ai, eps, ps, rtf, pdf, doc, docx, xls, zip, rar, wav, mp3, ppt, aar, sce"; ?></div>
1034 </div>
1035 </td>
1036 <td><input type="checkbox" id="cntctfrm_attachment" name="cntctfrm_attachment" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_attachment'] ) echo "checked=\"checked\" "; ?>/></td>
1037 <td></td>
1038 <td></td>
1039 <td></td>
1040 <td></td>
1041 </tr>
1042 </tbody>
1043 </table>
1044 <table class="form-table" style="width:auto;">
1045 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
1046 <th scope="row"><?php _e( "Add to the form", 'contact_form' ); ?></th>
1047 <td style="width:750px;" colspan="3">
1048 <div style="clear: both;">
1049 <label style="float: left">
1050 <input type="checkbox" id="cntctfrm_attachment_explanations" name="cntctfrm_attachment_explanations" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_attachment_explanations'] && '1' == $cntctfrm_options['cntctfrm_attachment'] ) echo "checked=\"checked\" "; ?>/>
1051 <?php _e( "Tips below the Attachment", 'contact_form' ); ?>
1052 </label>
1053 <div class="cntctfrm_help_box" style="margin: -3px 0 0 10px;">
1054 <div class="cntctfrm_hidden_help_text" style="display: none;width: auto;"><img title="" src="<?php echo plugins_url( 'images/tooltip_attachment_tips.png', __FILE__ ); ?>" alt=""/></div>
1055 </div>
1056 </div>
1057 <div style="clear: both;">
1058 <label style="float: left">
1059 <input type="checkbox" id="cntctfrm_send_copy" name="cntctfrm_send_copy" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_send_copy'] ) echo "checked=\"checked\" "; ?>/>
1060 <?php _e( "'Send me a copy' block", 'contact_form' ); ?>
1061 </label>
1062 <div class="cntctfrm_help_box" style="margin: -3px 0 0 10px;">
1063 <div class="cntctfrm_hidden_help_text" style="display: none;width: auto;"><img title="" src="<?php echo plugins_url( 'images/tooltip_sendme_block.png', __FILE__ ); ?>" alt=""/></div>
1064 </div>
1065 </div>
1066 <div style="clear: both;">
1067 <?php if ( array_key_exists( 'captcha/captcha.php', $all_plugins ) || array_key_exists( 'captcha-pro/captcha_pro.php', $all_plugins ) ) {
1068 if ( 0 < count( preg_grep( '/captcha\/captcha.php/', $active_plugins ) ) || 0 < count( preg_grep( '/captcha-pro\/captcha_pro.php/', $active_plugins ) ) ||
1069 is_plugin_active_for_network( 'captcha/captcha.php' ) || is_plugin_active_for_network( 'captcha-pro/captcha_pro.php' ) ) { ?>
1070 <label><input type="checkbox" name="cntctfrm_display_captcha" value="1" <?php if ( ( isset( $cptch_options ) && 1 == $cptch_options["cptch_contact_form"] ) || ( isset( $cptchpr_options ) && 1 == $cptchpr_options["cptchpr_contact_form"] ) ) echo "checked=\"checked\""; ?> />
1071 <?php _e( "Captcha", 'contact_form' ); ?></label> <span style="color: #888888;font-size: 10px;">(<?php _e( 'powered by', 'contact_form' ); ?> <a href="http://bestwebsoft.com/plugin/">bestwebsoft.com</a>)</span>
1072 <?php } else { ?>
1073 <label><input disabled="disabled" type="checkbox" name="cntctfrm_display_captcha" value="1" <?php if ( ( isset( $cptch_options ) && 1 == $cptch_options["cptch_contact_form"] ) || ( isset( $cptchpr_options ) && 1 == $cptchpr_options["cptchpr_contact_form"] ) ) echo "checked=\"checked\""; ?> />
1074 <?php _e( 'Captcha', 'contact_form' ); ?></label> <span style="color: #888888;font-size: 10px;">(<?php _e( 'powered by', 'contact_form' ); ?> <a href="http://bestwebsoft.com/plugin/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?>/wp-admin/plugins.php"><?php _e( 'Activate captcha', 'contact_form' ); ?></a></span>
1075 <?php }
1076 } else { ?>
1077 <label><input disabled="disabled" type="checkbox" name="cntctfrm_display_captcha" value="1" />
1078 <?php _e( 'Captcha', 'contact_form' ); ?></label> <span style="color: #888888;font-size: 10px;">(<?php _e( 'powered by', 'contact_form' ); ?> <a href="http://bestwebsoft.com/plugin/">bestwebsoft.com</a>) <a href="http://bestwebsoft.com/plugin/captcha-pro/?k=19ac1e9b23bea947cfc4a9b8e3326c03&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>"><?php _e( 'Download captcha', 'contact_form' ); ?></a></span>
1079 <?php } ?>
1080 </div>
1081 </td>
1082 </tr>
1083 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
1084 <th scope="row"></th>
1085 <td colspan="3" class="bws_pro_version">
1086 <label><input disabled="disabled" type="checkbox" value="1" name="cntctfrmpr_display_privacy_check"> <?php _e( 'Agreement checkbox', 'contact_form' ); ?></label> <span style="color: #888888;font-size: 10px;">(<?php _e( 'Required checkbox for submitting the form', 'contact_form' ); ?>)</span><br />
1087 <label><input disabled="disabled" type="checkbox" value="1" name="cntctfrmpr_display_optional_check"> <?php _e( 'Optional checkbox', 'contact_form' ); ?></label> <span style="color: #888888;font-size: 10px;">(<?php _e( 'Optional checkbox, the results of which will be displayed in email', 'contact_form' ); ?>)</span><br />
1088 </td>
1089 </tr>
1090 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
1091 <th></th>
1092 <td colspan="3" class="bws_pro_version_tooltip">
1093 <div class="bws_info">
1094 <?php _e( 'Unlock premium options by upgrading to a PRO version.', 'contact_form' ); ?>
1095 <a href="http://bestwebsoft.com/plugin/contact-form-pro/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>" target="_blank" title="Contact Form Pro"><?php _e( 'Learn More', 'contact_form' ); ?></a>
1096 </div>
1097 <a class="bws_button" href="http://bestwebsoft.com/plugin/contact-form-pro/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>#purchase" target="_blank" title="Contact Form Pro">
1098 <?php _e( 'Go', 'contact_form' ); ?> <strong>PRO</strong>
1099 </a>
1100 <div class="clear"></div>
1101 </td>
1102 </tr>
1103 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
1104 <th scope="row"><?php _e( "Delete an attachment file from the server after the email is sent", 'contact_form' ); ?> </th>
1105 <td colspan="3">
1106 <input type="checkbox" id="cntctfrm_delete_attached_file" name="cntctfrm_delete_attached_file" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_delete_attached_file'] ) echo "checked=\"checked\" "; ?>/>
1107 </td>
1108 </tr>
1109 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
1110 <th scope="row"><?php _e( "Email in HTML format sending", 'contact_form' ); ?></th>
1111 <td colspan="2"><input type="checkbox" name="cntctfrm_html_email" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_html_email'] ) echo "checked=\"checked\" "; ?>/></td>
1112 </tr>
1113 <tr valign="top" class="cntctfrm_additions_block <?php if ( $cntctfrm_options['cntctfrm_additions_options'] == '0' ) echo "cntctfrm_hidden"; ?>">
1114 <th scope="row"><?php _e( "Display additional info in the email", 'contact_form' ); ?></th>
1115 <td style="width:15px;">
1116 <input type="checkbox" id="cntctfrm_display_add_info" name="cntctfrm_display_add_info" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_display_add_info'] ) echo "checked=\"checked\" "; ?>/>
1117 </td>
1118 <td style="max-width:150px;" class="cntctfrm_display_add_info_block <?php if ( '0' == $cntctfrm_options['cntctfrm_display_add_info'] ) echo "cntctfrm_hidden"; ?>">
1119 <label><input type="checkbox" id="cntctfrm_display_sent_from" name="cntctfrm_display_sent_from" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_display_sent_from'] ) echo "checked=\"checked\" "; ?>/> <?php _e( "Sent from (ip address)", 'contact_form' ); ?></label> <span style="color: #888888;font-size: 10px;"><?php _e( "Example: Sent from (IP address): 127.0.0.1", 'contact_form' ); ?></span><br />
1120 <label><input type="checkbox" id="cntctfrm_display_date_time" name="cntctfrm_display_date_time" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_display_date_time'] ) echo "checked=\"checked\" "; ?>/> <?php _e( "Date/Time", 'contact_form' ); ?></label> <span style="color: #888888;font-size: 10px;"><?php _e( "Example: Date/Time: August 19, 2013 8:50 pm", 'contact_form' ); ?></span><br />
1121 <label><input type="checkbox" id="cntctfrm_display_coming_from" name="cntctfrm_display_coming_from" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_display_coming_from'] ) echo "checked=\"checked\" "; ?>/> <?php _e( "Sent from (referer)", 'contact_form' ); ?></label> <span style="color: #888888;font-size: 10px;"><?php _e( "Example: Sent from (referer): http://bestwebsoft.com/contacts/contact-us/", 'contact_form' ); ?></span><br />
1122 <label><input type="checkbox" id="cntctfrm_display_user_agent" name="cntctfrm_display_user_agent" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_display_user_agent'] ) echo "checked=\"checked\" "; ?>/> <?php _e( "Using (user agent)", 'contact_form' ); ?></label> <span style="color: #888888;font-size: 10px;"><?php _e( "Example: Using (user agent): Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36", 'contact_form' ); ?></span><br />
1123 </td>
1124 </tr>
1125 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
1126 <th scope="row"><?php _e( "Language settings for the field names in the form", 'contact_form' ); ?></th>
1127 <td colspan="2">
1128 <select name="cntctfrm_languages" id="cntctfrm_languages" style="width:300px;">
1129 <?php foreach ( $lang_codes as $key => $val ) {
1130 if ( in_array( $key, $cntctfrm_options['cntctfrm_language'] ) )
1131 continue;
1132 echo '<option value="' . esc_attr( $key ) . '"> ' . esc_html ( $val ) . '</option>';
1133 } ?>
1134 </select>
1135 <input type="button" class="button-primary" id="cntctfrm_add_language_button" value="<?php _e( 'Add a language', 'contact_form' ); ?>" />
1136 </td>
1137 </tr>
1138 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
1139 <th scope="row"><?php _e( "Change the names of the contact form fields and error messages", 'contact_form' ); ?></th>
1140 <td style="width:15px;">
1141 <input type="checkbox" id="cntctfrm_change_label" name="cntctfrm_change_label" value="1" <?php if ( $cntctfrm_options['cntctfrm_change_label'] == '1' ) echo "checked=\"checked\" "; ?>/>
1142 </td>
1143 <td class="cntctfrm_change_label_block <?php if ( '0' == $cntctfrm_options['cntctfrm_change_label'] ) echo "cntctfrm_hidden"; ?>">
1144 <div class="cntctfrm_label_language_tab cntctfrm_active" id="cntctfrm_label_en"><?php _e( 'English', 'contact_form' ); ?></div>
1145 <?php if ( ! empty( $cntctfrm_options['cntctfrm_language'] ) ) {
1146 foreach ( $cntctfrm_options['cntctfrm_language'] as $val ) {
1147 echo '<div class="cntctfrm_label_language_tab" id="cntctfrm_label_' . $val . '">' . $lang_codes[ $val ] . ' <span class="cntctfrm_delete" rel="' . $val . '">X</span></div>';
1148 }
1149 } ?>
1150 <div class="clear"></div>
1151 <div class="cntctfrm_language_tab cntctfrm_tab_en">
1152 <div class="cntctfrm_language_tab_block_mini" style="display:none;"><?php _e( "click to expand/hide the list", 'contact_form' ); ?></div>
1153 <div class="cntctfrm_language_tab_block">
1154 <input type="text" name="cntctfrm_name_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_name_label']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Name:", 'contact_form' ); ?></span><br />
1155 <input type="text" name="cntctfrm_address_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_address_label']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Address:", 'contact_form' ); ?></span><br />
1156 <input type="text" name="cntctfrm_email_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_email_label']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Email Address:", 'contact_form' ); ?></span><br />
1157 <input type="text" name="cntctfrm_phone_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_phone_label']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Phone number:", 'contact_form' ); ?></span><br />
1158 <input type="text" name="cntctfrm_subject_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_subject_label']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Subject:", 'contact_form' ); ?></span><br />
1159 <input type="text" name="cntctfrm_message_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_message_label']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Message:", 'contact_form' ); ?></span><br />
1160 <input type="text" name="cntctfrm_attachment_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_label']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Attachment:", 'contact_form' ); ?></span><br />
1161 <input type="text" name="cntctfrm_attachment_tooltip[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_tooltip']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Tips below the Attachment block", 'contact_form' ); ?></span><br />
1162 <input type="text" name="cntctfrm_send_copy_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_send_copy_label']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Send me a copy", 'contact_form' ); ?></span><br />
1163 <input type="text" name="cntctfrm_submit_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_submit_label']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Submit", 'contact_form' ); ?></span><br />
1164 <input type="text" name="cntctfrm_name_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_name_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Name field", 'contact_form' ); ?></span><br />
1165 <input type="text" name="cntctfrm_address_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_address_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Address field", 'contact_form' ); ?></span><br />
1166 <input type="text" name="cntctfrm_email_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_email_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Email field", 'contact_form' ); ?></span><br />
1167 <input type="text" name="cntctfrm_phone_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_phone_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Phone field", 'contact_form' ); ?></span><br />
1168 <input type="text" name="cntctfrm_subject_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_subject_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Subject field", 'contact_form' ); ?></span><br />
1169 <input type="text" name="cntctfrm_message_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_message_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Message field", 'contact_form' ); ?></span><br />
1170 <input type="text" name="cntctfrm_attachment_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message about the file type for the Attachment field", 'contact_form' ); ?></span><br />
1171 <input type="text" name="cntctfrm_attachment_upload_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_upload_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message while uploading a file for the Attachment field to the server", 'contact_form' ); ?></span><br />
1172 <input type="text" name="cntctfrm_attachment_move_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_move_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message while moving the file for the Attachment field", 'contact_form' ); ?></span><br />
1173 <input type="text" name="cntctfrm_attachment_size_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_size_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message when file size limit for the Attachment field is exceeded", 'contact_form' ); ?></span><br />
1174 <input type="text" name="cntctfrm_captcha_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_captcha_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Captcha field", 'contact_form' ); ?></span><br />
1175 <input type="text" name="cntctfrm_form_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_form_error']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the whole form", 'contact_form' ); ?></span><br />
1176 </div>
1177 <?php if ( ! isset( $contact_form_multi_active ) && ! isset( $contact_form_multi_pro_active ) ) { ?>
1178 <span class="cntctfrm_info" style="margin-left: 5px;"><?php _e( "Use shortcode", 'contact_form' ); echo " [bestwebsoft_contact_form lang=en] " . __( "or", 'contact_form' ) . " [bestwebsoft_contact_form] "; _e( "for this language", 'contact_form' ); ?></span>
1179 <?php } else { ?>
1180 <span class="cntctfrm_info" style="margin-left: 5px;"><?php _e( "Use shortcode", 'contact_form' ); echo " [bestwebsoft_contact_form lang=en id=".$_SESSION['cntctfrmmlt_id_form']."] " . __( "or", 'contact_form' ) . " [bestwebsoft_contact_form id=".$_SESSION['cntctfrmmlt_id_form']."] "; _e( "for this language", 'contact_form' ); ?></span>
1181 <?php } ?>
1182 </div>
1183 <?php if ( ! empty( $cntctfrm_options['cntctfrm_language'] ) ) {
1184 foreach ( $cntctfrm_options['cntctfrm_language'] as $val ) { ?>
1185 <div class="cntctfrm_language_tab hidden cntctfrm_tab_<?php echo $val; ?>">
1186 <div class="cntctfrm_language_tab_block_mini" style="display:none;"><?php _e( "click to expand/hide the list", 'contact_form' ); ?></div>
1187 <div class="cntctfrm_language_tab_block">
1188 <input type="text" name="cntctfrm_name_label[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_name_label'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_name_label'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Name:", 'contact_form' ); ?></span><br />
1189 <input type="text" name="cntctfrm_address_label[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_address_label'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_address_label'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Address:", 'contact_form' ); ?></span><br />
1190 <input type="text" name="cntctfrm_email_label[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_email_label'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_email_label'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Email Address:", 'contact_form' ); ?></span><br />
1191 <input type="text" name="cntctfrm_phone_label[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_phone_label'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_phone_label'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Phone number:", 'contact_form' ); ?></span><br />
1192 <input type="text" name="cntctfrm_subject_label[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_subject_label'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_subject_label'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Subject:", 'contact_form' ); ?></span><br />
1193 <input type="text" name="cntctfrm_message_label[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_message_label'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_message_label'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Message:", 'contact_form' ); ?></span><br />
1194 <input type="text" name="cntctfrm_attachment_label[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_attachment_label'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_attachment_label'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Attachment:", 'contact_form' ); ?></span><br />
1195 <input type="text" name="cntctfrm_attachment_tooltip[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_attachment_tooltip'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_attachment_tooltip'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Tips below the Attachment block", 'contact_form' ); ?></span><br />
1196 <input type="text" name="cntctfrm_send_copy_label[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_send_copy_label'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_send_copy_label'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Send me a copy", 'contact_form' ); ?></span><br />
1197 <input type="text" name="cntctfrm_submit_label[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_submit_label'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_submit_label'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Submit", 'contact_form' ); ?></span><br />
1198 <input type="text" name="cntctfrm_name_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_name_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_name_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Name field", 'contact_form' ); ?></span><br />
1199 <input type="text" name="cntctfrm_address_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_address_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_address_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Address field", 'contact_form' ); ?></span><br />
1200 <input type="text" name="cntctfrm_email_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_email_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_email_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Email field", 'contact_form' ); ?></span><br />
1201 <input type="text" name="cntctfrm_phone_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_phone_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_phone_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Phone field", 'contact_form' ); ?></span><br />
1202 <input type="text" name="cntctfrm_subject_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_subject_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_subject_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Subject field", 'contact_form' ); ?></span><br />
1203 <input type="text" name="cntctfrm_message_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_message_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_message_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Message field", 'contact_form' ); ?></span><br />
1204 <input type="text" name="cntctfrm_attachment_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_attachment_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_attachment_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message about the file type for the Attachment field", 'contact_form' ); ?></span><br />
1205 <input type="text" name="cntctfrm_attachment_upload_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_attachment_upload_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_attachment_upload_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message while uploading a file for the Attachment field to the server", 'contact_form' ); ?></span><br />
1206 <input type="text" name="cntctfrm_attachment_move_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_attachment_move_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_attachment_move_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message while moving the file for the Attachment field", 'contact_form' ); ?></span><br />
1207 <input type="text" name="cntctfrm_attachment_size_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_attachment_size_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_attachment_size_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message when file size limit for the Attachment field is exceeded", 'contact_form' ); ?></span><br />
1208 <input type="text" name="cntctfrm_captcha_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_captcha_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_captcha_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the Captcha field", 'contact_form' ); ?></span><br />
1209 <input type="text" name="cntctfrm_form_error[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_form_error'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_form_error'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Error message for the whole form", 'contact_form' ); ?></span><br />
1210 </div>
1211 <?php if ( ! isset( $contact_form_multi_active ) && ! isset( $contact_form_multi_pro_active ) ) { ?>
1212 <span class="cntctfrm_info" style="margin-left: 5px;"><?php _e( "Use shortcode", 'contact_form' ); echo " [bestwebsoft_contact_form lang=" . $val . "] "; _e( "for this language", 'contact_form' ); ?></span>
1213 <?php } else { ?>
1214 <span class="cntctfrm_info" style="margin-left: 5px;"><?php _e( "Use shortcode", 'contact_form' ); echo " [bestwebsoft_contact_form lang=" . $val . " id=" . $_SESSION['cntctfrmmlt_id_form'] . "] "; _e( "for this language", 'contact_form' ); ?></span>
1215 <?php } ?>
1216 </div>
1217 <?php }
1218 } ?>
1219 </td>
1220 </tr>
1221 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
1222 <th scope="row"><?php _e( "Action after email is sent", 'contact_form' ); ?></th>
1223 <td colspan="2" class="cntctfrm_action_after_send_block">
1224 <label><input type="radio" id="cntctfrm_action_after_send" name="cntctfrm_action_after_send" value="1" <?php if ( '1' == $cntctfrm_options['cntctfrm_action_after_send'] ) echo "checked=\"checked\" "; ?>/> <?php _e( "Display text", 'contact_form' ); ?></label><br />
1225 <div class="cntctfrm_label_language_tab cntctfrm_active" id="cntctfrm_text_en"><?php _e( 'English', 'contact_form' ); ?></div>
1226 <?php if ( ! empty( $cntctfrm_options['cntctfrm_language'] ) ) {
1227 foreach ( $cntctfrm_options['cntctfrm_language'] as $val ) {
1228 echo '<div class="cntctfrm_label_language_tab" id="cntctfrm_text_' . $val . '">' . $lang_codes[ $val ] . ' <span class="cntctfrm_delete" rel="' . $val . '">X</span></div>';
1229 }
1230 } ?>
1231 <div class="clear"></div>
1232 <div class="cntctfrm_language_tab cntctfrm_tab_en" style=" padding: 5px 10px 5px 5px;">
1233 <input type="text" name="cntctfrm_thank_text[en]" value="<?php echo $cntctfrm_options['cntctfrm_thank_text']['en']; ?>" /> <span class="cntctfrm_info"><?php _e( "Text", 'contact_form' ); ?></span><br />
1234 <?php if ( ! isset( $contact_form_multi_active ) && ! isset( $contact_form_multi_pro_active ) ) { ?>
1235 <span class="cntctfrm_info"><?php _e( "Use shortcode", 'contact_form' ); echo " [bestwebsoft_contact_form lang=en] " . __( "or", 'contact_form' ) . " [bestwebsoft_contact_form] "; _e( "for this language", 'contact_form' ); ?></span>
1236 <?php } else { ?>
1237 <span class="cntctfrm_info"><?php _e( "Use shortcode", 'contact_form' ); echo " [bestwebsoft_contact_form=en id=".$_SESSION['cntctfrmmlt_id_form']."] " . __( "or", 'contact_form' ) . " [bestwebsoft_contact_form id=".$_SESSION['cntctfrmmlt_id_form']."] "; _e( "for this language", 'contact_form' ); ?></span>
1238 <?php } ?>
1239 </div>
1240 <?php if ( ! empty( $cntctfrm_options['cntctfrm_language'] ) ) {
1241 foreach ( $cntctfrm_options['cntctfrm_language'] as $val ) { ?>
1242 <div class="cntctfrm_language_tab hidden cntctfrm_tab_<?php echo $val; ?>" style=" padding: 5px 10px 5px 5px;">
1243 <input type="text" name="cntctfrm_thank_text[<?php echo $val; ?>]" value="<?php if ( isset( $cntctfrm_options['cntctfrm_thank_text'][ $val ] ) ) echo $cntctfrm_options['cntctfrm_thank_text'][ $val ]; ?>" /> <span class="cntctfrm_info"><?php _e( "Text", 'contact_form' ); ?></span><br />
1244 <?php if ( ! isset( $contact_form_multi_active ) && ! isset( $contact_form_multi_pro_active ) ) { ?>
1245 <span class="cntctfrm_info"><?php _e( "Use shortcode", 'contact_form' ); echo " [bestwebsoft_contact_form lang=" . $val . "] "; _e( "for this language", 'contact_form' ); ?></span>
1246 <?php } else { ?>
1247 <span class="cntctfrm_info"><?php _e( "Use shortcode", 'contact_form' ); echo " [bestwebsoft_contact_form lang=" . $val . " id=".$_SESSION['cntctfrmmlt_id_form']."] "; _e( "for this language", 'contact_form' ); ?></span>
1248 <?php } ?>
1249 </div>
1250 <?php }
1251 } ?>
1252 <div id="cntctfrm_before"></div>
1253 <br />
1254 <input type="radio" id="cntctfrm_action_after_send_url" name="cntctfrm_action_after_send" value="0" <?php if ( '0' == $cntctfrm_options['cntctfrm_action_after_send'] ) echo "checked=\"checked\" "; ?>/> <?php _e( "Redirect to the page", 'contact_form' ); ?><br />
1255 <input type="text" name="cntctfrm_redirect_url" value="<?php echo $cntctfrm_options['cntctfrm_redirect_url']; ?>" onfocus="document.getElementById('cntctfrm_action_after_send_url').checked = true;" /> <span class="cntctfrm_info"><?php _e( "Url", 'contact_form' ); ?></span>
1256 </td>
1257 </tr>
1258 <tr valign="top" class="cntctfrm_additions_block <?php if ( '0' == $cntctfrm_options['cntctfrm_additions_options'] ) echo "cntctfrm_hidden"; ?>">
1259 <th scope="row"><?php _e( 'The $_SERVER variable that is used to build a URL of the form', 'contact_form' ); ?></th>
1260 <td colspan="2">
1261 <label><input type="radio" name="cntctfrm_site_name_parameter" value="HTTP_HOST" <?php if ( 'SERVER_NAME' == $cntctfrm_options['cntctfrm_site_name_parameter'] ) echo "checked=\"checked\" "; ?>/> SERVER_NAME</label><br />
1262 <label><input type="radio" name="cntctfrm_site_name_parameter" value="HTTP_HOST" <?php if ( 'HTTP_HOST' == $cntctfrm_options['cntctfrm_site_name_parameter'] ) echo "checked=\"checked\" "; ?>/> HTTP_HOST</label><br />
1263 <span class="cntctfrm_info"><?php _e( "If you are not sure whether to change this setting or not, please do not do that.", 'contact_form' ); ?></span>
1264 </td>
1265 </tr>
1266 </table>
1267 <input type="hidden" name="cntctfrm_form_submit" value="submit" />
1268 <p class="submit">
1269 <input type="submit" class="button-primary" value="<?php _e( 'Save Changes' ) ?>" />
1270 </p>
1271 <?php wp_nonce_field( plugin_basename(__FILE__), 'cntctfrm_nonce_name' ); ?>
1272 <div class="bws-plugin-reviews">
1273 <div class="bws-plugin-reviews-rate">
1274 <?php _e( 'If you enjoy our plugin, please give it 5 stars on WordPress', 'contact_form' ); ?>:
1275 <a href="http://wordpress.org/support/view/plugin-reviews/contact-form-plugin" target="_blank" title="Contact Form reviews"><?php _e( 'Rate the plugin', 'contact_form' ); ?></a>
1276 </div>
1277 <div class="bws-plugin-reviews-support">
1278 <?php _e( 'If there is something wrong about it, please contact us', 'contact_form' ); ?>:
1279 <a href="http://support.bestwebsoft.com">http://support.bestwebsoft.com</a>
1280 </div>
1281 </div>
1282 </form>
1283 <?php } elseif ( 'extra' == $_GET['action'] ) { ?>
1284 <div id="cntctfrmpr_left_table">
1285 <div class="bws_pro_version_bloc">
1286 <div class="bws_pro_version_table_bloc">
1287 <div class="bws_table_bg"></div>
1288 <table class="form-table bws_pro_version">
1289 <tr valign="top">
1290 <th scope="row"><?php _e( "Errors output", 'contact_form' ); ?></th>
1291 <td colspan="2">
1292 <select name="cntctfrmpr_error_displaying">
1293 <option value="labels"><?php _e( "Display error messages", 'contact_form' ); ?></option>
1294 <option value="input_colors"><?php _e( "Color of the input field errors.", 'contact_form' ); ?></option>
1295 <option value="both" selected="selected"><?php _e( "Display error messages & color of the input field errors", 'contact_form' ); ?></option>
1296 </select>
1297 </td>
1298 </tr>
1299 <tr valign="top">
1300 <th scope="row"><?php _e( "Add placeholder to the input blocks", 'contact_form' ); ?></th>
1301 <td colspan="2">
1302 <input disabled='disabled' type="checkbox" name="cntctfrmpr_placeholder" value="1" checked="checked"/>
1303 </td>
1304 </tr>
1305 <tr valign="top">
1306 <th scope="row"><?php _e( "Add tooltips", 'contact_form' ); ?></th>
1307 <td colspan="2">
1308 <div>
1309 <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_name" value="1" checked="checked"/>
1310 <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_name"><?php _e( "Name", 'contact_form' ); ?></label>
1311 </div>
1312 <?php if ( '1' == $cntctfrm_options['cntctfrm_display_address_field'] ) { ?>
1313 <div>
1314 <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_address" value="1" checked="checked"/>
1315 <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_address"><?php _e( "Address", 'contact_form' ); ?></label>
1316 </div>
1317 <?php } ?>
1318 <div>
1319 <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_email" value="1" checked="checked"/>
1320 <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_email"><?php _e( "Email address", 'contact_form' ); ?></label>
1321 </div>
1322 <?php if ( '1' == $cntctfrm_options['cntctfrm_display_phone_field'] ) { ?>
1323 <div>
1324 <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_phone" value="1" checked="checked"/>
1325 <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_phone"><?php _e( "Phone Number", 'contact_form' ); ?></label>
1326 </div>
1327 <?php } ?>
1328 <div>
1329 <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_subject" value="1" checked="checked"/>
1330 <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_subject"><?php _e( "Subject", 'contact_form' ); ?></label>
1331 </div>
1332 <div>
1333 <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_message" value="1" checked="checked"/>
1334 <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_message"><?php _e( "Message", 'contact_form' ); ?></label>
1335 </div>
1336 <?php if ( '1' == $cntctfrm_options['cntctfrm_attachment_explanations'] ) { ?>
1337 <div>
1338 <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_attachment" value="1" checked="checked"/>
1339 <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_attachment"><?php _e( "Attachment", 'contact_form' ); ?></label>
1340 </div>
1341 <?php } ?>
1342 <div>
1343 <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_captcha" value="1" />
1344 <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_captcha"><?php _e( "Captcha", 'contact_form' ); ?> </label><span style="color: #888888;font-size: 10px;"><?php _e( '(powered by bestwebsoft.com)', 'contact_form' ); ?></span>
1345 </div>
1346 </td>
1347 </tr>
1348 <tr valign="top">
1349 <th colspan="3" scope="row"><input disabled='disabled' type="checkbox" id="cntctfrmpr_style_options" name="cntctfrmpr_style_options" value="1" checked="checked" /> <?php _e( "Style options", 'contact_form' ); ?></th>
1350 </tr>
1351 <tr valign="top" class="cntctfrmpr_style_block <?php if ( '0' == $cntctfrm_options['style_options'] ) echo "cntctfrmpr_hidden"; ?>">
1352 <th scope="row"><?php _e( "Text color", 'contact_form' ); ?></th>
1353 <td colspan="2">
1354 <div>
1355 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1356 <input disabled='disabled' type="text" name="cntctfrmpr_label_color" value="" class="cntctfrmpr_colorPicker" />
1357 <?php _e( 'Label text color', 'contact_form' ); ?>
1358 </div>
1359 <div>
1360 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1361 <input disabled='disabled' type="text" name="cntctfrmpr_input_placeholder_color" value="" class="cntctfrmpr_colorPicker" />
1362 <?php _e( "Placeholder color", 'contact_form' ); ?>
1363 </div>
1364 </td>
1365 </tr>
1366 <tr valign="top" class="cntctfrmpr_style_block">
1367 <th scope="row"><?php _e( "Errors color", 'contact_form' ); ?></th>
1368 <td colspan="2">
1369 <div>
1370 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1371 <input disabled='disabled' type="text" name="cntctfrmpr_error_color" value="" class="cntctfrmpr_colorPicker" />
1372 <?php _e( 'Error text color', 'contact_form' ); ?>
1373 </div>
1374 <div>
1375 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1376 <input disabled='disabled' type="text" name="cntctfrmpr_error_input_color" value="" class="cntctfrmpr_colorPicker" />
1377 <?php _e( 'Background color of the input field errors', 'contact_form' ); ?>
1378 </div>
1379 <div>
1380 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1381 <input disabled='disabled' type="text" name="cntctfrmpr_error_input_border_color" value="" class="cntctfrmpr_colorPicker" />
1382 <?php _e( 'Border color of the input field errors', 'contact_form' ); ?>
1383 </div>
1384 <div>
1385 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" id="" value="<?php _e('Default', 'contact_form'); ?>" />
1386 <input disabled='disabled' type="text" name="cntctfrmpr_input_placeholder_error_color" value="" class="cntctfrmpr_colorPicker " />
1387 <?php _e( "Placeholder color of the input field errors", 'contact_form' ); ?>
1388 </div>
1389 </td>
1390 </tr>
1391 <tr valign="top" class="cntctfrmpr_style_block">
1392 <th scope="row"><?php _e( "Input fields", 'contact_form' ); ?></th>
1393 <td colspan="2">
1394 <div>
1395 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" id="" value="<?php _e('Default', 'contact_form'); ?>" />
1396 <input disabled='disabled' type="text" name="cntctfrmpr_input_background" value="" class="cntctfrmpr_colorPicker" />
1397 <?php _e( "Input fields background color", 'contact_form' ); ?>
1398 </div>
1399 <div>
1400 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1401 <input disabled='disabled' type="text" name="cntctfrmpr_input_color" value="" class="cntctfrmpr_colorPicker" />
1402 <?php _e( "Text fields color", 'contact_form' ); ?>
1403 </div>
1404 <input disabled='disabled' style="margin-left: 66px;" size="8" type="text" value="" name="cntctfrmpr_border_input_width" /> <?php _e( 'Border width in px, numbers only', 'contact_form' ); ?><br />
1405 <div>
1406 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1407 <input disabled='disabled' type="text" name="cntctfrmpr_border_input_color" value="" class="cntctfrmpr_colorPicker" />
1408 <?php _e( 'Border color', 'contact_form' ); ?>
1409 </div>
1410 </td>
1411 </tr>
1412 <tr valign="top" class="cntctfrmpr_style_block">
1413 <th scope="row"><?php _e( "Submit button", 'contact_form' ); ?></th>
1414 <td colspan="2">
1415 <input disabled='disabled' style="margin-left: 66px;" size="8" type="text" value="" name="cntctfrmpr_button_width" /> <?php _e( 'Width in px, numbers only', 'contact_form' ); ?><br />
1416 <div>
1417 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1418 <input disabled='disabled' type="text" name="cntctfrmpr_button_backgroud" value="" class="cntctfrmpr_colorPicker" />
1419 <?php _e( 'Button color', 'contact_form' ); ?>
1420 </div>
1421 <div>
1422 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1423 <input disabled='disabled' type="text" name="cntctfrmpr_button_color" value="" class="cntctfrmpr_colorPicker" />
1424 <?php _e( "Button text color", 'contact_form' ); ?>
1425 </div>
1426 <div>
1427 <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?>" />
1428 <input disabled='disabled' type="text" name="cntctfrmpr_border_button_color" value="" class="cntctfrmpr_colorPicker" />
1429 <?php _e( 'Border color', 'contact_form' ); ?>
1430 </div>
1431 </td>
1432 </tr>
1433 <tr valign="top">
1434 <th scope="row" colspan="2">
1435 * <?php _e( 'If you upgrade to Pro version all your settings will be saved.', 'contact_form' ); ?>
1436 </th>
1437 </tr>
1438 </table>
1439 </div>
1440 <div class="bws_pro_version_tooltip">
1441 <div class="bws_info">
1442 <?php _e( 'Unlock premium options by upgrading to a PRO version.', 'contact_form' ); ?>
1443 <a href="http://bestwebsoft.com/plugin/contact-form-pro/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>" target="_blank" title="Contact Form Pro"><?php _e( 'Learn More', 'contact_form' ); ?></a>
1444 </div>
1445 <a class="bws_button" href="http://bestwebsoft.com/plugin/contact-form-pro/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>#purchase" target="_blank" title="Contact Form Pro">
1446 <?php _e( 'Go', 'contact_form' ); ?> <strong>PRO</strong>
1447 </a>
1448 <div class="clear"></div>
1449 </div>
1450 </div>
1451 <input type="hidden" name="cntctfrmpr_form_submit" value="submit" />
1452 <p class="submit">
1453 <input disabled='disabled' type="button" class="button-primary" value="<?php _e('Save Changes') ?>" />
1454 </p>
1455 </div>
1456 <div id="cntctfrmpr_right_table">
1457 <h3><?php _e( "Contact Form Pro | Preview", 'contact_form' ); ?></h3>
1458 <div id="cntctfrmpr_contact_form">
1459 <div id="cntctfrmpr_show_errors_block">
1460 <input disabled="" type="checkbox" id="cntctfrmpr_show_errors" name="cntctfrmpr_show_errors" /> <?php _e( "Show with errors", 'contact_form' ); ?>
1461 </div>
1462 <div class="cntctfrmpr_error_text hidden" style="text-align: left;"><?php echo $cntctfrm_options['cntctfrm_form_error']['en']; ?></div>
1463 <div style="text-align: left; padding-top: 5px;">
1464 <label for="cntctfrmpr_contact_name"><?php echo $cntctfrm_options['cntctfrm_name_label']['en']; if ( 1 == $cntctfrm_options['cntctfrm_required_name_field'] ) echo '<span class="required"> *</span>'; ?></label>
1465 </div>
1466 <div class="cntctfrmpr_error_text hidden" style="text-align: left;"><?php echo $cntctfrm_options['cntctfrm_name_error']['en']; ?></div>
1467 <div style="text-align: left;">
1468 <input placeholder="<?php _e( "Please enter your full name...", 'contact_form' ); ?>" class="text" type="text" size="40" value="" name="cntctfrmpr_contact_name" id="cntctfrmpr_contact_name" style="text-align: left; margin: 0;" />
1469 <div class="cntctfrmpr_help_box">
1470 <div class="cntctfrmpr_hidden_help_text" style="font-size: 12px; display: none;"><?php _e( "Please enter your full name...", 'contact_form' ); ?></div>
1471 </div>
1472 </div>
1473 <?php if ( 1 == $cntctfrm_options['cntctfrm_display_address_field'] ) { ?>
1474 <div style="text-align: left;">
1475 <label for="cntctfrmpr_contact_address"><?php echo $cntctfrm_options['cntctfrm_address_label']['en']; if ( 1 == $cntctfrm_options['cntctfrm_required_address_field'] ) echo '<span class="required"> *</span>'; ?></label>
1476 </div>
1477 <?php if ( 1 == $cntctfrm_options['cntctfrm_required_address_field'] ) { ?>
1478 <div class="cntctfrmpr_error_text hidden" style="text-align: left;"><?php echo $cntctfrm_options['cntctfrm_address_error']['en']; ?></div>
1479 <?php } ?>
1480 <div style="text-align: left;">
1481 <input placeholder="<?php _e( "Please enter your address...", 'contact_form' ); ?>" class="text" type="text" size="40" value="" name="cntctfrmpr_contact_address" id="cntctfrmpr_contact_address" style="text-align: left; margin: 0;" />
1482 <div class="cntctfrmpr_help_box">
1483 <div class="cntctfrmpr_hidden_help_text" style="font-size: 12px; display: none;"><?php _e( "Please enter your address...", 'contact_form' ); ?></div>
1484 </div>
1485 </div>
1486 <?php } ?>
1487 <div style="text-align: left;">
1488 <label for="cntctfrmpr_contact_email"><?php echo $cntctfrm_options['cntctfrm_email_label']['en']; if ( 1 == $cntctfrm_options['cntctfrm_required_email_field'] ) echo '<span class="required"> *</span>'; ?></label>
1489 </div>
1490 <div class="cntctfrmpr_error_text hidden" style="text-align: left;"><?php echo $cntctfrm_options['cntctfrm_email_error']['en']; ?></div>
1491 <div style="text-align: left;">
1492 <input placeholder="<?php _e( "Please enter your email address...", 'contact_form' ); ?>" class="text" type="text" size="40" value="" name="cntctfrmpr_contact_email" id="cntctfrmpr_contact_email" style="text-align: left; margin: 0;" />
1493 <div class="cntctfrmpr_help_box">
1494 <div class="cntctfrmpr_hidden_help_text" style="font-size: 12px; display: none;"><?php _e( "Please enter your email address...", 'contact_form' ); ?></div>
1495 </div>
1496 </div>
1497 <?php if ( 1 == $cntctfrm_options['cntctfrm_display_phone_field'] ) { ?>
1498 <div style="text-align: left;">
1499 <label for="cntctfrmpr_contact_phone"><?php echo $cntctfrm_options['cntctfrm_phone_label']['en']; if ( 1 == $cntctfrm_options['cntctfrm_required_phone_field'] ) echo '<span class="required"> *</span>'; ?></label>
1500 </div>
1501 <div class="cntctfrmpr_error_text hidden" style="text-align: left;"><?php echo $cntctfrm_options['phone_error']['en']; ?></div>
1502 <div style="text-align: left;">
1503 <input placeholder="<?php _e( "Please enter your phone number...", 'contact_form' ); ?>" class="text" type="text" size="40" value="" name="cntctfrmpr_contact_phone" id="cntctfrmpr_contact_phone" style="text-align: left; margin: 0;" />
1504 <div class="cntctfrmpr_help_box">
1505 <div class="cntctfrmpr_hidden_help_text" style="font-size: 12px; display: none;"><?php _e( "Please enter your phone number...", 'contact_form' ); ?></div>
1506 </div>
1507 </div>
1508 <?php } ?>
1509 <div style="text-align: left;">
1510 <label for="cntctfrmpr_contact_subject"><?php echo $cntctfrm_options['cntctfrm_subject_label']['en']; if ( 1 == $cntctfrm_options['cntctfrm_required_subject_field'] ) echo '<span class="required"> *</span>'; ?></label>
1511 </div>
1512 <div class="cntctfrmpr_error_text hidden" style="text-align: left;"><?php echo $cntctfrm_options['cntctfrm_subject_error']['en']; ?></div>
1513 <div style="text-align: left;">
1514 <input placeholder="<?php _e( "Please enter subject...", 'contact_form' ); ?>" class="text" type="text" size="40" value="" name="cntctfrmpr_contact_subject" id="cntctfrmpr_contact_subject" style="text-align: left; margin: 0;" />
1515 <div class="cntctfrmpr_help_box">
1516 <div class="cntctfrmpr_hidden_help_text" style="font-size: 12px; display: none;"><?php _e( "Please enter subject...", 'contact_form' ); ?></div>
1517 </div>
1518 </div>
1519 <div style="text-align: left;">
1520 <label for="cntctfrmpr_contact_message"><?php echo $cntctfrm_options['cntctfrm_message_label']['en']; if ( 1 == $cntctfrm_options['cntctfrm_required_message_field'] ) echo '<span class="required"> *</span>'; ?></label>
1521 </div>
1522 <div class="cntctfrmpr_error_text hidden" style="text-align: left;"><?php echo $cntctfrm_options['cntctfrm_message_error']['en']; ?></div>
1523 <div style="text-align: left;">
1524 <textarea placeholder="<?php _e( "Please enter your message...", 'contact_form' ); ?>" rows="5" cols="30" name="cntctfrmpr_contact_message" id="cntctfrmpr_contact_message"></textarea>
1525 <div class="cntctfrmpr_help_box">
1526 <div class="cntctfrmpr_hidden_help_text" style="font-size: 12px; display: none;"><?php _e( "Please enter your message...", 'contact_form' ); ?></div>
1527 </div>
1528 </div>
1529 <?php if ( 1 == $cntctfrm_options['cntctfrm_attachment'] ) { ?>
1530 <div style="text-align: left;">
1531 <label for="cntctfrmpr_contact_attachment"><?php echo $cntctfrm_options['cntctfrm_attachment_label']['en']; ?></label>
1532 </div>
1533 <div class="cntctfrmpr_error_text hidden" style="text-align: left;"><?php echo $cntctfrm_options['cntctfrm_attachment_error']['en']; ?></div>
1534 <div style="text-align: left;">
1535 <input type="file" name="cntctfrmpr_contact_attachment" id="cntctfrmpr_contact_attachment" style="float:left;" />
1536 <?php if ( 1 == $cntctfrm_options['cntctfrm_attachment_explanations'] ) { ?>
1537 <div class="cntctfrmpr_help_box cntctfrmpr_hidden_help_text_attach"><div class="cntctfrmpr_hidden_help_text" style="font-size: 12px; display: none;"><?php echo $cntctfrm_options['cntctfrm_attachment_tooltip']['en']; ?></div></div>
1538 <?php } ?>
1539 </div>
1540 <?php } ?>
1541 <?php if ( 1 == $cntctfrm_options['cntctfrm_send_copy'] ) { ?>
1542 <div style="text-align: left;">
1543 <input type="checkbox" value="1" name="cntctfrmpr_contact_send_copy" id="cntctfrmpr_contact_send_copy" style="text-align: left; margin: 0;" />
1544 <label for="cntctfrmpr_contact_send_copy"><?php echo $cntctfrm_options['cntctfrm_send_copy_label']['en']; ?></label>
1545 </div>
1546 <?php } ?>
1547 <div style="text-align: left; padding-top: 8px;">
1548 <input type="submit" value="<?php echo $cntctfrm_options['cntctfrm_submit_label']['en']; ?>" style="cursor: pointer; margin: 0pt; text-align: center;margin-bottom:10px;" />
1549 </div>
1550 </div>
1551 <div id="cntctfrmpr_shortcode">
1552 <?php _e( "If you would like to add the Contact Form to your website, just copy and paste this shortcode to your post or page or widget:", 'contact_form' ); ?><br/>
1553 <div>
1554 <code id="cntctfrmpr_shortcode_code">
1555 [bestwebsoft_contact_form]
1556 </code>
1557 </div>
1558 </div>
1559 </div>
1560 <div class="clear"></div>
1561 <?php } elseif ( 'go_pro' == $_GET['action'] ) { ?>
1562 <?php if ( isset( $pro_plugin_is_activated ) && true === $pro_plugin_is_activated ) { ?>
1563 <script type="text/javascript">
1564 window.setTimeout( function() {
1565 window.location.href = 'admin.php?page=contact_form_pro.php';
1566 }, 5000 );
1567 </script>
1568 <p><?php _e( "Congratulations! The PRO version of the plugin is successfully download and activated.", 'contact_form' ); ?></p>
1569 <p>
1570 <?php _e( "Please, go to", 'contact_form' ); ?> <a href="admin.php?page=contact_form_pro.php"><?php _e( 'the setting page', 'contact_form' ); ?></a>
1571 (<?php _e( "You will be redirected automatically in 5 seconds.", 'contact_form' ); ?>)
1572 </p>
1573 <?php } else { ?>
1574 <form method="post" action="admin.php?page=contact_form.php&amp;action=go_pro">
1575 <p>
1576 <?php _e( 'You can download and activate', 'contact_form' ); ?>
1577 <a href="http://bestwebsoft.com/plugin/contact-form-pro/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>" target="_blank" title="Contact Form Pro">PRO</a>
1578 <?php _e( 'version of this plugin by entering Your license key.', 'contact_form' ); ?><br />
1579 <span style="color: #888888;font-size: 10px;">
1580 <?php _e( 'You can find your license key on your personal page Client area, by clicking on the link', 'contact_form' ); ?>
1581 <a href="http://bestwebsoft.com/wp-login.php">http://bestwebsoft.com/wp-login.php</a>
1582 <?php _e( '(your username is the email you specify when purchasing the product).', 'contact_form' ); ?>
1583 </span>
1584 </p>
1585 <?php if ( isset( $bstwbsftwppdtplgns_options['go_pro']['contact-form-pro/contact_form_pro.php']['count'] ) &&
1586 '5' < $bstwbsftwppdtplgns_options['go_pro']['contact-form-pro/contact_form_pro.php']['count'] &&
1587 $bstwbsftwppdtplgns_options['go_pro']['contact-form-pro/contact_form_pro.php']['time'] < ( time() + ( 24 * 60 * 60 ) ) ) { ?>
1588 <p>
1589 <input disabled="disabled" type="text" name="bws_license_key" value="<?php echo $bws_license_key; ?>" />
1590 <input disabled="disabled" type="submit" class="button-primary" value="<?php _e( 'Go!', 'contact_form' ); ?>" />
1591 </p>
1592 <p>
1593 <?php _e( "Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.", 'contact_form' ); ?>
1594 </p>
1595 <?php } else { ?>
1596 <p>
1597 <input type="text" name="bws_license_key" value="<?php echo $bws_license_key; ?>" />
1598 <input type="hidden" name="bws_license_plugin" value="contact-form-pro/contact_form_pro.php" />
1599 <input type="hidden" name="bws_license_submit" value="submit" />
1600 <input type="submit" class="button-primary" value="<?php _e( 'Go!', 'contact_form' ); ?>" />
1601 <?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_nonce_name' ); ?>
1602 </p>
1603 <?php } ?>
1604 </form>
1605 <?php }
1606 } ?>
1607 </div>
1608 <?php }
1609 }
1610
1611 /* Display contact form in front end - page or post */
1612 if ( ! function_exists( 'cntctfrm_display_form' ) ) {
1613 function cntctfrm_display_form( $atts = array( 'lang' => 'en' ) ) {
1614 global $error_message, $cntctfrm_options, $cntctfrm_result, $cntctfrmmlt_ide, $cntctfrmmlt_active_plugin, $wpmu;
1615 extract( shortcode_atts( array( 'lang' => 'en' ), $atts ) );
1616 $content = "";
1617
1618 /* Get options for the form with a definite identifier */
1619 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1620 if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) ||
1621 is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) ) {
1622
1623 $_SESSION['cntctfrmmlt_mailto'] = '';
1624 extract( shortcode_atts( array( 'id' => $cntctfrmmlt_ide ), $atts ) );
1625
1626 if ( ! isset( $atts['id'] ) ) {
1627 $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
1628 $_SESSION['cntctfrmmlt_mailto'] = $cntctfrm_options['cntctfrm_user_email'];
1629 } else {
1630 $cntctfrm_options = get_option( 'cntctfrmmlt_options_' . $atts['id'] );
1631 $_SESSION['cntctfrmmlt_mailto'] = $cntctfrm_options['cntctfrm_user_email'];
1632 }
1633 if ( ! $cntctfrm_options )
1634 $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
1635 } else {
1636 $cntctfrm_options = get_option( 'cntctfrm_options' );
1637 }
1638
1639 if ( '80' != $_SERVER["SERVER_PORT"] || ( isset( $_SERVER["HTTPS"] ) && '443' != $_SERVER["SERVER_PORT"] && strtolower( $_SERVER["HTTPS"] ) == "on" ) )
1640 $page_url = $page_url = ( isset( $_SERVER["HTTPS"] ) && strtolower( $_SERVER["HTTPS"] ) == "on" ? "https://" : "http://" ) . $_SERVER[ $cntctfrm_options['cntctfrm_site_name_parameter'] ] . ':' . $_SERVER["SERVER_PORT"] . strip_tags( $_SERVER["REQUEST_URI"] ) . '#cntctfrm_contact_form';
1641 else
1642 $page_url = ( isset( $_SERVER["HTTPS"] ) && strtolower( $_SERVER["HTTPS"] ) == "on" ? "https://" : "http://" ) . $_SERVER[ $cntctfrm_options['cntctfrm_site_name_parameter'] ] . strip_tags( $_SERVER["REQUEST_URI"] ) . '#cntctfrm_contact_form';
1643
1644 /* If contact form submited */
1645 $name = isset( $_POST['cntctfrm_contact_name'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_name'] ) ) : "";
1646 $address = isset( $_POST['cntctfrm_contact_address'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_address'] ) ) : "";
1647 $email = isset( $_POST['cntctfrm_contact_email'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_email'] ) ) : "";
1648 $subject = isset( $_POST['cntctfrm_contact_subject'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_subject'] ) ) : "";
1649 $message = isset( $_POST['cntctfrm_contact_message'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_message'] ) ) : "";
1650 $phone = isset( $_POST['cntctfrm_contact_phone'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_phone'] ) ) : "";
1651
1652 $name = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $name ) ) );
1653 $address = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $address ) ) );
1654 $email = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $email ) ) );
1655 $subject = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $subject ) ) );
1656 $message = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $message ) ) );
1657 $phone = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $phone ) ) );
1658
1659 $send_copy = isset( $_POST['cntctfrm_contact_send_copy'] ) ? $_POST['cntctfrm_contact_send_copy'] : "";
1660 /* If it is good */
1661 if ( true === $cntctfrm_result ) {
1662 $_SESSION['cntctfrm_send_mail'] = true;
1663
1664 if ( 1 == $cntctfrm_options['cntctfrm_action_after_send'] )
1665 $content .= '<div id="cntctfrm_thanks">' . $cntctfrm_options['cntctfrm_thank_text'][ $lang ] . '</div>';
1666 else
1667 $content .= "<script type='text/javascript'>window.location.href = '" . $cntctfrm_options['cntctfrm_redirect_url'] . "';</script>";
1668
1669 } elseif ( false === $cntctfrm_result ) {
1670 /* If email not be delivered */
1671 $error_message['error_form'] = __( "Sorry, email message could not be delivered.", 'contact_form' );
1672 }
1673
1674 if ( true !== $cntctfrm_result ) {
1675 $_SESSION['cntctfrm_send_mail'] = false;
1676 /* Output form */
1677 $content .= '<form method="post" id="cntctfrm_contact_form" action="' . $page_url . '" enctype="multipart/form-data">';
1678 if ( isset( $error_message['error_form'] ) ) {
1679 $content .= '<div style="text-align: left; color: red;">' . $error_message['error_form'].'</div>';
1680 }
1681
1682 if ( 1 == $cntctfrm_options['cntctfrm_display_name_field'] ) {
1683 $content .= '<div style="text-align: left; padding-top: 5px;">
1684 <label for="cntctfrm_contact_name">' . $cntctfrm_options['cntctfrm_name_label'][ $lang ] . ( $cntctfrm_options['cntctfrm_required_name_field'] == 1 ? ' <span class="required">' . $cntctfrm_options['cntctfrm_required_symbol'] . '</span></label>' : '</label>' ) . '
1685 </div>';
1686 if ( isset( $error_message['error_name'] ) ) {
1687 $content .= '<div style="text-align: left; color: red;">' . $error_message['error_name'] . '</div>';
1688 }
1689 $content .= '<div style="text-align: left;">
1690 <input class="text" type="text" size="40" value="' . $name . '" name="cntctfrm_contact_name" id="cntctfrm_contact_name" style="text-align: left; margin: 0;" />
1691 </div>';
1692 }
1693
1694 if ( 1 == $cntctfrm_options['cntctfrm_display_address_field'] ) {
1695 $content .= '<div style="text-align: left;">
1696 <label for="cntctfrm_contact_address">' . $cntctfrm_options['cntctfrm_address_label'][ $lang ] . ( $cntctfrm_options['cntctfrm_required_address_field'] == 1 ? ' <span class="required">' . $cntctfrm_options['cntctfrm_required_symbol'] . '</span></label>' : '</label>' ) . '
1697 </div>';
1698 if ( isset( $error_message['error_address'] ) ) {
1699 $content .= '<div style="text-align: left; color: red;">' . $error_message['error_address'] . '</div>';
1700 }
1701 $content .= '<div style="text-align: left;">
1702 <input class="text" type="text" size="40" value="' . $address . '" name="cntctfrm_contact_address" id="cntctfrm_contact_address" style="text-align: left; margin: 0;" />
1703 </div>
1704 ';
1705 }
1706
1707 $content .= '<div style="text-align: left;">
1708 <label for="cntctfrm_contact_email">' . $cntctfrm_options['cntctfrm_email_label'][ $lang ] . ( $cntctfrm_options['cntctfrm_required_email_field'] == 1 ? ' <span class="required">' . $cntctfrm_options['cntctfrm_required_symbol'] . '</span></label>' : '</label>' ) . '
1709 </div>';
1710 if ( isset( $error_message['error_email'] ) ) {
1711 $content .= '<div style="text-align: left; color: red;">' . $error_message['error_email'] . '</div>';
1712 }
1713 $content .= '<div style="text-align: left;">
1714 <input class="text" type="text" size="40" value="' . $email . '" name="cntctfrm_contact_email" id="cntctfrm_contact_email" style="text-align: left; margin: 0;" />
1715 </div>
1716 ';
1717
1718 if ( 1 == $cntctfrm_options['cntctfrm_display_phone_field'] ) {
1719 $content .= '<div style="text-align: left;">
1720 <label for="cntctfrm_contact_phone">' . $cntctfrm_options['cntctfrm_phone_label'][ $lang ] . ( $cntctfrm_options['cntctfrm_required_phone_field'] == 1 ? ' <span class="required">' . $cntctfrm_options['cntctfrm_required_symbol'] . '</span></label>' : '</label>' ) . '
1721 </div>';
1722 if ( isset( $error_message['error_phone'] ) ) {
1723 $content .= '<div style="text-align: left; color: red;">' . $error_message['error_phone'] . '</div>';
1724 }
1725 $content .= '<div style="text-align: left;">
1726 <input class="text" type="text" size="40" value="' . $phone . '" name="cntctfrm_contact_phone" id="cntctfrm_contact_phone" style="text-align: left; margin: 0;" />
1727 </div>
1728 ';
1729 }
1730 $content .= '<div style="text-align: left;">
1731 <label for="cntctfrm_contact_subject">' . $cntctfrm_options['cntctfrm_subject_label'][ $lang ] . ( $cntctfrm_options['cntctfrm_required_subject_field'] == 1 ? ' <span class="required">' . $cntctfrm_options['cntctfrm_required_symbol'] . '</span></label>' : '</label>' ) . '
1732 </div>';
1733 if ( isset( $error_message['error_subject'] ) ) {
1734 $content .= '<div style="text-align: left; color: red;">' . $error_message['error_subject'] . '</div>';
1735 }
1736 $content .= '<div style="text-align: left;">
1737 <input class="text" type="text" size="40" value="' . $subject . '" name="cntctfrm_contact_subject" id="cntctfrm_contact_subject" style="text-align: left; margin: 0;" />
1738 </div>
1739
1740 <div style="text-align: left;">
1741 <label for="cntctfrm_contact_message">' . $cntctfrm_options['cntctfrm_message_label'][ $lang ] . ( $cntctfrm_options['cntctfrm_required_message_field'] == 1 ? ' <span class="required">' . $cntctfrm_options['cntctfrm_required_symbol'] . '</span></label>' : '</label>' ) . '
1742 </div>';
1743 if ( isset( $error_message['error_message'] ) ) {
1744 $content .= '<div style="text-align: left; color: red;">' . $error_message['error_message'] . '</div>';
1745 }
1746 $content .= '<div style="text-align: left;">
1747 <textarea rows="5" cols="30" name="cntctfrm_contact_message" id="cntctfrm_contact_message">' . $message . '</textarea>
1748 </div>';
1749 if ( 1 == $cntctfrm_options['cntctfrm_attachment'] ) {
1750 $content .= '<div style="text-align: left;">
1751 <label for="cntctfrm_contact_attachment">' . $cntctfrm_options['cntctfrm_attachment_label'][ $lang ] . '</label>
1752 </div>';
1753 if ( isset( $error_message['error_attachment'] ) ) {
1754 $content .= '<div style="text-align: left; color: red;">' . $error_message['error_attachment'] . '</div>';
1755 }
1756 $content .= '<div style="text-align: left;">
1757 <input type="file" name="cntctfrm_contact_attachment" id="cntctfrm_contact_attachment"' . ( isset( $error_message['error_attachment'] ) ? "class='error'": "" ) . ' />';
1758 if ( 1 == $cntctfrm_options['cntctfrm_attachment_explanations'] ) {
1759 $content .= '<label style="font-size:10px;"><br />' . $cntctfrm_options['cntctfrm_attachment_tooltip'][ $lang ] . '</label>';
1760 }
1761 $content .= '
1762 </div>';
1763 }
1764 if ( 1 == $cntctfrm_options['cntctfrm_send_copy'] ) {
1765 $content .= '<div style="text-align: left;">
1766 <input type="checkbox" value="1" name="cntctfrm_contact_send_copy" id="cntctfrm_contact_send_copy" style="text-align: left; margin: 0;" ' . ( $send_copy == '1' ? " checked=\"checked\" " : "" ) . ' />
1767 <label for="cntctfrm_contact_send_copy">' . $cntctfrm_options['cntctfrm_send_copy_label'][ $lang ] . '</label>
1768 </div>';
1769 }
1770
1771 if ( has_filter( 'cntctfrm_display_captcha' ) ) {
1772 $content .= apply_filters( 'cntctfrm_display_captcha' , $error_message );
1773 }
1774
1775 $content .= '<div style="text-align: left; padding-top: 8px;">';
1776 if ( isset( $atts['id'] ) )
1777 $content .= '<input type="hidden" value="' . $atts['id'] . '" name="cntctfrmmlt_shortcode_id">';
1778 $content .= '<input type="hidden" value="send" name="cntctfrm_contact_action"><input type="hidden" value="Version: 3.30" />
1779 <input type="hidden" value="' . $lang . '" name="cntctfrm_language">
1780 <input type="submit" value="'. $cntctfrm_options['cntctfrm_submit_label'][ $lang ] . '" style="cursor: pointer; margin: 0pt; text-align: center;margin-bottom:10px;" />
1781 </div>
1782 </form>';
1783 }
1784 return $content ;
1785 }
1786 }
1787
1788 if ( ! function_exists( 'cntctfrm_check_and_send' ) ) {
1789 function cntctfrm_check_and_send() {
1790 global $cntctfrm_result, $cntctfrm_options;
1791 if ( isset( $_POST['cntctfrm_contact_action'] ) || true === $cntctfrm_result ) {
1792 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1793 if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) ||
1794 is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) ) {
1795
1796 if ( ! isset( $_POST['cntctfrmmlt_shortcode_id'] ) )
1797 $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
1798 else
1799 $cntctfrm_options = get_option( 'cntctfrmmlt_options_' . $_POST['cntctfrmmlt_shortcode_id'] );
1800
1801 } else {
1802 $cntctfrm_options = get_option( 'cntctfrm_options' );
1803 }
1804
1805 if ( isset( $_POST['cntctfrm_contact_action'] ) ) {
1806 /* Check all input data */
1807 $cntctfrm_result = cntctfrm_check_form();
1808 }
1809 /* If it is good */
1810 if ( true === $cntctfrm_result ) {
1811 $_SESSION['cntctfrm_send_mail'] = true;
1812 if ( 0 == $cntctfrm_options['cntctfrm_action_after_send'] ) {
1813 wp_redirect( $cntctfrm_options['cntctfrm_redirect_url'] );
1814 exit;
1815 }
1816 }
1817 }
1818 }
1819 }
1820
1821 /* Check all input data */
1822 if ( ! function_exists( 'cntctfrm_check_form' ) ) {
1823 function cntctfrm_check_form() {
1824 global $error_message, $cntctfrm_options;
1825 $language = isset( $_POST['cntctfrm_language'] ) ? $_POST['cntctfrm_language'] : 'en';
1826 $path_of_uploaded_file = $cntctfrm_result = "";
1827 /* Error messages array */
1828 $error_message = array();
1829
1830 $name = isset( $_POST['cntctfrm_contact_name'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_name'] ) ) : "";
1831 $address = isset( $_POST['cntctfrm_contact_address'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_address'] ) ) : "";
1832 $email = isset( $_POST['cntctfrm_contact_email'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_email'] ) ) : "";
1833 $subject = isset( $_POST['cntctfrm_contact_subject'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_subject'] ) ) : "";
1834 $message = isset( $_POST['cntctfrm_contact_message'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_message'] ) ) : "";
1835 $phone = isset( $_POST['cntctfrm_contact_phone'] ) ? htmlspecialchars( stripslashes( $_POST['cntctfrm_contact_phone'] ) ) : "";
1836
1837 $name = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $name ) ) );
1838 $address = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $address ) ) );
1839 $email = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $email ) ) );
1840 $subject = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $subject ) ) );
1841 $message = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $message ) ) );
1842 $phone = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $phone ) ) );
1843
1844 if ( 1 == $cntctfrm_options['cntctfrm_required_name_field'] && 1 == $cntctfrm_options['cntctfrm_display_name_field'] )
1845 $error_message['error_name'] = $cntctfrm_options['cntctfrm_name_error'][ $language ];
1846 if ( 1 == $cntctfrm_options['cntctfrm_required_address_field'] && 1 == $cntctfrm_options['cntctfrm_display_address_field'] )
1847 $error_message['error_address'] = $cntctfrm_options['cntctfrm_address_error'][ $language ];
1848 if ( 1 == $cntctfrm_options['cntctfrm_required_email_field'] )
1849 $error_message['error_email'] = $cntctfrm_options['cntctfrm_email_error'][ $language ];
1850 if ( 1 == $cntctfrm_options['cntctfrm_required_subject_field'] )
1851 $error_message['error_subject'] = $cntctfrm_options['cntctfrm_subject_error'][ $language ];
1852 if ( 1 == $cntctfrm_options['cntctfrm_required_message_field'] )
1853 $error_message['error_message'] = $cntctfrm_options['cntctfrm_message_error'][ $language ];
1854 if ( 1 == $cntctfrm_options['cntctfrm_required_phone_field'] && 1 == $cntctfrm_options['cntctfrm_display_phone_field'] )
1855 $error_message['error_phone'] = $cntctfrm_options['cntctfrm_phone_error'][ $language ];
1856 $error_message['error_form'] = $cntctfrm_options['cntctfrm_form_error'][ $language ];
1857 if ( 1 == $cntctfrm_options['cntctfrm_attachment'] ) {
1858 global $path_of_uploaded_file, $mime_type;
1859 $mime_type= array(
1860 'html'=>'text/html',
1861 'htm'=>'text/html',
1862 'txt'=>'text/plain',
1863 'css'=>'text/css',
1864 'gif'=>'image/gif',
1865 'png'=>'image/x-png',
1866 'jpeg'=>'image/jpeg',
1867 'jpg'=>'image/jpeg',
1868 'JPG'=>'image/jpeg',
1869 'jpe'=>'image/jpeg',
1870 'TIFF'=>'image/tiff',
1871 'tiff'=>'image/tiff',
1872 'tif'=>'image/tiff',
1873 'TIF'=>'image/tiff',
1874 'bmp'=>'image/x-ms-bmp',
1875 'BMP'=>'image/x-ms-bmp',
1876 'ai'=>'application/postscript',
1877 'eps'=>'application/postscript',
1878 'ps'=>'application/postscript',
1879 'rtf'=>'application/rtf',
1880 'pdf'=>'application/pdf',
1881 'doc'=>'application/msword',
1882 'docx'=>'application/msword',
1883 'xls'=>'application/vnd.ms-excel',
1884 'xlsx'=>'application/vnd.ms-excel',
1885 'zip'=>'application/zip',
1886 'rar'=>'application/rar',
1887 'wav'=>'audio/wav',
1888 'mp3'=>'audio/mp3',
1889 'ppt'=>'application/vnd.ms-powerpoint',
1890 'aar'=>'application/sb-replay',
1891 'sce'=>'application/sb-scenario' );
1892 $error_message['error_attachment'] = $cntctfrm_options['cntctfrm_attachment_error'][ $language ];
1893 }
1894 /* Check information wich was input in fields */
1895 if ( 1 == $cntctfrm_options['cntctfrm_display_name_field'] && 1 == $cntctfrm_options['cntctfrm_required_name_field'] && "" != $name )
1896 unset( $error_message['error_name'] );
1897 if ( 1 == $cntctfrm_options['cntctfrm_display_address_field'] && 1 == $cntctfrm_options['cntctfrm_required_address_field'] && "" != $address )
1898 unset( $error_message['error_address'] );
1899 if ( 1 == $cntctfrm_options['cntctfrm_required_email_field'] && "" != $email && preg_match( "/^(?:[a-z0-9_']+(?:[a-z0-9\-_\.']+)?@[a-z0-9]+(?:[a-z0-9\-\.]+)?\.[a-z]{2,5})$/i", trim( stripslashes( $email ) ) ) )
1900 unset( $error_message['error_email'] );
1901 if ( 1 == $cntctfrm_options['cntctfrm_display_phone_field'] && 1 == $cntctfrm_options['cntctfrm_required_phone_field'] && "" != $phone )
1902 unset( $error_message['error_phone'] );
1903 if ( 1 == $cntctfrm_options['cntctfrm_required_subject_field'] && "" != $subject )
1904 unset( $error_message['error_subject'] );
1905 if ( 1 == $cntctfrm_options['cntctfrm_required_message_field'] && "" != $message )
1906 unset( $error_message['error_message'] );
1907 /* If captcha plugin exists */
1908 if ( ! apply_filters( 'cntctfrm_check_form', $_POST ) )
1909 $error_message['error_captcha'] = $cntctfrm_options['cntctfrm_captcha_error'][ $language ];
1910 if ( isset( $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) && "" != $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) {
1911 if( is_multisite() ){
1912 if ( defined('UPLOADS') ) {
1913 if( ! is_dir( ABSPATH . UPLOADS ) ) {
1914 wp_mkdir_p( ABSPATH . UPLOADS );
1915 }
1916 $path_of_uploaded_file = ABSPATH . UPLOADS . $_FILES["cntctfrm_contact_attachment"]["name"];
1917 } else if ( defined( 'BLOGUPLOADDIR' ) ) {
1918 if ( ! is_dir( BLOGUPLOADDIR ) ) {
1919 wp_mkdir_p( BLOGUPLOADDIR );
1920 }
1921 $path_of_uploaded_file = BLOGUPLOADDIR . $_FILES["cntctfrm_contact_attachment"]["name"];
1922 } else {
1923 $uploads = wp_upload_dir();
1924 if ( ! isset( $uploads['path'] ) && isset ( $uploads['error'] ) )
1925 $error_message['error_attachment'] = $uploads['error'];
1926 else
1927 $path_of_uploaded_file = $uploads['path'] . "/" . $_FILES["cntctfrm_contact_attachment"]["name"];
1928 }
1929 } else {
1930 $uploads = wp_upload_dir();
1931 if ( ! isset( $uploads['path'] ) && isset ( $uploads['error'] ) )
1932 $error_message['error_attachment'] = $uploads['error'];
1933 else
1934 $path_of_uploaded_file = $uploads['path'] . "/" . $_FILES["cntctfrm_contact_attachment"]["name"];
1935 }
1936 $tmp_path = $_FILES["cntctfrm_contact_attachment"]["tmp_name"];
1937 $path_info = pathinfo( $path_of_uploaded_file );
1938
1939 if ( array_key_exists ( $path_info['extension'], $mime_type ) ) {
1940 if ( is_uploaded_file( $tmp_path ) ) {
1941 if ( move_uploaded_file( $tmp_path, $path_of_uploaded_file ) ) {
1942 do_action( 'cntctfrm_get_attachment_data', $path_of_uploaded_file );
1943 unset( $error_message['error_attachment'] );
1944 } else {
1945 $letter_upload_max_size = substr( ini_get('upload_max_filesize'), -1);
1946 // $upload_max_size = substr( ini_get('upload_max_filesize'), 0, -1 );
1947 $upload_max_size = '1';
1948 switch( strtoupper( $letter_upload_max_size ) ) {
1949 case 'P':
1950 $upload_max_size *= 1024;
1951 case 'T':
1952 $upload_max_size *= 1024;
1953 case 'G':
1954 $upload_max_size *= 1024;
1955 case 'M':
1956 $upload_max_size *= 1024;
1957 case 'K':
1958 $upload_max_size *= 1024;
1959 break;
1960 }
1961 if ( isset( $upload_max_size ) && isset( $_FILES["cntctfrm_contact_attachment"]["size"] ) &&
1962 $_FILES["cntctfrm_contact_attachment"]["size"] <= $upload_max_size ) {
1963 $error_message['error_attachment'] = $cntctfrm_options['cntctfrm_attachment_move_error'][ $language ];
1964 } else {
1965 $error_message['error_attachment'] = $cntctfrm_options['cntctfrm_attachment_size_error'][ $language ];
1966 }
1967 }
1968 } else {
1969 $error_message['error_attachment'] = $cntctfrm_options['cntctfrm_attachment_upload_error'][ $language ];
1970 }
1971 }
1972 } else {
1973 unset( $error_message['error_attachment'] );
1974 }
1975 if ( 1 == count( $error_message ) ) {
1976 unset( $error_message['error_form'] );
1977 /* If all is good - send mail */
1978 $cntctfrm_result = cntctfrm_send_mail();
1979 do_action( 'cntctfrm_check_dispatch', $cntctfrm_result );
1980 }
1981 return $cntctfrm_result;
1982 }
1983 }
1984
1985 /* Send mail function */
1986 if( ! function_exists( 'cntctfrm_send_mail' ) ) {
1987 function cntctfrm_send_mail() {
1988 global $cntctfrm_options, $path_of_uploaded_file, $wp_version, $wpdb, $cntctfrmmlt_maito, $wpdb;
1989 $to = $headers = "";
1990
1991 $name = isset( $_POST['cntctfrm_contact_name'] ) ? $_POST['cntctfrm_contact_name'] : "";
1992 $address = isset( $_POST['cntctfrm_contact_address'] ) ? $_POST['cntctfrm_contact_address'] : "";
1993 $email = isset( $_POST['cntctfrm_contact_email'] ) ? stripslashes( $_POST['cntctfrm_contact_email'] ) : "";
1994 $subject = isset( $_POST['cntctfrm_contact_subject'] ) ? $_POST['cntctfrm_contact_subject'] : "";
1995 $message = isset( $_POST['cntctfrm_contact_message'] ) ? $_POST['cntctfrm_contact_message'] : "";
1996 $phone = isset( $_POST['cntctfrm_contact_phone'] ) ? $_POST['cntctfrm_contact_phone'] : "";
1997 $user_agent = cntctfrm_clean_input( $_SERVER['HTTP_USER_AGENT'] );
1998
1999 $name = stripslashes( strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $name ) ) ) );
2000 $address = stripslashes( strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $address ) ) ) );
2001 $email = stripslashes( strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $email ) ) ) );
2002 $subject = stripslashes( strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $subject ) ) ) );
2003 $message = stripslashes( strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $message ) ) ) );
2004 $phone = stripslashes( strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', $phone ) ) ) );
2005
2006 if ( isset( $_SESSION['cntctfrm_send_mail'] ) && true == $_SESSION['cntctfrm_send_mail'] )
2007 return true;
2008
2009 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2010 if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) ||
2011 is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) ) {
2012 $cntctfrmmlt_maito = $_SESSION['cntctfrmmlt_mailto'];
2013 $to = $wpdb->get_col( "SELECT `user_email` FROM " . $wpdb->prefix . "users WHERE `user_login` = '$cntctfrmmlt_maito'" );
2014 } else {
2015 if ( 'user' == $cntctfrm_options['cntctfrm_select_email'] ) {
2016 if ( '3.3' > $wp_version && function_exists('get_userdatabylogin') && false !== $user = get_userdatabylogin( $cntctfrm_options['cntctfrm_user_email'] ) ) {
2017 $to = $user->user_email;
2018 } elseif ( false !== $user = get_user_by( 'login', $cntctfrm_options['cntctfrm_user_email'] ) )
2019 $to = $user->user_email;
2020 } else {
2021 $to = $cntctfrm_options['cntctfrm_custom_email'];
2022 }
2023 }
2024
2025 if ( "" == $to ) {
2026 /* If email options are not certain choose admin email */
2027 $to = get_option("admin_email");
2028 }
2029 if ( "" != $to ) {
2030 $user_info_string = '';
2031 $userdomain = '';
2032 $form_action_url = '';
2033 $attachments = array();
2034
2035 if ( 'on' == strtolower( getenv('HTTPS') ) ) {
2036 $form_action_url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
2037 } else {
2038 $form_action_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
2039 }
2040
2041 if ( 1 == $cntctfrm_options['cntctfrm_display_add_info']) {
2042 $userdomain = @gethostbyaddr($_SERVER['REMOTE_ADDR']);
2043 if ( 1 == $cntctfrm_options['cntctfrm_display_add_info'] ||
2044 1 == $cntctfrm_options['cntctfrm_display_sent_from'] ||
2045 1 == $cntctfrm_options['cntctfrm_display_coming_from'] ||
2046 1 == $cntctfrm_options['cntctfrm_display_user_agent'] ) {
2047 if ( 1 == $cntctfrm_options['cntctfrm_html_email'] )
2048 $user_info_string .= '<tr><td><br /></td><td><br /></td></tr>';
2049 }
2050 if ( 1 == $cntctfrm_options['cntctfrm_display_sent_from'] ) {
2051 if ( 1 == $cntctfrm_options['cntctfrm_html_email'] )
2052 $user_info_string .= '<tr><td>' . __('Sent from (ip address)', 'contact_form') . ':</td><td>' . $_SERVER['REMOTE_ADDR'] . " ( " . $userdomain . " )" . '</td></tr>';
2053 else
2054 $user_info_string .= __('Sent from (ip address)', 'contact_form') . ': ' . $_SERVER['REMOTE_ADDR'] . " ( " . $userdomain . " )" . "\n";
2055 }
2056 if ( 1 == $cntctfrm_options['cntctfrm_display_date_time'] ) {
2057 if ( 1 == $cntctfrm_options['cntctfrm_html_email'] )
2058 $user_info_string .= '<tr><td>' . __('Date/Time', 'contact_form') . ':</td><td>' . date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), strtotime( current_time( 'mysql' ) ) ) . '</td></tr>';
2059 else
2060 $user_info_string .= __('Date/Time', 'contact_form') . ': ' . date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), strtotime( current_time( 'mysql' ) ) ) . "\n";
2061 }
2062 if ( 1 == $cntctfrm_options['cntctfrm_display_coming_from'] ) {
2063 if ( 1 == $cntctfrm_options['cntctfrm_html_email'] )
2064 $user_info_string .= '<tr><td>' . __( 'Sent from (referer)', 'contact_form' ) . ':</td><td>' . $form_action_url . '</td></tr>';
2065 else
2066 $user_info_string .= __( 'Sent from (referer)', 'contact_form' ) . ': ' . $form_action_url . "\n";
2067 }
2068 if ( 1 == $cntctfrm_options['cntctfrm_display_user_agent'] ) {
2069 if ( 1 == $cntctfrm_options['cntctfrm_html_email'] )
2070 $user_info_string .= '<tr><td>' . __( 'Using (user agent)', 'contact_form' ) . ':</td><td>' . $user_agent . '</td></tr>';
2071 else
2072 $user_info_string .= __( 'Using (user agent)', 'contact_form' ) . ': ' . $user_agent . "\n";
2073 }
2074 }
2075 /* Message */
2076 if ( 1 == $cntctfrm_options['cntctfrm_html_email'] ) {
2077 $message_text = '<html>
2078 <head>
2079 <title>' . __( "Contact from", 'contact_form' ) . get_bloginfo('name') . '</title>
2080 </head>
2081 <body>
2082 <table>';
2083 if ( 1 == $cntctfrm_options['cntctfrm_display_name_field'] )
2084 $message_text .= '<tr>
2085 <td width="160">' . __( "Name", 'contact_form' ) . '</td><td>' . $name . '</td>
2086 </tr>';
2087 if ( 1 == $cntctfrm_options['cntctfrm_display_address_field'] )
2088 $message_text .= '<tr>
2089 <td>' . __( "Address", 'contact_form' ) . '</td><td>' . $address . '</td>
2090 </tr>';
2091 $message_text .= '<tr>
2092 <td>'. __( "Email", 'contact_form' ) .'</td><td>' . $email . '</td>
2093 </tr>';
2094 if ( 1 == $cntctfrm_options['cntctfrm_display_phone_field'] )
2095 $message_text .= '<tr>
2096 <td>'. __( "Phone", 'contact_form' ) . '</td><td>' . $phone . '</td>
2097 </tr>';
2098 $message_text .= '<tr>
2099 <td>' . __( "Subject", 'contact_form' ) . '</td><td>' . $subject . '</td>
2100 </tr>
2101 <tr>
2102 <td>' . __( "Message", 'contact_form' ) . '</td><td>' . $message . '</td>
2103 </tr>
2104 <tr>
2105 <td>' . __( "Site", 'contact_form' ) . '</td><td>' . get_bloginfo("url") . '</td>
2106 </tr>
2107 <tr>
2108 <td><br /></td><td><br /></td>
2109 </tr>';
2110 $message_text_for_user = $message_text . '</table></body></html>';
2111 $message_text .= $user_info_string . '</table></body></html>';
2112 } else {
2113 $message_text = '';
2114 if ( 1 == $cntctfrm_options['cntctfrm_display_name_field'] )
2115 $message_text .= __( "Name", 'contact_form' ) . ': ' . $name . "\n";
2116 if ( 1 == $cntctfrm_options['cntctfrm_display_address_field'] )
2117 $message_text .= __( "Address", 'contact_form' ) . ': ' . $address . "\n";
2118 $message_text .= __( "Email", 'contact_form' ) .': ' . $email . "\n";
2119 if ( 1 == $cntctfrm_options['cntctfrm_display_phone_field'] )
2120 $message_text .= __( "Phone", 'contact_form' ) . ': ' . $phone . "\n";
2121 $message_text .= __( "Subject", 'contact_form' ) . ': ' . $subject . "\n" .
2122 __( "Message", 'contact_form' ) . ': ' . $message . "\n" .
2123 __( "Site", 'contact_form' ) . ': ' . get_bloginfo("url") . "\n"
2124 . "\n";
2125 $message_text_for_user = $message_text;
2126 $message_text .= $user_info_string;
2127 }
2128
2129 do_action( 'cntctfrm_get_mail_data', $to, $name, $email, $address, $phone, $subject, $message, $form_action_url, $user_agent, $userdomain );
2130
2131 if ( 'wp-mail' == $cntctfrm_options['cntctfrm_mail_method'] ) {
2132 /* To send HTML mail, the Content-type header must be set */
2133 if ( 1 == $cntctfrm_options['cntctfrm_html_email'] )
2134 $headers .= 'Content-type: text/html; charset=utf-8' . "\n";
2135 else
2136 $headers .= 'Content-type: text/plain; charset=utf-8' . "\n";
2137
2138 /* Additional headers */
2139 if ( 'custom' == $cntctfrm_options['cntctfrm_from_email'] )
2140 $headers .= 'From: ' . stripslashes( $cntctfrm_options['cntctfrm_custom_from_email'] ) . '';
2141 else
2142 $headers .= 'From: ' . $email . '';
2143
2144 if ( 1 == $cntctfrm_options['cntctfrm_attachment'] && isset( $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) && "" != $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) {
2145 $attachments = array( $path_of_uploaded_file );
2146 }
2147
2148 if ( isset( $_POST['cntctfrm_contact_send_copy'] ) && 1 == $_POST['cntctfrm_contact_send_copy'] )
2149 wp_mail( $email, $subject, $message_text_for_user, $headers, $attachments );
2150
2151 /* Mail it */
2152 $mail_result = wp_mail( $to, $subject, $message_text, $headers, $attachments );
2153 /* Delete attachment */
2154 if ( 1 == $cntctfrm_options['cntctfrm_attachment'] && isset( $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) && "" != $_FILES["cntctfrm_contact_attachment"]["tmp_name"] && '1' == $cntctfrm_options['cntctfrm_delete_attached_file'] ) {
2155 @unlink( $path_of_uploaded_file );
2156 }
2157 return $mail_result;
2158 } else {
2159 // Set headers
2160 $headers .= 'MIME-Version: 1.0' . "\n";
2161
2162 if ( 1 == $cntctfrm_options['cntctfrm_attachment'] && isset( $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) && "" != $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) {
2163 global $path_of_uploaded_file;
2164 $message_block = $message_text;
2165
2166 if ( 'custom' == $cntctfrm_options['cntctfrm_select_from_field'] )
2167 $from_field_name = stripslashes( $cntctfrm_options['cntctfrm_from_field'] );
2168 else
2169 $from_field_name = $name;
2170
2171 /* Additional headers */
2172 if ( 'custom' == $cntctfrm_options['cntctfrm_from_email'] )
2173 $headers .= 'From: ' . $from_field_name . ' <' . stripslashes( $cntctfrm_options['cntctfrm_custom_from_email'] ) . '>' . "\n";
2174 else
2175 $headers .= 'From: ' . $from_field_name . ' <' . stripslashes( $email ) . '>' . "\n";
2176
2177
2178 $bound_text = "jimmyP123";
2179
2180 $bound = "--" . $bound_text . "";
2181
2182 $bound_last = "--" . $bound_text . "--";
2183
2184 $headers .= "Content-Type: multipart/mixed; boundary=\"$bound_text\"";
2185
2186 $message_text = __( "If you can see this MIME, it means that the MIME type is not supported by your email client!", "contact_form" ) . "\n";
2187
2188 if ( 1 == $cntctfrm_options['cntctfrm_html_email'] )
2189 $message_text .= $bound . "\n" . "Content-Type: text/html; charset=\"utf-8\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message_block . "\n\n";
2190 else
2191 $message_text .= $bound . "\n" . "Content-Type: text/plain; charset=\"utf-8\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message_block . "\n\n";
2192
2193
2194 $file = file_get_contents($path_of_uploaded_file);
2195 $message_text .= $bound . "\n";
2196
2197 $message_text .= "Content-Type: application/octet-stream; name=\"" . basename($path_of_uploaded_file) . "\"\n" .
2198 "Content-Description: " . basename($path_of_uploaded_file)."\n" .
2199 "Content-Disposition: attachment;\n" . " filename=\"" . basename($path_of_uploaded_file)."\"; size=" . filesize($path_of_uploaded_file) . ";\n" .
2200 "Content-Transfer-Encoding: base64\n\n" . chunk_split( base64_encode( $file ) ) . "\n\n";
2201 $message_text .= $bound_last;
2202 } else {
2203 /* To send HTML mail, header must be set */
2204 if ( 1 == $cntctfrm_options['cntctfrm_html_email'] )
2205 $headers .= 'Content-type: text/html; charset=utf-8' . "\n";
2206 else
2207 $headers .= 'Content-type: text/plain; charset=utf-8' . "\n";
2208
2209 if ( 'custom' == $cntctfrm_options['cntctfrm_select_from_field'] )
2210 $from_field_name = stripslashes( $cntctfrm_options['cntctfrm_from_field'] );
2211 else
2212 $from_field_name = $name;
2213
2214 /* Additional headers */
2215 if ( 'custom' == $cntctfrm_options['cntctfrm_from_email'] )
2216 $headers .= 'From: ' . $from_field_name . ' <' . stripslashes( $cntctfrm_options['cntctfrm_custom_from_email'] ) . '>' . "\n";
2217 else
2218 $headers .= 'From: ' . $from_field_name . ' <' . $email . '>' . "\n";
2219 }
2220 if ( isset( $_POST['cntctfrm_contact_send_copy'] ) && 1 == $_POST['cntctfrm_contact_send_copy'] )
2221 @mail( $email, $subject, $message_text_for_user, $headers );
2222
2223 $mail_result = @mail( $to, $subject , $message_text, $headers );
2224 /* Delete attachment */
2225 if ( 1 == $cntctfrm_options['cntctfrm_attachment'] && isset( $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) && "" != $_FILES["cntctfrm_contact_attachment"]["tmp_name"] && '1' == $cntctfrm_options['cntctfrm_delete_attached_file'] ) {
2226 @unlink( $path_of_uploaded_file );
2227 }
2228 return $mail_result;
2229 }
2230 }
2231 return false;
2232 }
2233 }
2234
2235 if ( ! function_exists ( 'cntctfrm_plugin_action_links' ) ) {
2236 function cntctfrm_plugin_action_links( $links, $file ) {
2237 /* Static so we don't call plugin_basename on every plugin row. */
2238 static $this_plugin;
2239 if ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);
2240
2241 if ( $file == $this_plugin ){
2242 $settings_link = '<a href="admin.php?page=contact_form.php">' . __( 'Settings', 'contact_form' ) . '</a>';
2243 array_unshift( $links, $settings_link );
2244 }
2245 return $links;
2246 }
2247 }
2248 /* End function cntctfrm_plugin_action_links */
2249
2250 if ( ! function_exists ( 'cntctfrm_register_plugin_links' ) ) {
2251 function cntctfrm_register_plugin_links( $links, $file ) {
2252 $base = plugin_basename(__FILE__);
2253 if ( $file == $base ) {
2254 $links[] = '<a href="admin.php?page=contact_form.php">' . __( 'Settings','contact_form' ) . '</a>';
2255 $links[] = '<a href="http://wordpress.org/plugins/contact-form-plugin/faq/" target="_blank">' . __( 'FAQ','contact_form' ) . '</a>';
2256 $links[] = '<a href="http://support.bestwebsoft.com">' . __( 'Support','contact_form' ) . '</a>';
2257 }
2258 return $links;
2259 }
2260 }
2261
2262 if ( ! function_exists ( 'cntctfrm_clean_input' ) ) {
2263 function cntctfrm_clean_input( $string, $preserve_space = 0 ) {
2264 if ( is_string( $string ) ) {
2265 if ( $preserve_space ) {
2266 return cntctfrm_sanitize_string( strip_tags( stripslashes( $string ) ), $preserve_space );
2267 }
2268 return trim( cntctfrm_sanitize_string( strip_tags( stripslashes( $string ) ) ) );
2269 } else if ( is_array( $string ) ) {
2270 reset( $string );
2271 while ( list($key, $value ) = each( $string ) ) {
2272 $string[ $key ] = cntctfrm_clean_input($value,$preserve_space);
2273 }
2274 return $string;
2275 } else {
2276 return $string;
2277 }
2278 }
2279 }
2280 /* End function ctf_clean_input */
2281
2282 /* Functions for protecting and validating form vars */
2283 if ( ! function_exists ( 'cntctfrm_sanitize_string' ) ) {
2284 function cntctfrm_sanitize_string( $string, $preserve_space = 0 ) {
2285 if ( ! $preserve_space )
2286 $string = preg_replace("/ +/", ' ', trim( $string ) );
2287
2288 return preg_replace( "/[<>]/", '_', $string );
2289 }
2290 }
2291
2292 if ( ! function_exists ( 'cntctfrm_admin_head' ) ) {
2293 function cntctfrm_admin_head() {
2294 if ( isset( $_REQUEST['page'] ) && ( 'contact_form.php' == $_REQUEST['page'] ) ) {
2295 global $wp_version;
2296
2297 wp_enqueue_style( 'cntctfrm_stylesheet', plugins_url( 'css/style.css', __FILE__ ) );
2298
2299 if ( 3.5 > $wp_version )
2300 wp_enqueue_script( 'cntctfrm_script', plugins_url( 'js/script_wp_before_3.5.js', __FILE__ ) );
2301 else
2302 wp_enqueue_script( 'cntctfrm_script', plugins_url( 'js/script.js', __FILE__ ) );
2303
2304 echo '<script type="text/javascript">var confirm_text = "' . __( 'Are you sure that you want to delete this language data?', 'contact_form' ) . '"</script>';
2305 }
2306 }
2307 }
2308
2309 if ( ! function_exists ( 'cntctfrm_wp_head' ) ) {
2310 function cntctfrm_wp_head() {
2311 wp_enqueue_style( 'cntctfrm_stylesheet', plugins_url( 'css/style.css', __FILE__ ) );
2312 }
2313 }
2314
2315 if ( ! function_exists ( 'cntctfrm_email_name_filter' ) ) {
2316 function cntctfrm_email_name_filter( $data ) {
2317 global $cntctfrm_options;
2318 if ( isset( $_POST['cntctfrm_contact_name'] ) && 'custom' != $cntctfrm_options['cntctfrm_select_from_field'] ) {
2319 $name = stripslashes( strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', trim( $_POST['cntctfrm_contact_name'] ) ) ) ) );
2320 if ( '' != $name )
2321 return $name;
2322 else
2323 return $data;
2324
2325 } elseif ( isset( $cntctfrm_options['cntctfrm_from_field'] ) && "" != trim( $cntctfrm_options['cntctfrm_from_field'] ) )
2326 return stripslashes( $cntctfrm_options['cntctfrm_from_field'] );
2327 else
2328 return $data;
2329 }
2330 }
2331
2332 if ( ! function_exists ( 'cntctfrm_add_language' ) ) {
2333 function cntctfrm_add_language() {
2334 $lang = strip_tags( preg_replace ( '/<[^>]*>/', '', preg_replace ( '/<script.*<\/[^>]*>/', '', htmlspecialchars( $_REQUEST['lang'] ) ) ) );
2335
2336 /* Check contact-form-multi plugin */
2337 if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) )
2338 $contact_form_multi_active = true;
2339 if ( is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) )
2340 $contact_form_multi_pro_active = true;
2341
2342 if ( isset( $contact_form_multi_active ) || isset( $contact_form_multi_pro_active ) ) {
2343 $cntctfrm_options = get_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] );
2344 } else {
2345 $cntctfrm_options = get_option( 'cntctfrm_options' );
2346 }
2347
2348 $cntctfrm_options['cntctfrm_language'][] = $lang;
2349
2350 if ( isset ( $contact_form_multi_active ) ) {
2351 $cntctfrmmlt_options_main = get_option( 'cntctfrmmlt_options_main' );
2352 update_option( 'cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'], $cntctfrm_options, '', 'yes' );
2353 } elseif ( isset( $contact_form_multi_pro_active ) ) {
2354 $cntctfrmmltpr_options_main = get_option( 'cntctfrmmltpr_options_main' );
2355 update_option( 'cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'], $cntctfrm_options, '', 'yes' );
2356 } else {
2357 update_option( 'cntctfrm_options', $cntctfrm_options, '', 'yes' );
2358 }
2359 die();
2360 }
2361 }
2362
2363 if ( ! function_exists ( 'cntctfrm_remove_language' ) ) {
2364 function cntctfrm_remove_language() {
2365 /* Check contact-form-multi plugin */
2366 if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) )
2367 $contact_form_multi_active = true;
2368 if ( is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) )
2369 $contact_form_multi_pro_active = true;
2370
2371 if ( isset( $contact_form_multi_active ) || isset( $contact_form_multi_pro_active ) ) {
2372 $cntctfrm_options = get_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] );
2373 } else {
2374 $cntctfrm_options = get_option( 'cntctfrm_options' );
2375 }
2376
2377 if ( $key = array_search( $_REQUEST['lang'], $cntctfrm_options['cntctfrm_language'] ) !== false )
2378 $cntctfrm_options['cntctfrm_language'] = array_diff( $cntctfrm_options['cntctfrm_language'], array( $_REQUEST['lang'] ) );
2379 if ( isset( $cntctfrm_options['cntctfrm_name_label'][ $_REQUEST['lang'] ] ) )
2380 unset( $cntctfrm_options['cntctfrm_name_label'][ $_REQUEST['lang'] ] );
2381 if ( isset( $cntctfrm_options['cntctfrm_address_label'][ $_REQUEST['lang'] ] ) )
2382 unset( $cntctfrm_options['cntctfrm_address_label'][ $_REQUEST['lang'] ] );
2383 if ( isset( $cntctfrm_options['cntctfrm_email_label'][ $_REQUEST['lang'] ] ) )
2384 unset( $cntctfrm_options['cntctfrm_email_label'][ $_REQUEST['lang'] ] );
2385 if ( isset( $cntctfrm_options['cntctfrm_phone_label'][ $_REQUEST['lang'] ] ) )
2386 unset( $cntctfrm_options['cntctfrm_phone_label'][ $_REQUEST['lang'] ] );
2387 if ( isset( $cntctfrm_options['cntctfrm_subject_label'][ $_REQUEST['lang'] ] ) )
2388 unset( $cntctfrm_options['cntctfrm_subject_label'][ $_REQUEST['lang'] ] );
2389 if ( isset( $cntctfrm_options['cntctfrm_message_label'][ $_REQUEST['lang'] ] ) )
2390 unset( $cntctfrm_options['cntctfrm_message_label'][ $_REQUEST['lang'] ] );
2391 if ( isset( $cntctfrm_options['cntctfrm_attachment_label'][ $_REQUEST['lang'] ] ) )
2392 unset( $cntctfrm_options['cntctfrm_attachment_label'][ $_REQUEST['lang'] ] );
2393 if ( isset( $cntctfrm_options['cntctfrm_attachment_tooltip'][ $_REQUEST['lang'] ] ) )
2394 unset( $cntctfrm_options['cntctfrm_attachment_tooltip'][ $_REQUEST['lang'] ] );
2395 if ( isset( $cntctfrm_options['cntctfrm_send_copy_label'][ $_REQUEST['lang'] ] ) )
2396 unset( $cntctfrm_options['cntctfrm_send_copy_label'][ $_REQUEST['lang'] ] );
2397 if ( isset( $cntctfrm_options['cntctfrm_thank_text'][ $_REQUEST['lang'] ] ) )
2398 unset( $cntctfrm_options['cntctfrm_thank_text'][ $_REQUEST['lang'] ] );
2399 if ( isset( $cntctfrm_options['cntctfrm_submit_label'][ $_REQUEST['lang'] ] ) )
2400 unset( $cntctfrm_options['cntctfrm_submit_label'][ $_REQUEST['lang'] ]);
2401 if ( isset( $cntctfrm_options['cntctfrm_name_error'][ $_REQUEST['lang'] ] ) )
2402 unset( $cntctfrm_options['cntctfrm_name_error'][ $_REQUEST['lang'] ] );
2403 if ( isset( $cntctfrm_options['cntctfrm_address_error'][ $_REQUEST['lang'] ] ) )
2404 unset( $cntctfrm_options['cntctfrm_address_error'][ $_REQUEST['lang'] ] );
2405 if ( isset( $cntctfrm_options['cntctfrm_email_error'][ $_REQUEST['lang'] ] ) )
2406 unset( $cntctfrm_options['cntctfrm_email_error'][ $_REQUEST['lang'] ] );
2407 if ( isset( $cntctfrm_options['cntctfrm_phone_error'][ $_REQUEST['lang'] ] ) )
2408 unset( $cntctfrm_options['cntctfrm_phone_error'][ $_REQUEST['lang'] ] );
2409 if ( isset( $cntctfrm_options['cntctfrm_subject_error'][ $_REQUEST['lang'] ] ) )
2410 unset( $cntctfrm_options['cntctfrm_subject_error'][ $_REQUEST['lang'] ] );
2411 if ( isset( $cntctfrm_options['cntctfrm_message_error'][ $_REQUEST['lang'] ] ) )
2412 unset( $cntctfrm_options['cntctfrm_message_error'][ $_REQUEST['lang'] ] );
2413 if ( isset( $cntctfrm_options['cntctfrm_attachment_error'][ $_REQUEST['lang'] ] ) )
2414 unset( $cntctfrm_options['cntctfrm_attachment_error'][ $_REQUEST['lang'] ] );
2415 if ( isset( $cntctfrm_options['cntctfrm_attachment_upload_error'][ $_REQUEST['lang'] ] ) )
2416 unset( $cntctfrm_options['cntctfrm_attachment_upload_error'][ $_REQUEST['lang'] ] );
2417 if ( isset( $cntctfrm_options['cntctfrm_attachment_move_error'][ $_REQUEST['lang'] ] ) )
2418 unset( $cntctfrm_options['cntctfrm_attachment_move_error'][ $_REQUEST['lang'] ] );
2419 if ( isset( $cntctfrm_options['cntctfrm_attachment_size_error'][ $_REQUEST['lang'] ] ) )
2420 unset( $cntctfrm_options['cntctfrm_attachment_size_error'][ $_REQUEST['lang'] ] );
2421 if ( isset( $cntctfrm_options['cntctfrm_captcha_error'][ $_REQUEST['lang'] ] ) )
2422 unset( $cntctfrm_options['cntctfrm_captcha_error'][ $_REQUEST['lang'] ] );
2423 if ( isset( $cntctfrm_options['cntctfrm_form_error'][ $_REQUEST['lang'] ] ) )
2424 unset( $cntctfrm_options['cntctfrm_form_error'][ $_REQUEST['lang'] ] );
2425
2426 if ( isset( $contact_form_multi_active ) ) {
2427 $cntctfrmmlt_options_main = get_option( 'cntctfrmmlt_options_main' );
2428 update_option( 'cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'], $cntctfrm_options, '', 'yes' );
2429 } elseif ( isset( $contact_form_multi_pro_active ) ) {
2430 $cntctfrmmltpr_options_main = get_option( 'cntctfrmmltpr_options_main' );
2431 update_option( 'cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'], $cntctfrm_options, '', 'yes' );
2432 } else {
2433 update_option( 'cntctfrm_options', $cntctfrm_options, '', 'yes' );
2434 }
2435 die();
2436 }
2437 }
2438
2439 if ( ! function_exists ( 'cntctfrm_plugin_banner' ) ) {
2440 function cntctfrm_plugin_banner() {
2441 global $hook_suffix;
2442 if ( 'plugins.php' == $hook_suffix ) {
2443 global $cntctfrm_plugin_info;
2444 $banner_array = array(
2445 array( 'sndr_hide_banner_on_plugin_page', 'sender/sender.php', '0.5' ),
2446 array( 'srrl_hide_banner_on_plugin_page', 'user-role/user-role.php', '1.4' ),
2447 array( 'pdtr_hide_banner_on_plugin_page', 'updater/updater.php', '1.12' ),
2448 array( 'cntctfrmtdb_hide_banner_on_plugin_page', 'contact-form-to-db/contact_form_to_db.php', '1.2' ),
2449 array( 'cntctfrmmlt_hide_banner_on_plugin_page', 'contact-form-multi/contact-form-multi.php', '1.0.7' ),
2450 array( 'gglmps_hide_banner_on_plugin_page', 'bws-google-maps/bws-google-maps.php', '1.2' ),
2451 array( 'fcbkbttn_hide_banner_on_plugin_page', 'facebook-button-plugin/facebook-button-plugin.php', '2.29' ),
2452 array( 'twttr_hide_banner_on_plugin_page', 'twitter-plugin/twitter.php', '2.34' ),
2453 array( 'pdfprnt_hide_banner_on_plugin_page', 'pdf-print/pdf-print.php', '1.7.1' ),
2454 array( 'gglplsn_hide_banner_on_plugin_page', 'google-one/google-plus-one.php', '1.1.4' ),
2455 array( 'gglstmp_hide_banner_on_plugin_page', 'google-sitemap-plugin/google-sitemap-plugin.php', '2.8.4' ),
2456 array( 'cntctfrmpr_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-pro/contact_form_pro.php', '1.14' ),
2457 array( 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.62' ),
2458 array( 'cntctfrm_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.47' ),
2459 array( 'cptch_hide_banner_on_plugin_page', 'captcha/captcha.php', '3.8.4' ),
2460 array( 'gllr_hide_banner_on_plugin_page', 'gallery-plugin/gallery-plugin.php', '3.9.1' )
2461 );
2462 if ( ! $cntctfrm_plugin_info )
2463 $cntctfrm_plugin_info = get_plugin_data( __FILE__ );
2464
2465 if ( ! function_exists( 'is_plugin_active_for_network' ) )
2466 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2467
2468 $active_plugins = get_option( 'active_plugins' );
2469 $all_plugins = get_plugins();
2470 $this_banner = 'cntctfrm_hide_banner_on_plugin_page';
2471 $this_banner_1 = 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page';
2472
2473 foreach ( $banner_array as $key => $value ) {
2474 if ( $this_banner == $value[0] || $this_banner_1 == $value[0] ) {
2475 global $wp_version, $bstwbsftwppdtplgns_cookie_add;
2476 if ( ! isset( $bstwbsftwppdtplgns_cookie_add ) ) {
2477 echo '<script type="text/javascript" src="' . plugins_url( 'js/c_o_o_k_i_e.js', __FILE__ ) . '"></script>';
2478 $bstwbsftwppdtplgns_cookie_add = true;
2479 } ?>
2480 <script type="text/javascript">
2481 (function($) {
2482 $(document).ready( function() {
2483 var hide_message = $.cookie( "cntctfrm_hide_banner_on_plugin_page" );
2484 var hide_message_for_ctfrmtdb = $.cookie( "cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page" );
2485 if ( hide_message == "true" ) {
2486 $( ".cntctfrm_message" ).css( "display", "none" );
2487 if ( hide_message_for_ctfrmtdb == "true" ) {
2488 $( ".cntctfrm_message_for_ctfrmtdb" ).css( "display", "none" );
2489 } else {
2490 $( ".cntctfrm_message_for_ctfrmtdb" ).css( "display", "block" );
2491 }
2492 } else {
2493 $( ".cntctfrm_message" ).css( "display", "block" );
2494 }
2495 $( ".cntctfrm_close_icon" ).click( function() {
2496 $( ".cntctfrm_message" ).css( "display", "none" );
2497 $.cookie( "cntctfrm_hide_banner_on_plugin_page", "true", { expires: 32 } );
2498 });
2499 $( ".cntctfrm_for_ctfrmtdb_close_icon" ).click( function() {
2500 $( ".cntctfrm_message_for_ctfrmtdb" ).css( "display", "none" );
2501 $.cookie( "cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page", "true", { expires: 32 } );
2502 });
2503 });
2504 })(jQuery);
2505 </script>
2506 <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
2507 <div class="cntctfrm_message bws_banner_on_plugin_page" style="display: none;">
2508 <img class="cntctfrm_close_icon close_icon" title="" src="<?php echo plugins_url( 'images/close_banner.png', __FILE__ ); ?>" alt=""/>
2509 <div class="button_div">
2510 <a class="button" target="_blank" href="http://bestwebsoft.com/plugin/contact-form-pro/?k=f575dc39cba54a9de88df346eed52101&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>"><?php _e( 'Learn More', 'contact_form' ); ?></a>
2511 </div>
2512 <div class="text">
2513 <?php _e( "It’s time to upgrade your <strong>Contact Form plugin</strong> to <strong>PRO</strong> version", 'contact_form' ); ?>!<br />
2514 <span><?php _e( "Extend standard plugin functionality with new great options.", 'contact_form' ); ?></span>
2515 </div>
2516 <div class="icon">
2517 <img class="icon" title="" src="<?php echo plugins_url( 'images/banner.png', __FILE__ ); ?>" alt=""/>
2518 </div>
2519 </div>
2520 </div>
2521 <?php if ( ! array_key_exists( 'contact-form-to-db/contact_form_to_db.php', $all_plugins ) && ! array_key_exists( 'contact-form-to-db-pro/contact_form_to_db_pro.php', $all_plugins ) ) { ?>
2522 <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
2523 <div class="cntctfrm_message_for_ctfrmtdb bws_banner_on_plugin_page" style="display: none;">
2524 <img class="cntctfrm_for_ctfrmtdb_close_icon close_icon" title="" src="<?php echo plugins_url( 'images/close_banner.png', __FILE__ ); ?>" alt=""/>
2525 <div class="button_div">
2526 <a class="button" target="_blank" href="http://bestwebsoft.com/plugin/contact-form-to-db-pro/?k=6ebf0743736411607343ad391dc3b436&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>"><?php _e( 'Learn More', 'contact_form' ); ?></a>
2527 </div>
2528 <div class="text">
2529 <?php _e( "<strong>Contact Form to DB</strong> allows to store your messages to the database.", 'contact_form' ); ?><br />
2530 <span><?php _e( "Manage messages that have been sent from your website.", 'contact_form' ); ?></span>
2531 </div>
2532 <div class="icon">
2533 <img title="" src="<?php echo plugins_url( 'images/banner_for_ctfrmtdb.png', __FILE__ ); ?>" alt=""/>
2534 </div>
2535 </div>
2536 </div>
2537 <?php }
2538 break;
2539 }
2540 if ( isset( $all_plugins[ $value[1] ] ) && $all_plugins[ $value[1] ]["Version"] >= $value[2] && ( 0 < count( preg_grep( '/' . str_replace( '/', '\/', $value[1] ) . '/', $active_plugins ) ) || is_plugin_active_for_network( $value[1] ) ) && ! isset( $_COOKIE[ $value[0] ] ) ) {
2541 break;
2542 }
2543 }
2544 }
2545 }
2546 }
2547
2548 /* Function for delete options */
2549 if ( ! function_exists ( 'cntctfrm_delete_options' ) ) {
2550 function cntctfrm_delete_options() {
2551 delete_option( 'cntctfrm_options' );
2552 delete_site_option( 'cntctfrm_options' );
2553 }
2554 }
2555
2556 register_activation_hook( __FILE__, 'cntctfrm_db_create' );
2557
2558 add_action( 'admin_menu', 'cntctfrm_admin_menu' );
2559
2560 add_action( 'init', 'cntctfrm_init' );
2561 add_action( 'admin_init', 'cntctfrm_admin_init' );
2562
2563 /* Additional links on the plugin page */
2564 add_filter( 'plugin_action_links', 'cntctfrm_plugin_action_links', 10, 2 );
2565 add_filter( 'plugin_row_meta', 'cntctfrm_register_plugin_links', 10, 2 );
2566
2567 add_action( 'admin_enqueue_scripts', 'cntctfrm_admin_head' );
2568 add_action( 'wp_enqueue_scripts', 'cntctfrm_wp_head' );
2569
2570 add_shortcode( 'contact_form', 'cntctfrm_display_form' );
2571 add_shortcode( 'bws_contact_form', 'cntctfrm_display_form' );
2572 add_shortcode( 'bestwebsoft_contact_form', 'cntctfrm_display_form' );
2573 add_filter( 'widget_text', 'do_shortcode' );
2574
2575 add_filter( 'wp_mail_from_name', 'cntctfrm_email_name_filter', 10, 1 );
2576
2577 add_action( 'wp_ajax_cntctfrm_add_language', 'cntctfrm_add_language' );
2578 add_action( 'wp_ajax_cntctfrm_remove_language', 'cntctfrm_remove_language' );
2579
2580 add_action( 'admin_notices', 'cntctfrm_plugin_banner');
2581
2582 register_uninstall_hook( __FILE__, 'cntctfrm_delete_options' );
2583 ?>