From 244ec72c6d7d554518ff89598cb999d39614af0d Mon Sep 17 00:00:00 2001
From: danix $sitemsg
- $sitename
-
-
-
-
-
-
-
-
-
-
-
administrator.', 'dnxcf' ), get_bloginfo( 'admin_email' ) ); ?>
- + $dnxcf_posted = array(); + // let's gather some data about the user submitting the form + $dnxcf_ltd = trim( strip_tags( stripslashes( current_time( 'mysql' ) ) ) ); + $dnxcf_hst = trim( strip_tags( stripslashes( getenv( 'REMOTE_ADDR' ) ) ) ); + $dnxcf_ua = trim( strip_tags( stripslashes( $_SERVER['HTTP_USER_AGENT'] ) ) ); + // our posted options, arranged in one nice array + $dnxcf_posted['dnxcf_name'] = sanitize_text_field( $_POST['dnxcf_name'] ); + $dnxcf_posted['dnxcf_email'] = sanitize_email( $_POST['dnxcf_email'] ); + $dnxcf_posted['dnxcf_website'] = esc_url( $_POST['dnxcf_website'] ); + $dnxcf_posted['dnxcf_subject'] = sanitize_text_field( $_POST['dnxcf_subject'] ); + $dnxcf_posted['dnxcf_message'] = wp_kses( $_POST['dnxcf_message'], $valid_html ); + // let's begin with our email data, like receiver email, subject ecc. + $dnxcf_to = $dnxcf_options['dnxcf_recv_email']; + $dnxcf_headers = 'Reply-To: ' . $dnxcf_posted['dnxcf_email']; + $dnxcf_subject = __( 'Contact from "', 'dnxcf' ) . get_bloginfo( 'name' ) . '" - ' . $dnxcf_posted['dnxcf_subject']; - $dnxcf_options['dnxcf_recv_name'], + 'site' => get_bloginfo( 'name' ), + 'time' => $dnxcf_ltd, + 'host' => $dnxcf_hst, + 'ua' => $dnxcf_ua, + ); + $dnxcf_message = dnxcf_email_content( $dnxcf_email_data, $dnxcf_posted ); + } else { // content_type is set to text/plain + $dnxcf_message = sprintf( + __( "Hello \"%1\$s\",\nyou are being contacted by %2\$s on %3\$s.\n%4\$s has provided the following informations:\n\tEmail:\t\t%5\$s\n\tWebsite:\t%6\$s\n\tMessage:\n\n%7\$s", 'dnxcf' ), + $dnxcf_options['dnxcf_recv_name'], + $dnxcf_posted['dnxcf_name'], + get_bloginfo( 'name' ), + $dnxcf_posted['dnxcf_name'], + $dnxcf_posted['dnxcf_email'], + $dnxcf_posted['dnxcf_website'], + $dnxcf_posted['dnxcf_message'] + ); + $dnxcf_message .= "\n\n##-----------#-----------#-----------##\n\n"; + $dnxcf_message .= sprintf( + __( "We have also collected the following informations:\n\tBrowser:\t%1\$s\n\tTime:\t\t%2\$s\n\tIP Address:\t%3\$s\n", 'dnxcf' ), + $dnxcf_ua, + $dnxcf_ltd, + $dnxcf_hst + ); + } // end check for mail_content_type + + $dnxcf_mailed = wp_mail( $dnxcf_to, $dnxcf_subject, $dnxcf_message, $dnxcf_headers ); + + if ( $dnxcf_mailed ) { + ?> + ++
+
administrator.', 'dnxcf' ), get_bloginfo( 'admin_email' ) ); ?>
+ + + @@ -243,41 +198,39 @@ function dnxcf_display_form() { $dnxcf_options = get_option( 'dnxcf_options' ); ?> - parent_base == 'edit' ) { - echo ''; - } -} -add_action( 'media_buttons', 'dnxcf_show_form_button', 11 ); - -// the actual function that outputs our shortcode once the button is pressed -function dnxcf_insert_shortcode() { - $currentScreen = get_current_screen(); - if ( $currentScreen->parent_base != 'edit' ) { - return; - } ?> - - '1', 'dnxcf_privacy' => '', - 'dnxcf_latitude' => '38.2704', - 'dnxcf_longitude' => '16.2971', - 'dnxcf_apikey' => '', - 'dnxcf_gmap_message' => '', 'dnxcf_DB_VERSION' => '2', ); return $defaults; @@ -106,10 +76,13 @@ function dnxcf_db_check() { } // helper function that sets the current DB Version for comparison +/* + * Latest DB version: 5 +*/ function dnxcf_set_db_version() { // Define plugin database version. This should only change when new settings are added. if ( ! defined( 'DNXCF_CURRENT_DB_VERSION' ) ) { - define( 'DNXCF_CURRENT_DB_VERSION', 4 ); + define( 'DNXCF_CURRENT_DB_VERSION', 5 ); } } @@ -144,6 +117,9 @@ if ( dnxcf_update_from_email() ) { add_filter( 'wp_mail_from', 'dnxcf_update_from_email' ); } +/* + * Set the content type for the email +*/ function dnxcf_update_content_type() { global $dnxcf_options; $dnxcf_options = get_option( 'dnxcf_options' ); diff --git a/include/dnxcf_mail_template_danixland.php b/include/dnxcf_mail_template_danixland.php index 1c7d5b7..fe3d1a2 100644 --- a/include/dnxcf_mail_template_danixland.php +++ b/include/dnxcf_mail_template_danixland.php @@ -1,5 +1,5 @@ - + - + - +
-
+
%1$s < %2$s >', 'dnxcf' ),
$dnxcf_options['dnxcf_from_name'],
@@ -53,20 +48,14 @@ function dnxcf_settings_mailfrom_section_text() {
);
?>
-
+
Note: if the API Key value is missing the map will be disabled.', 'dnxcf' ); ?>
+ - value='1' />@fz*i5mi%#W42?D~c1^ DS;Pmre?K
zNpiO;=aCxcHIw0 RbY#EW&&g|Qn$u=#8Z sXzUn)+H45Kq~G(>?2e
zdye{FU}~sR$*Ap86!mC8YaYzoZ;j~0K~I2)pbZ5R#nHSHs~xhTP~xt!57O;1N!SI2
zOUf4!3PMpRiOS@d3R7ijtU8)cW1YurC>GIImS}D?cbW&yljcS9ruoqKivpMS`nNIW
z#AFGTlKAGpyM6`0)3{K#=n2AI;sD}(2tH?Y;79=I47tEjFJUN}O}7~~(`MOhn_~{A
z!{u;0JPxnJ=e+)j_*Y)5{hu)3;kNdJpw`$JeGgd+yE0i^P=9e15Nbyz{TA_A2$X`&
zW%2E1AMW58aZx+?+~%D*21>4BwS@)g|NkDjlh?{;5Qn(;qK7U$DpVw%Tq%9m?LaA-
zyMd)!H}!{F?Z)+5DzRQYS4@c;4)5 s^a;Gs&5<5)^^ro!!t1r-gf8!0O$BZs$
zbk5lMdROa~^-+v9N8s%%23@-;R(t7U`nnSMwS#{MS%M#=^Wi
!>rjG`y9EP&;}ebus+>o(5#V#-?FKY?T5iq#9}zqakehXDFs+}E$1zp;yb
z%1fvW^}Va+uUtI&s>}8
Q!UHQ*4SNIs_%)nzkWTHFm{Kzy5O;OD)*4|G?Z$e|mP$%E5Ef
z+J^%-?M&W#vG8!VZ+ZOMLl;br?fkdKh1Wm98xAge