Changeset 401
- Timestamp:
- 08/06/08 23:29:49 (5 months ago)
- Location:
- ajaxcontact/trunk
- Files:
-
- 2 added
- 2 removed
- 7 modified
-
. (modified) (1 prop)
-
ajaxcontact.php (modified) (11 diffs)
-
js/aj-contact-jquery.js (added)
-
js/aj-contact-prototype.js (modified) (1 diff)
-
js/mootools.js (deleted)
-
js/prototype.js (deleted)
-
lang (modified) (1 prop)
-
lang/ajaxcontact-ko_KR.mo (modified) (previous)
-
lang/ajaxcontact-ko_KR.po (modified) (2 diffs)
-
lang/ajaxcontact.pot (added)
-
r/aj-contact.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ajaxcontact/trunk
-
Property
svn:ignore set
to
TODO
-
Property
svn:ignore set
to
-
ajaxcontact/trunk/ajaxcontact.php
r233 r401 5 5 Description: AjaxContactForm is powered by <a href="http://www.dustindiaz.com/">Dustin</a>'s <a href="http://www.dustindiaz.com/ajax-contact-form/">ajaxContactform</a>. Just write <!--contact form--> on page or post. This plugin supports WP 2.1 or greater and older version with <a href="http://082net.com/tag/wp-compatibility-pack/">WP-Compatibility-Pack</a> 6 6 Author: Cheon, Young-Min 7 Version: 1. 37 Version: 1.4 8 8 Author URI: http://082net.com/ 9 9 *//* … … 37 37 */ 38 38 39 if(!function_exists('wp_print_scripts')) {40 if(strpos($_SERVER['PHP_SELF'], 'wp-admin/plugins.php') !== false) :41 function ajaxcontact_warning() {42 load_plugin_textdomain('ajaxcontact', 'wp-content/plugins/ajaxcontact/lang');43 ?>44 <script type="text/javascript">//<![CDATA[45 if(!div_wraper_082net) {46 var div_wrapers_082net = document.getElementsByTagName('DIV');47 if(div_wrapers_082net) {48 for(var i=0; i<div_wrapers_082net.length; i++) {49 if(/wrap/.exec(div_wrapers_082net[i].className)) {50 var div_wraper_082net = div_wrapers_082net[i];51 break;52 }53 }54 }55 }56 if(div_wraper_082net) {57 var ajaxcontact_warning = document.createElement("DIV");58 ajaxcontact_warning.innerHTML = "<p><strong><?php _e('AjaxContactForm is not active', 'ajaxcontact'); ?></strong> : <?php _e('AjaxContactForm requires <a href=\'http://082net.com/tag/wp-compatibility-pack/\'>WP-Compatibility-Pack</a> with lesser than WP 2.1', 'ajaxcontact'); ?></p>";59 ajaxcontact_warning.className = 'updated fade';60 ajaxcontact_warning.id = 'ajaxcontact_warning';61 div_wraper_082net.parentNode.insertBefore(ajaxcontact_warning, div_wraper_082net);62 Fat.fade_element('ajaxcontact_warning');63 }64 //]]></script>65 <?php66 }67 add_action('admin_footer', 'ajaxcontact_warning');68 endif; // If plugin manage page.69 return;70 }71 72 39 class ajaxContactForm { 73 var $version = '1. 3';40 var $version = '1.4'; 74 41 var $myhost; 75 42 var $pluginURL; 76 43 var $op; 77 44 var $version_check_url = 'http://082net.com/update-check.php?check_plugin=ajaxcontact'; 78 var $plugin_home = 'http://082net.com/tag/ajaxcontactform/ ';45 var $plugin_home = 'http://082net.com/tag/ajaxcontactform/?orderby=modified'; 79 46 80 47 function ajaxContactForm() { 81 48 load_plugin_textdomain('ajaxcontact', 'wp-content/plugins/ajaxcontact/lang'); 49 $this->init(); 50 } 51 52 function init() { 82 53 $this->pluginURL = get_option('siteurl').'/wp-content/plugins/ajaxcontact'; 83 54 $this->myhost = preg_replace( '|^www\.|', '', isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : $_SERVER["SERVER_NAME"]) ; 84 $this->init(); 85 } 86 87 function init() { 88 $this->op = get_option('acf_options'); 89 if(!$this->op) 90 $this->activate_plugin(); 91 $need_strip = array('js_lib', 'email', 'subject', 'success', 'failure'); 55 $this->op = $this->get_option(); 56 } 57 58 function get_option() { 59 $op = get_option('acf_options'); 60 if (!$op || !is_array($op)) 61 $op = $this->default_option(); 62 $op = array_merge($this->default_option(), (array)$op); 63 $need_strip = array('email', 'subject', 'success', 'failure', 'spam'); 92 64 foreach($this->op as $k => $v) { 93 65 if(in_array($k, $need_strip)) 94 66 $this->op[$k] = stripslashes($this->op[$k]); 95 67 } 68 return $op; 69 } 70 71 function default_option() { 72 $default['js_lib'] = "prototype"; 73 $default['email'] = get_option('admin_email'); 74 $default['subject'] = "[" . get_option('blogname') . "] Message from: "; 75 $default['success'] = 'Success! Your Email has been sent. Hope you enjoyed your stay.'; 76 $default['failure'] = 'Your E-mail could not be sent. Please try back at another time.'; 77 $default['spam'] = __('You E-mail is defined as spam by <a href="http://akismet.com">Akismet</a>. ', 'ajaxcontact'); 78 $default['checkemail'] = 1;// email address validation. 79 $default['checkdomain'] = 0;// block email address from your domain (e.g. abc@yourdomain.com). almost spam. 80 $default['contact_page_only'] = 0; 81 $default['contact_page'] = 0; 82 return $default; 96 83 } 97 84 98 85 function activate_plugin() { 99 86 if (!$this->op){ 100 $this->op = array(); 101 $this->op['js_lib'] = "prototype"; 102 $this->op['email'] = get_option('admin_email'); 103 $this->op['subject'] = "[" . get_option('blogname') . "] Message from: "; 104 $this->op['success'] = 'Success! Your Email has been sent. Hope you enjoyed your stay.'; 105 $this->op['failure'] = 'Your Email could not be sent. Please try back at another time.'; 106 $this->op['checkemail'] = 1;// email address validation. 107 $this->op['checkdomain'] = 0;// block email address from your domain (e.g. abc@yourdomain.com). almost spam. 108 $this->op['contact_page_only'] = 0; 109 $this->op['contact_page'] = 0; 87 $this->op = $this->default_option(); 110 88 update_option("acf_options", $this->op); 111 89 } … … 129 107 } 130 108 131 function add_head() {109 function wp_head() { 132 110 if (!$this->op['contact_page_only'] || is_page($this->op['contact_page'])) { 133 111 $r = "\n\t" . '<!-- Added by Ajax Contact Form -->'."\n"; … … 137 115 } 138 116 117 function akismet_available() { 118 return function_exists('akismet_http_post'); 119 } 120 139 121 function wp_scripts_available() { 122 return false; 140 123 $op = get_option('wp_scripts'); 141 124 if(class_exists('wpInsertScripts') && is_array($op) && $op['baselib'] == 'mootools') 142 125 return true; 126 return false; 127 } 128 129 function akismet_check($check) { 130 if (!$this->akismet_available()) 131 return false; 132 133 global $akismet_api_host, $akismet_api_port; 134 135 $check['user_ip'] = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] ); 136 $check['user_agent'] = $_SERVER['HTTP_USER_AGENT']; 137 $check['referrer'] = $_SERVER['HTTP_REFERER']; 138 $check['blog'] = get_option('home'); 139 140 /* $ignore = array( 'HTTP_COOKIE' ); 141 142 foreach ( $_SERVER as $key => $value ) 143 if ( !in_array( $key, $ignore ) ) 144 $comment["$key"] = $value;*/ 145 146 $query_string = ''; 147 foreach ( $check as $key => $data ) 148 $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; 149 150 $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port); 151 if ( 'true' == $response[1] ) { 152 return true; 153 } 143 154 return false; 144 155 } … … 157 168 $this->op['js_lib'] = 'prototype'; 158 169 update_option('acf_options', $this->op); 159 $this->enqueue_scripts(); 160 } 161 break; 162 } 163 wp_enqueue_script('ajaxcontactform'); 170 return $this->enqueue_scripts(); 171 } 172 break; 173 case 'jquery' : 174 wp_register_script('ajaxcontactform', '/wp-content/plugins/ajaxcontact/js/aj-contact-jquery.js', array('jquery', 'jquery-form'), $this->version); 175 break; 176 } 177 $enqueue = wp_enqueue_script('ajaxcontactform'); 164 178 endif; 165 179 } … … 194 208 $this->op['contact_page'] = (int)$_POST['contact_page']; 195 209 if($this->op['checkdomain']) $this->op['checkemail'] = 1; 210 $this->op['akismet'] = (int)$_POST['akismet_check']; 196 211 update_option('acf_options', $this->op); 197 212 } else if (isset($_POST['reset_options'])) { … … 211 226 212 227 <fieldset class="options"> 213 <table width="100%" cellspacing="2" cellpadding="5" class="editform " id="optiontable">228 <table width="100%" cellspacing="2" cellpadding="5" class="editform form-table" id="optiontable"> 214 229 <tr valign="top"> 215 230 <th width="20%" scope="row"><?php _e('Update Check:', 'ajaxcontact') ?></th> 216 231 <td> 217 232 <select name="update_check"> 218 <option value="1"<?php if($op['update_check']) { ?> selected="selected"<?php }?>>true</option>219 <option value="0"<?php if(!$op['update_check']) { ?> selected="selected"<?php }?>>false</option>233 <option value="1"<?php selected($op['update_check'], 1); ?>>true</option> 234 <option value="0"<?php selected($op['update_check'], 0); ?>>false</option> 220 235 </select><br /> 221 236 <?php _e('Automatically check if plugin update is available', 'ajaxcontact'); ?></td> 222 237 </tr> 223 <?php if($this->wp_scripts_available()) { ?>224 238 <tr valign="top"> 225 239 <th width="20%" scope="row"><?php _e('Base Javascirpt:', 'ajaxcontact') ?></th> 226 240 <td> 227 241 <select name="js_lib"> 228 <option value="mootools"<?php if ($op['js_lib'] == 'mootools') { ?> selected="selected"<?php } ?>>mootools</option> 229 <option value="prototype"<?php if ($op['js_lib'] == 'prototype') { ?> selected="selected"<?php } ?>>prototype</option> 242 <option value="jquery"<?php selected($op['js_lib'], 'jquery'); ?>>jquery</option> 243 <option value="prototype"<?php selected($op['js_lib'], 'prototype'); ?>>prototype</option> 244 <?php if($this->wp_scripts_available()) { ?> 245 <option value="mootools"<?php selected($op['js_lib'], 'mootools'); ?>>mootools</option> 246 <?php } ?> 230 247 </select><br /> — 231 <?php _e('Select javascript library you want to use.', 'ajaxcontact'); ?> (<a href="http://prototype.conio.net/">prototype</a>, <a href="http://mootools.net">mootools</a>)</td> 232 </tr> 233 <?php } else { ?> 234 <input type="hidden" name="js_lib" value="prototype" /> 235 <?php } ?> 248 <?php _e('Select javascript library you want to use.', 'ajaxcontact'); ?> (<a href="jquery.com">jQuery</a>, <a href="http://prototype.conio.net/">prototype</a>, <a href="http://mootools.net">mootools</a>)</td> 249 </tr> 236 250 <tr valign="top"> 237 251 <th width="20%" scope="row"><?php _e('Contact Page Only:', 'ajaxcontact') ?></th> 238 252 <td> 239 253 <select name="contact_page_only"> 240 <option value="1"<?php if($op['contact_page_only']) { ?> selected="selected"<?php }?>>true</option>241 <option value="0"<?php if(!$op['contact_page_only']) { ?> selected="selected"<?php }?>>false</option>254 <option value="1"<?php selected($op['contact_page_only'], 1); ?>>true</option> 255 <option value="0"<?php selected($op['contact_page_only'], 0); ?>>false</option> 242 256 </select> — 243 257 <?php _e('My Contact Page:', 'ajaxcontact'); ?> <select name="contact_page"> … … 251 265 <?php _e('Set this true if you want use contact-form only on "Contact" page. And select your page', 'ajaxcontact'); ?></td> 252 266 </tr> 267 <?php if ($this->akismet_available()) { ?> 268 <tr valign="top"> 269 <th width="20%" scope="row"><?php _e('Akismet Check:', 'ajaxcontact') ?></th> 270 <td> 271 <select name="akismet_check"> 272 <option value="1"<?php selected($op['akismet'], 1); ?>>true</option> 273 <option value="0"<?php selected($op['akismet'], 0); ?>>false</option> 274 </select><br /> 275 <?php _e('Automatically check if mail is spam', 'ajaxcontact'); ?></td> 276 </tr> 277 <?php } ?> 253 278 <tr valign="top"> 254 279 <th width="20%" scope="row"><?php _e('E-mail:', 'ajaxcontact') ?></th> … … 285 310 </fieldset> 286 311 <p class="submit"> 287 < input style="float:left;margin-left:5%;" type="submit" name="reset_options" value="<?php _e('Reset Options', 'ajaxcontact') ?> »" />312 <!-- <input style="float:left;margin-left:5%;" type="submit" name="reset_options" value="<?php _e('Reset Options', 'ajaxcontact') ?> »" /> --> 288 313 <input type="submit" name="update_options" value="<?php _e('Update Options', 'ajaxcontact') ?> »" /> 289 314 </p> … … 294 319 295 320 function print_acf() { 296 $success = (isset($_GET['acf_success']) && !empty($_GET['acf_success']))?$_GET['acf_success']:'';321 $success = isset($_GET['acf_success']) && '' != $_GET['acf_success'] ? (int)$_GET['acf_success'] : ''; 297 322 $result_msg = ''; 298 if(!empty($success)) { 299 switch($success) { 300 case '0': 301 $result_msg .= '<div class="acf_error">'; 302 $result_msg .= ($_GET['acf_vmail'] == '2')?'<p>check your email address.</p>':''; 303 $result_msg .= ($_GET['acf_vsite'] == '2')?'<p>check your website URL.</p>':''; 304 $result_msg .= '</div>'; 305 break; 306 case '1': 307 $result_msg .= '<div class="acf_good">'.$this->op['success'].'</div>'; 308 break; 309 case '2': 310 $result_msg .= '<div class="acf_error">'.$this->op['failure'].'</div>'; 311 break; 312 } 313 } 314 $text = "\n\t" . '<div id="acf_result"'.((!empty($success))?'':' style="display:none;"').'>'.$result_msg.'</div>' . "\n"; 323 switch($success) { 324 case 0: 325 $result_msg .= '<div class="acf_error"><p>'.__('Your E-mail could not be sent.', 'ajaxcontact').'<br />'; 326 $result_msg .= $_GET['acf_is_spam'] == 1 ? $this->op['spam'] : ''; 327 $result_msg .= $_GET['acf_vmail'] == 2 ? __('check your email address. ', 'ajaxcontact') : ''; 328 $result_msg .= $_GET['acf_vsite'] == 2 ? __('check your website URL. ', 'ajaxcontact') : ''; 329 $result_msg .= $_GET['acf_vtext'] == 0 ? __('check your message text. ', 'ajaxcontact') : ''; 330 $result_msg .= '</p></div>'; 331 break; 332 case 1: 333 $result_msg .= '<div class="acf_good">'.$this->op['success'].'</div>'; 334 break; 335 case 2: 336 $result_msg .= '<div class="acf_error">'.$this->op['failure'].'</div>'; 337 break; 338 default: 339 break; 340 } 341 $text = "\n\t" . '<div id="acf_result"'.('' !== $success ? '' : ' style="display:none;"').'>'.$result_msg.'</div>' . "\n"; 315 342 $text .= "\t" . '<div><div id="acf_container">' . "\n"; 316 343 $text .= "\t" . '<form action="'.$this->pluginURL.'/r/aj-contact.php" method="post" id="acfForm" onsubmit="acf_sendMail(); return false;">' . "\n"; … … 392 419 add_action('admin_menu', array(&$AjaxContact, 'add_options')); 393 420 add_filter('the_content', array(&$AjaxContact, 'add_filter')); 394 add_action('wp_head', array(&$AjaxContact, ' add_head'), 99);395 add_action('wp_ print_scripts', array(&$AjaxContact, 'enqueue_scripts'));421 add_action('wp_head', array(&$AjaxContact, 'enqueue_scripts'), 0); 422 add_action('wp_head', array(&$AjaxContact, 'wp_head'), 99); 396 423 unset($AjaxContact); 397 424 ?> -
ajaxcontact/trunk/js/aj-contact-prototype.js
r233 r401 1 1 function acf_sendMail() { 2 if(!$('acfForm')) 3 return; 2 4 var url = $('acfForm').action +"?ajax=true"; 3 5 var pars = "&" + Form.serialize($('acfForm')); -
ajaxcontact/trunk/lang
-
Property
svn:ignore set
to
ajaxcontact.mo
-
Property
svn:ignore set
to
-
ajaxcontact/trunk/lang/ajaxcontact-ko_KR.po
r233 r401 1 1 msgid "" 2 2 msgstr "" 3 "Plural-Forms: s\n"4 3 "Project-Id-Version: Ajax Contact Form\n" 5 "POT-Creation-Date: \n" 6 "PO-Revision-Date: 2007-08-20 20:15+0900\n" 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2008-08-06 23:17+0900\n" 6 "PO-Revision-Date: 2008-08-06 23:19+0900\n" 7 7 "Last-Translator: 082net <082net@gmail.com>\n" 8 8 "Language-Team: 082NeT <082net@gmail.com>\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset= utf-8\n"10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "Plural-Forms: s\n" 12 13 "X-Poedit-Language: Korean\n" 13 14 "X-Poedit-Country: KOREA, REPUBLIC OF\n" … … 15 16 "X-Poedit-KeywordsList: __;_e\n" 16 17 "X-Poedit-Basepath: .\n" 17 "X-Poedit-SearchPath-0: \n"18 18 19 # ajaxcontact.php:4320 msgid " AjaxContactForm is not active"21 msgstr " AjaxContactFrom이 제대로 작동하지 않습니다"19 #: ../ajaxcontact.php:77 20 msgid "You E-mail is defined as spam by <a href=\"http://akismet.com\">Akismet</a>. " 21 msgstr "<a href=\"http://akismet.com\">Akismet</a>에의해 스팸으로 인식되었습니다." 22 22 23 # ajaxcontact.php:43 24 msgid "AjaxContactForm requires <a href='http://082net.com/tag/wp-compatibility-pack/'>WP-Compatibility-Pack</a> with lesser than WP 2.1" 25 msgstr "WP 2.1 이전 버전에서 AjaxContactForm을 사용하려면 <a href='http://082net.com/tag/wp-compatibility-pack/'>WP-Compatibility-Pack</a>을 설치하셔야만 합니다." 26 27 # ajaxcontact.php:179 23 #: ../ajaxcontact.php:218 28 24 msgid "There is a plugin update available" 29 25 msgstr "플러그인이 업데이트 되었습니다." 30 26 31 # ajaxcontact.php:13327 #: ../ajaxcontact.php:223 32 28 msgid "AjaxContact Options" 33 29 msgstr "AjaxContact Options" 34 30 35 # ajaxcontact.php:19131 #: ../ajaxcontact.php:230 36 32 msgid "Update Check:" 37 33 msgstr "업데이트 확인:" 38 34 39 # ajaxcontact.php:19735 #: ../ajaxcontact.php:236 40 36 msgid "Automatically check if plugin update is available" 41 37 msgstr "이 페이지를 표시 할 때 마다 자동으로 업데이트를 확인합니다." 42 38 43 # ajaxcontact.php:14539 #: ../ajaxcontact.php:239 44 40 msgid "Base Javascirpt:" 45 41 msgstr "기본 자바스크립트:" 46 42 47 # ajaxcontact.php:15143 #: ../ajaxcontact.php:248 48 44 msgid "Select javascript library you want to use." 49 45 msgstr "사용하고자 하는 자바스크립트를 선택하세요." 50 46 51 # ajaxcontact.php:21347 #: ../ajaxcontact.php:251 52 48 msgid "Contact Page Only:" 53 49 msgstr "Contact 페이지 전용:" 54 50 55 # ajaxcontact.php:21951 #: ../ajaxcontact.php:257 56 52 msgid "My Contact Page:" 57 53 msgstr "내 블로그의 Contact 페이지:" 58 54 59 # ajaxcontact.php:22755 #: ../ajaxcontact.php:265 60 56 msgid "Set this true if you want use contact-form only on \"Contact\" page. And select your page" 61 57 msgstr "Contact 페이지에서만 AjaxContactForm을 사용하려면 true 로 설정하신 뒤 해당 페이지를 설정하세요." 62 58 63 # ajaxcontact.php:140 59 #: ../ajaxcontact.php:269 60 msgid "Akismet Check:" 61 msgstr "Akismet 사용:" 62 63 #: ../ajaxcontact.php:275 64 msgid "Automatically check if mail is spam" 65 msgstr "메일을 발송하기전에 Akismet을 이용해 스팸확인" 66 67 #: ../ajaxcontact.php:279 64 68 msgid "E-mail:" 65 69 msgstr "이메일:" 66 70 67 # ajaxcontact.php:14271 #: ../ajaxcontact.php:281 68 72 msgid "(\"To\" email address(your email))" 69 73 msgstr "( 받는메일 )" 70 74 71 # ajaxcontact.php:14575 #: ../ajaxcontact.php:284 72 76 msgid "Subject:" 73 77 msgstr "제목:" 74 78 75 # ajaxcontact.php:14779 #: ../ajaxcontact.php:286 76 80 msgid "(Email subject)" 77 81 msgstr "( 이메일 제목 )" 78 82 79 # ajaxcontact.php:15083 #: ../ajaxcontact.php:289 80 84 msgid "Success:" 81 85 msgstr "성공:" 82 86 83 # ajaxcontact.php:15287 #: ../ajaxcontact.php:291 84 88 msgid "(Success message)" 85 89 msgstr "( 발송 성공 메세지 )" 86 90 87 # ajaxcontact.php:15591 #: ../ajaxcontact.php:294 88 92 msgid "Error:" 89 93 msgstr "오류:" 90 94 91 # ajaxcontact.php:15795 #: ../ajaxcontact.php:296 92 96 msgid "(Failure message)" 93 97 msgstr "( 발송 오류 메세지 )" 94 98 95 # ajaxcontact.php:17099 #: ../ajaxcontact.php:299 96 100 msgid "Check email:" 97 101 msgstr "메일주소 검사:" 98 102 99 # ajaxcontact.php:172103 #: ../ajaxcontact.php:301 100 104 msgid "If checked, it will check email address is valid" 101 105 msgstr "(체크하시면 이메일 주소가 형식에 맞는지 검사합니다.)" 102 106 103 # ajaxcontact.php:175107 #: ../ajaxcontact.php:304 104 108 msgid "Check email domain:" 105 109 msgstr "메일주소 도메인 검사:" 106 110 107 # ajaxcontact.php:177111 #: ../ajaxcontact.php:306 108 112 msgid "(You must make sure \"Check email\" is \"Checked\".)" 109 113 msgstr "( 메일주소 검사 설정이 체크되어있어야 작동합니다. )" 110 114 111 # ajaxcontact.php:178115 #: ../ajaxcontact.php:307 112 116 msgid "(If checked, it will block email address like someone@" 113 117 msgstr "( 체크하시면, 메일아이디@" 114 118 115 # ajaxcontact.php:178119 #: ../ajaxcontact.php:307 116 120 msgid " - almost SPAM)" 117 121 msgstr " 와 같은 메일주소를 거부하게됩니다 - 대부분이 스팸 )" 118 122 119 # ajaxcontact.php:183123 #: ../ajaxcontact.php:312 120 124 msgid "Reset Options" 121 125 msgstr "설정 초기화" 122 126 123 # ajaxcontact.php:184127 #: ../ajaxcontact.php:313 124 128 msgid "Update Options" 125 129 msgstr "설정 업데이트" 126 130 127 # ajaxcontact.php:196 131 #: ../ajaxcontact.php:325 132 msgid "Your E-mail could not be sent." 133 msgstr "이메일을 발송 할 수 없습니다." 134 135 #: ../ajaxcontact.php:327 136 msgid "check your email address. " 137 msgstr "이메일 주소를 확인하세요." 138 139 #: ../ajaxcontact.php:328 140 msgid "check your website URL. " 141 msgstr "누리집주소를 확인하세요" 142 143 #: ../ajaxcontact.php:329 144 msgid "check your message text. " 145 msgstr "메일 내용을 확인하세요." 146 147 #: ../ajaxcontact.php:346 128 148 msgid "Name (required):" 129 149 msgstr "이름 (필수):" 130 150 131 # ajaxcontact.php:198151 #: ../ajaxcontact.php:348 132 152 msgid "Email (required):" 133 153 msgstr "전자우편 (필수):" 134 154 135 # ajaxcontact.php:200155 #: ../ajaxcontact.php:350 136 156 msgid "Website:" 137 157 msgstr "누리집 주소:" 138 158 139 # ajaxcontact.php:196159 #: ../ajaxcontact.php:352 140 160 msgid "Message (required):" 141 161 msgstr "내용 (필수):" 142 162 163 #~ msgid "You E-mail is defined as spam. " 164 #~ msgstr "발송하려는 메일이 스팸인것으로 보입니다." 165 -
ajaxcontact/trunk/r/aj-contact.php
r233 r401 1 <?php require_once('../../../../wp-config.php'); 1 <?php 2 $wp_root = preg_replace( '|wp-content/plugins.*$|','', str_replace('\\', '/', __FILE__) ); 3 if (is_file($wp_root . 'wp-load.php')) { 4 require_once($wp_root . 'wp-load.php'); 5 } else { 6 require_once($wp_root . 'wp-config.php'); 7 } 2 8 if(!class_exists('ajaxContactForm')) die('There is no AjaxContactForm plugin'); 3 9 header('Content-Type: text/html; charset: '.get_option('blog_charset').''); … … 6 12 // call instance of plugin 7 13 $AjaxContact =& ajaxContactForm::get_instance(); 8 14 $use_mail = $wp_version < '2.2';// Wordpress, greater than 2.2 has the ability to encode mail headers to utf-8 9 15 $pname = stripslashes(trim($_POST['acfName'])); 10 16 $pemail = stripslashes(trim($_POST['acfEmail'])); … … 12 18 $text = stripslashes($_POST['acfText']); 13 19 $ip = $_SERVER["REMOTE_ADDR"]; 14 $pfrom = '=?utf-8?b?'.base64_encode($pname).'?=';20 $pfrom = $use_mail ? '=?utf-8?b?'.base64_encode($pname).'?=' : $pname; 15 21 $redirect_to = stripslashes($_POST['acfRedirect']); 16 $success = '0'; 17 $valid_mail = '0'; 18 $valid_site = '0'; 19 ?> 20 <?php 21 if ($AjaxContact->check_email($pemail) && $AjaxContact->check_site($psite)) { 22 $valid_mail = '1'; 23 $valid_site = '1'; 24 $to = $AjaxContact->op['email']; 25 $subject = $AjaxContact->op['subject'] . $pname; 26 $message = $pname .' wrote:'."\n"; 27 $message .= wordwrap($text, 64, "\n") . "\n\n"; 28 $message .= "Website: " . $psite . "\n"; 29 $message .= "IP: " . $ip . " (host: ".gethostbyaddr($ip).")"; 30 $headers = "MIME-Version: 1.0\n" . 31 $headers .= "From: ".$pfrom." <".$pemail.">". "\n" . 32 $headers .= "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 22 $success = 0;
