Changeset 385773
- Timestamp:
- 05/17/2011 10:52:26 AM (15 years ago)
- Location:
- multilang-contact-form/trunk
- Files:
-
- 3 edited
-
ml-contactform-options.php (modified) (5 diffs)
-
ml-contactform.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
multilang-contact-form/trunk/ml-contactform-options.php
r286717 r385773 5 5 add_option('mlcf_email', 'you@example.com', 'mlcf'); 6 6 add_option('mlcf_subject', '[:en]English email from donkeymedia.eu[:de]Deutsche e-Mail von donkeymedia.eu', 'mlcf'); 7 add_option('mlcf_email_from', 'contactform@yourdomain.com', 'mlcf'); 7 8 add_option('mlcf_success_message','[:en]Thank you! <br />email successfully sent[:de]Vielen Dank<br />e-Mail erfolgreich versandt', 'mlcf'); 8 9 add_option('mlcf_error_message', '[:en]<span class="red">Please fill in the required fields</span>[:de]<span class="red">Bitte füllen Sie alle notwendigen Felder aus</span>', 'mlcf'); … … 24 25 update_option('mlcf_email', $_POST['mlcf_email']); 25 26 update_option('mlcf_subject', $_POST['mlcf_subject']); 27 update_option('mlcf_email_from', $_POST['mlcf_email_from']); 26 28 update_option('mlcf_success_message', $_POST['mlcf_success_message']); 27 29 update_option('mlcf_error_message', $_POST['mlcf_error_message']); … … 40 42 $mlcf_email = stripslashes(get_option('mlcf_email')); 41 43 $mlcf_subject = stripslashes(get_option('mlcf_subject')); 44 $mlcf_email_from = stripslashes(get_option('mlcf_email_from')); 42 45 $mlcf_success_message = stripslashes(get_option('mlcf_success_message')); 43 46 $mlcf_error_message = stripslashes(get_option('mlcf_error_message')); … … 64 67 </tr> 65 68 <tr valign="top"> 69 <th scope="row"><?php _e('From e-mail Address:', 'mlcf') ?></th> 70 <td><input name="mlcf_email_from" type="text" id="mlcf_email_from" value="<?php echo $mlcf_email_from; ?>" size="40" /> 71 <br /> 72 <?php _e('This address will be shown in the From Field in the mails you recive via the plugin', 'mlcf') ?></td> 73 </tr> 74 <tr valign="top"> 66 75 <th scope="row"><?php _e('Subject Suffix:', 'mlcf') ?></th> 67 76 <td><input name="mlcf_subject" type="text" id="mlcf_subject" value="<?php echo $mlcf_subject; ?>" size="50" /> … … 176 185 margin-left: 8em; 177 186 margin-top: 1em; 187 } 188 .mailsend{ 189 color: green; 178 190 } 179 191 </pre> -
multilang-contact-form/trunk/ml-contactform.php
r286717 r385773 2 2 /* 3 3 Plugin Name: Multilang Contactform 4 Plugin URI: http:// blog.digitaldonkey.de4 Plugin URI: http://donkeymedia.eu/2010/08/26/worpress-multilingual-contactform/ 5 5 Description: Translatable Contacform Plugin. Based Ryan Duff and Peter Westwood WP-ContactForm (http://blog.ftwr.co.uk/wordpress/) on WP Contact Form is a drop in form for users to contact you. It can be implemented on a page or a post. It currently works with WordPress 2.0+ 6 6 Author: Thorsten Krug 7 7 Author URI: http://donkeymedia.eu 8 Version: 1. 18 Version: 1.2 9 9 */ 10 10 … … 125 125 return preg_match("/^$regex$/",$email); 126 126 } 127 128 129 /* Wrapper function to use in a Template .*/ 130 function mlcf_form(){ 131 mlcf_callback($content, true); 132 } 133 134 127 135 /*Wrapper function which calls the form.*/ 128 function mlcf_callback( $content ) {136 function mlcf_callback( $content , $templateTag=false) { 129 137 global $mlcf_strings; 130 138 131 139 /* Run the input check. */ 132 if(false === strpos($content, '<!--contact form-->') ) {140 if(false === strpos($content, '<!--contact form-->') and !$templateTag) { 133 141 return $content; 134 142 } … … 139 147 140 148 $recipient = get_option('mlcf_email'); 149 $from_mail = get_option('mlcf_email_from'); 141 150 $success_message = get_option('mlcf_success_message'); 142 151 $success_message = stripslashes($success_message); … … 152 161 $headers .= "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n"; 153 162 $header2 = "Reply-To:".$email."\n"; 154 $header2 .= "From: webmail@donkeymedia.eu\r\n";163 $header2 .= "From: ".$from_mail."\r\n"; 155 164 156 165 $message = "e-Mail from ".get_bloginfo("name")." Contact Form: \n\n"; … … 165 174 166 175 mail($recipient,utf8_decode($subject),$message,$header2); 167 $results = '<div style="font-weight: bold;">' . $success_message . '</div>';176 $results = '<div class="mailsend">' . $success_message . '</div>'; 168 177 echo $results; 169 178 } … … 201 210 </form> 202 211 </div>'; 203 return str_replace('<!--contact form-->', $form, $content); 212 if ($templateTag){ 213 echo $form; 214 }else{ 215 return str_replace('<!--contact form-->', $form, $content); 216 } 204 217 } 205 218 } -
multilang-contact-form/trunk/readme.txt
r286717 r385773 4 4 Requires at least: 1.5 5 5 Tested up to: 3.1 6 Stable tag: 1.16 Stable tag: Trunk 7 7 Donate link: http://donkeymedia.eu/2010/08/26/worpress-multilingual-contactform/ 8 8 … … 32 32 == Upgrade Notice == 33 33 34 = 1.2 = 35 Added Option to set a From-Field for the received mails 36 34 37 = 1.1 = 35 38 Added Delete at Plugin deactivation and an Option to Skip this.
Note: See TracChangeset
for help on using the changeset viewer.