Contact Form by BestWebSoft - Version 2011.2.04

Version Description

Download this release

Release Info

Developer bestwebsoft
Plugin Icon 128x128 Contact Form by BestWebSoft
Version 2011.2.04
Comparing to
See all releases

Code changes from version 2011.05.28 to 2011.2.04

contact_form.php CHANGED
@@ -1,14 +1,10 @@
1
  <?php
2
- /**
3
- * @package Contact Form Plugin
4
- * @version 1
5
- */
6
  /*
7
  Plugin Name: Contact Form Plugin
8
  Plugin URI: http://bestwebsoft.com/plugin/
9
  Description: Plugin for portfolio.
10
  Author: BestWebSoft
11
- Version: 1.02
12
  Author URI: http://bestwebsoft.com/
13
  License: GPLv2 or later
14
  */
@@ -29,10 +25,96 @@ License: GPLv2 or later
29
  */
30
  wp_enqueue_style( 'cntctfrmStylesheet', WP_PLUGIN_URL .'/contact-form-plugin/contact_form_style.css' );
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  // Add option page in admin menu
33
  if( ! function_exists( 'cntctfrm_admin_menu' ) ) {
34
  function cntctfrm_admin_menu() {
35
- add_options_page( "Contact Form Options", "Contact Form", 'manage_options', __FILE__, 'cntctfrm_settings_page' );
 
36
 
37
  //call register settings function
38
  add_action( 'admin_init', 'cntctfrm_settings' );
@@ -81,7 +163,7 @@ if( ! function_exists( 'cntctfrm_settings_page' ) ) {
81
  }
82
  }
83
  else {
84
- 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'] ) ) ) {
85
  update_option( 'cntctfrm_options', $cntctfrm_options, '', 'yes' );
86
  $message = "Options saved.";
87
  }
@@ -93,12 +175,12 @@ if( ! function_exists( 'cntctfrm_settings_page' ) ) {
93
  // Display form on the setting page
94
  ?>
95
  <div class="wrap">
96
- <div class="icon32" id="icon-options-general"><br></div>
97
  <h2>Contact Form Options</h2>
98
  <div class="updated fade" <?php if( ! isset( $_REQUEST['cntctfrm_form_submit'] ) || $error != "" ) echo "style=\"display:none\""; ?>><p><strong><?php echo $message; ?></strong></p></div>
99
  <div class="error" <?php if( "" == $error ) echo "style=\"display:none\""; ?>><p><strong><?php echo $error; ?></strong></p></div>
100
- <form method="post" action="options-general.php?page=contact-form-plugin/contact_form.php">
101
- <span style="border-bottom:1px dashed;margin-bottom:15px;">
102
  <p>If you would like to add a Contact Form to your website, just copy and put this shortcode onto your post or page: [contact_form]</p>
103
  If information in the below fields are empty then the message will be send to an address which was specified during registration.
104
  </span>
@@ -139,6 +221,8 @@ if( ! function_exists( 'cntctfrm_settings_page' ) ) {
139
  if( ! function_exists( 'cntctfrm_display_form' ) ) {
140
  function cntctfrm_display_form() {
141
  global $error_message;
 
 
142
  $content = "";
143
 
144
  $result = "";
@@ -233,7 +317,7 @@ if( ! function_exists( 'cntctfrm_check_form' ) ) {
233
  // Check information wich was input in fields
234
  if( "" != $_REQUEST['cntctfrm_contact_name'] )
235
  unset( $error_message['error_name'] );
236
- if( "" != $_REQUEST['cntctfrm_contact_emai'] && preg_match( "/^(?:[a-z0-9]+(?:[-_\.]?[a-z0-9]+)?@[a-z0-9]+(?:\.?[a-z0-9]+)?\.[a-z]{2,5})$/i", trim( $_REQUEST['cntctfrm_contact_emai'] ) ) )
237
  unset( $error_message['error_email'] );
238
  if( "" != $_REQUEST['cntctfrm_contact_subject'] )
239
  unset( $error_message['error_subject'] );
@@ -309,18 +393,34 @@ if( ! function_exists( 'cntctfrm_send_mail' ) ) {
309
  }
310
  }
311
 
312
- // Add the link on setting page in the plugin activation page
313
- if( ! function_exists( contact_settings ) ) {
314
- function contact_settings( $links, $file ) {
315
- $base = plugin_basename( __FILE__ );
316
- if ( $file == $base ) {
317
- $links[] = '<a href="options-general.php?page=contact-form-plugin/contact_form.php">' . __( 'Settings', 'Settings' ) . '</a>';
 
 
318
  }
319
- return $links;
 
 
 
 
 
 
 
 
320
  }
 
321
  }
322
 
323
- add_filter( 'plugin_row_meta', 'contact_settings', 10, 2 );
 
 
 
 
 
324
  add_shortcode( 'contact_form', 'cntctfrm_display_form' );
325
  add_action( 'admin_menu', 'cntctfrm_admin_menu' );
326
 
1
  <?php
 
 
 
 
2
  /*
3
  Plugin Name: Contact Form Plugin
4
  Plugin URI: http://bestwebsoft.com/plugin/
5
  Description: Plugin for portfolio.
6
  Author: BestWebSoft
7
+ Version: 2.04
8
  Author URI: http://bestwebsoft.com/
9
  License: GPLv2 or later
10
  */
25
  */
26
  wp_enqueue_style( 'cntctfrmStylesheet', WP_PLUGIN_URL .'/contact-form-plugin/contact_form_style.css' );
27
 
28
+ if( ! function_exists( 'bws_plugin_header' ) ) {
29
+ function bws_plugin_header() {
30
+ global $post_type;
31
+ ?>
32
+ <style>
33
+ #adminmenu #toplevel_page_my_new_menu div.wp-menu-image
34
+ {
35
+ background: url("<?php echo get_bloginfo('url');?>/wp-content/plugins/contact-form-plugin/images/icon_16.png") no-repeat scroll center center transparent;
36
+ }
37
+ #adminmenu #toplevel_page_my_new_menu:hover div.wp-menu-image,#adminmenu #toplevel_page_my_new_menu.wp-has-current-submenu div.wp-menu-image
38
+ {
39
+ background: url("<?php echo get_bloginfo('url');?>/wp-content/plugins/contact-form-plugin/images/icon_16_c.png") no-repeat scroll center center transparent;
40
+ }
41
+ .wrap #icon-options-general.icon32-bws
42
+ {
43
+ background: url("<?php echo get_bloginfo('url');?>/wp-content/plugins/contact-form-plugin/images/icon_36.png") no-repeat scroll left top transparent;
44
+ }
45
+ #toplevel_page_my_new_menu .wp-submenu .wp-first-item
46
+ {
47
+ display:none;
48
+ }
49
+ </style>
50
+ <?php
51
+ }
52
+ }
53
+
54
+ add_action('admin_head', 'bws_plugin_header');
55
+
56
+ if( ! function_exists( 'bws_add_menu_render' ) ) {
57
+ function bws_add_menu_render() {
58
+ global $title;
59
+ $active_plugins = get_option('active_plugins');
60
+ $array_install = array();
61
+ $array_recomend = array();
62
+ $count_install = $count_recomend = 0;
63
+ $array_plugins = array(
64
+ array( 'captcha\/captcha.php', 'Captcha', 'http://wordpress.org/extend/plugins/captcha/', 'http://bestwebsoft.com/plugin/captcha-plugin/' ),
65
+ array( 'contact-form-plugin\/contact_form.php', 'Contact Form', 'http://wordpress.org/extend/plugins/contact-form-plugin/', 'http://bestwebsoft.com/plugin/contact-form/' ),
66
+ array( 'facebook-button-plugin\/facebook-button-plugin.php', 'Facebook Like Button Plugin', 'http://wordpress.org/extend/plugins/facebook-button-plugin/', 'http://bestwebsoft.com/plugin/facebook-like-button-plugin/' ),
67
+ array( 'twitter-plugin\/twitter.php', 'Twitter Plugin', 'http://wordpress.org/extend/plugins/twitter-plugin/', 'http://bestwebsoft.com/plugin/twitter-plugin/' ),
68
+ array( 'portfolio\/portfolio.php', 'Portfolio', 'http://wordpress.org/extend/plugins/portfolio/', 'http://bestwebsoft.com/plugin/portfolio-plugin/' )
69
+ );
70
+ foreach($array_plugins as $plugins)
71
+ {
72
+ if( 0 < count( preg_grep( "/".$plugins[0]."/", $active_plugins ) ) )
73
+ {
74
+ $array_install[$count_install]['title'] = $plugins[1];
75
+ $array_install[$count_install]['link'] = $plugins[2];
76
+ $array_install[$count_install]['href'] = $plugins[3];
77
+ $count_install++;
78
+ }
79
+ else
80
+ {
81
+ $array_recomend[$count_recomend]['title'] = $plugins[1];
82
+ $array_recomend[$count_recomend]['link'] = $plugins[2];
83
+ $array_recomend[$count_recomend]['href'] = $plugins[3];
84
+ $count_recomend++;
85
+ }
86
+ }
87
+ ?>
88
+ <div class="wrap">
89
+ <div class="icon32 icon32-bws" id="icon-options-general"></div>
90
+ <h2><?php echo $title;?></h2>
91
+ <?php if($count_install > 0) { ?>
92
+ <div>
93
+ <h3>Installed plugins</h3>
94
+ <?php foreach($array_install as $install_plugin) { ?>
95
+ <div style="float:left; width:200px;"><?php echo $install_plugin['title']; ?></div> <p><a href="<?php echo $install_plugin['link']; ?>">Read more</a></p>
96
+ <?php } ?>
97
+ </div>
98
+ <?php } ?>
99
+ <?php if($count_recomend > 0) { ?>
100
+ <div>
101
+ <h3>Recommended plugins</h3>
102
+ <?php foreach($array_recomend as $recomend_plugin) { ?>
103
+ <div style="float:left; width:200px;"><?php echo $recomend_plugin['title']; ?></div> <p><a href="<?php echo $recomend_plugin['link']; ?>">Read more</a> <a href="<?php echo $recomend_plugin['href']; ?>">Download</a></p>
104
+ <?php } ?>
105
+ <span style="color: rgb(136, 136, 136); font-size: 10px;">If you have any questions, please contact us via plugin@bestwebsoft.com or fill in our contact form on our site <a href="http://bestwebsoft.com/contact/">http://bestwebsoft.com/contact/</a></span>
106
+ </div>
107
+ <?php } ?>
108
+ </div>
109
+ <?php
110
+ }
111
+ }
112
+
113
  // Add option page in admin menu
114
  if( ! function_exists( 'cntctfrm_admin_menu' ) ) {
115
  function cntctfrm_admin_menu() {
116
+ add_menu_page(__('BWS Plugins'), __('BWS Plugins'), 'edit_themes', 'my_new_menu', 'bws_add_menu_render', WP_CONTENT_URL."/plugins/contact-form-plugin/images/px.png", 100);
117
+ add_submenu_page('my_new_menu', 'Contact Form Options', 'Contact Form', 'edit_themes', "contact_form.php", 'cntctfrm_settings_page');
118
 
119
  //call register settings function
120
  add_action( 'admin_init', 'cntctfrm_settings' );
163
  }
164
  }
165
  else {
166
+ 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'] ) ) ) {
167
  update_option( 'cntctfrm_options', $cntctfrm_options, '', 'yes' );
168
  $message = "Options saved.";
169
  }
175
  // Display form on the setting page
176
  ?>
177
  <div class="wrap">
178
+ <div class="icon32 icon32-bws" id="icon-options-general"></div>
179
  <h2>Contact Form Options</h2>
180
  <div class="updated fade" <?php if( ! isset( $_REQUEST['cntctfrm_form_submit'] ) || $error != "" ) echo "style=\"display:none\""; ?>><p><strong><?php echo $message; ?></strong></p></div>
181
  <div class="error" <?php if( "" == $error ) echo "style=\"display:none\""; ?>><p><strong><?php echo $error; ?></strong></p></div>
182
+ <form method="post" action="admin.php?page=contact_form.php">
183
+ <span style="margin-bottom:15px;">
184
  <p>If you would like to add a Contact Form to your website, just copy and put this shortcode onto your post or page: [contact_form]</p>
185
  If information in the below fields are empty then the message will be send to an address which was specified during registration.
186
  </span>
221
  if( ! function_exists( 'cntctfrm_display_form' ) ) {
222
  function cntctfrm_display_form() {
223
  global $error_message;
224
+ global $cntctfrm_options;
225
+ $cntctfrm_options = get_option( 'cntctfrm_options' );
226
  $content = "";
227
 
228
  $result = "";
317
  // Check information wich was input in fields
318
  if( "" != $_REQUEST['cntctfrm_contact_name'] )
319
  unset( $error_message['error_name'] );
320
+ if( "" != $_REQUEST['cntctfrm_contact_emai'] && preg_match( "/^(?:[a-z0-9]+(?:[-_\.]?[a-z0-9]+)?@[a-z0-9]+(?:[-\.]?[a-z0-9]+)?\.[a-z]{2,5})$/i", trim( $_REQUEST['cntctfrm_contact_emai'] ) ) )
321
  unset( $error_message['error_email'] );
322
  if( "" != $_REQUEST['cntctfrm_contact_subject'] )
323
  unset( $error_message['error_subject'] );
393
  }
394
  }
395
 
396
+ function cntctfrm_plugin_action_links( $links, $file ) {
397
+ //Static so we don't call plugin_basename on every plugin row.
398
+ static $this_plugin;
399
+ if ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);
400
+
401
+ if ( $file == $this_plugin ){
402
+ $settings_link = '<a href="admin.php?page=contact_form.php">' . __('Settings', 'cntctfrm_plugin') . '</a>';
403
+ array_unshift( $links, $settings_link );
404
  }
405
+ return $links;
406
+ } // end function cntctfrm_plugin_action_links
407
+
408
+ function cntctfrm_register_plugin_links($links, $file) {
409
+ $base = plugin_basename(__FILE__);
410
+ if ($file == $base) {
411
+ $links[] = '<a href="admin.php?page=contact_form.php">' . __('Settings','cntctfrm_plugin') . '</a>';
412
+ $links[] = '<a href="http://wordpress.org/extend/plugins/contact-form-plugin/faq/" target="_blank">' . __('FAQ','cntctfrm_plugin') . '</a>';
413
+ $links[] = '<a href="Mailto:plugin@bestwebsoft.com">' . __('Support','cntctfrm_plugin') . '</a>';
414
  }
415
+ return $links;
416
  }
417
 
418
+ // adds "Settings" link to the plugin action page
419
+ add_filter( 'plugin_action_links', 'cntctfrm_plugin_action_links',10,2);
420
+
421
+ //Additional links on the plugin page
422
+ add_filter( 'plugin_row_meta', 'cntctfrm_register_plugin_links',10,2);
423
+
424
  add_shortcode( 'contact_form', 'cntctfrm_display_form' );
425
  add_action( 'admin_menu', 'cntctfrm_admin_menu' );
426
 
images/icon_16.png ADDED
Binary file
images/icon_16_c.png ADDED
Binary file
images/icon_36.png ADDED
Binary file
images/px.png ADDED
Binary file
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: bestwebsoft
3
  Donate link: http://bestwebsoft.com/
4
  Tags: Contact Form, text, contact, form, contacts, contakt form, request, contact me, feedback form, feedback, contact button, contact form plugin, contacts form plugin
5
  Requires at least: 2.9
6
- Tested up to: 3.1.3
7
- Stable tag: 2011.05.28
8
 
9
  Add Contact Form to your WordPress website.
10
 
@@ -46,6 +46,21 @@ Contact Form allows you to add a feedback form easilly and simply to a post or a
46
 
47
  == Changelog ==
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  = 1.02 =
50
  *Display "thanks" message bug is fixed. Radio buttons automatic switching added (for settings page) after setting mouse cursor (clicking) into a text field.
51
 
@@ -57,6 +72,21 @@ Contact Form allows you to add a feedback form easilly and simply to a post or a
57
 
58
  == Upgrade Notice ==
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  = 1.02 =
61
  Display "thanks" message bug is fixed. Radio buttons automatic switching added (for settings page) after setting mouse cursor (clicking) into a text field. Upgrade immediately.
62
 
3
  Donate link: http://bestwebsoft.com/
4
  Tags: Contact Form, text, contact, form, contacts, contakt form, request, contact me, feedback form, feedback, contact button, contact form plugin, contacts form plugin
5
  Requires at least: 2.9
6
+ Tested up to: 3.2
7
+ Stable tag: 2011.2.04
8
 
9
  Add Contact Form to your WordPress website.
10
 
46
 
47
  == Changelog ==
48
 
49
+ = 2.04 =
50
+ *BWS Plugins sections was fixed and right now it is consisted with 2 parts: installed and recommended plugins. Icons displaying is fixed.
51
+
52
+ = 2.03 =
53
+ *The bug of the use custom email is fixed in this version. Please upgrade the plugin immediately. Thank you
54
+
55
+ = 2.02 =
56
+ *The bug of the setting page link is fixed in this version. Please upgrade the plugin immediately. Thank you
57
+
58
+ = 2.01 =
59
+ *Usability at the settings page of plugin was improved.
60
+
61
+ = 1.03 =
62
+ *Contact form email adress bug is fixed.
63
+
64
  = 1.02 =
65
  *Display "thanks" message bug is fixed. Radio buttons automatic switching added (for settings page) after setting mouse cursor (clicking) into a text field.
66
 
72
 
73
  == Upgrade Notice ==
74
 
75
+ = 2.04 =
76
+ BWS Plugins sections was fixed and right now it is consisted with 2 parts: installed and recommended plugins. Icons displaying is fixed.
77
+
78
+ = 2.03 =
79
+ The bug of the use custom email is fixed in this version. Please upgrade the plugin immediately. Thank you
80
+
81
+ = 2.02 =
82
+ The bug of the setting page link is fixed in this version. Please upgrade the plugin immediately. Thank you
83
+
84
+ = 2.01 =
85
+ Usability at the settings page of plugin was improved.
86
+
87
+ = 1.03 =
88
+ Contact form email adress bug is fixed. Upgrade immediately.
89
+
90
  = 1.02 =
91
  Display "thanks" message bug is fixed. Radio buttons automatic switching added (for settings page) after setting mouse cursor (clicking) into a text field. Upgrade immediately.
92
 
screenshot-2.jpg CHANGED
Binary file