Changeset 401

Show
Ignore:
Timestamp:
08/06/08 23:29:49 (5 months ago)
Author:
082net
Message:

## ajaxcontact ##

Supports WP 2.5 or later
Requires WP 2.1 or later
Added jQuery script
Supports Akismet spam check

Location:
ajaxcontact/trunk
Files:
2 added
2 removed
7 modified

Legend:

Unmodified
Added
Removed
  • ajaxcontact/trunk

    • Property svn:ignore set to
      TODO
  • ajaxcontact/trunk/ajaxcontact.php

    r233 r401  
    55Description: 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 &lt;!--contact form--&gt; 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> 
    66Author: Cheon, Young-Min 
    7 Version: 1.3 
     7Version: 1.4 
    88Author URI: http://082net.com/ 
    99*//* 
     
    3737*/ 
    3838 
    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 <?php 
    66         } 
    67         add_action('admin_footer', 'ajaxcontact_warning'); 
    68         endif; // If plugin manage page. 
    69         return; 
    70 } 
    71  
    7239class ajaxContactForm { 
    73         var $version = '1.3'; 
     40        var $version = '1.4'; 
    7441        var $myhost; 
    7542        var $pluginURL; 
    7643        var $op; 
    7744        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'; 
    7946 
    8047        function ajaxContactForm() { 
    8148                load_plugin_textdomain('ajaxcontact', 'wp-content/plugins/ajaxcontact/lang'); 
     49                $this->init(); 
     50        } 
     51 
     52        function init() { 
    8253                $this->pluginURL = get_option('siteurl').'/wp-content/plugins/ajaxcontact'; 
    8354                $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'); 
    9264                foreach($this->op as $k => $v) { 
    9365                        if(in_array($k, $need_strip)) 
    9466                                $this->op[$k] = stripslashes($this->op[$k]); 
    9567                } 
     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; 
    9683        } 
    9784 
    9885        function activate_plugin() { 
    9986                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(); 
    11088                        update_option("acf_options", $this->op); 
    11189                } 
     
    129107        } 
    130108 
    131         function add_head() { 
     109        function wp_head() { 
    132110                if (!$this->op['contact_page_only'] || is_page($this->op['contact_page'])) { 
    133111                        $r = "\n\t" . '<!-- Added by Ajax Contact Form -->'."\n"; 
     
    137115        } 
    138116 
     117        function akismet_available() { 
     118                return function_exists('akismet_http_post'); 
     119        } 
     120 
    139121        function wp_scripts_available() { 
     122                return false; 
    140123                $op = get_option('wp_scripts'); 
    141124                if(class_exists('wpInsertScripts') && is_array($op) && $op['baselib'] == 'mootools') 
    142125                        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                } 
    143154                return false; 
    144155        } 
     
    157168                                $this->op['js_lib'] = 'prototype'; 
    158169                                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'); 
    164178                endif; 
    165179        } 
     
    194208                        $this->op['contact_page'] = (int)$_POST['contact_page']; 
    195209                        if($this->op['checkdomain']) $this->op['checkemail'] = 1; 
     210                        $this->op['akismet'] = (int)$_POST['akismet_check']; 
    196211                        update_option('acf_options', $this->op); 
    197212                } else if (isset($_POST['reset_options'])) { 
     
    211226 
    212227                <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">  
    214229      <tr valign="top">  
    215230        <th width="20%" scope="row"><?php _e('Update Check:', 'ajaxcontact') ?></th>  
    216231        <td> 
    217232                                <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> 
    220235                                </select><br /> 
    221236                                <?php _e('Automatically check if plugin update is available', 'ajaxcontact'); ?></td> 
    222237                        </tr> 
    223 <?php if($this->wp_scripts_available()) { ?> 
    224238      <tr valign="top">  
    225239        <th width="20%" scope="row"><?php _e('Base Javascirpt:', 'ajaxcontact') ?></th>  
    226240        <td> 
    227241                                <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 } ?> 
    230247         </select><br /> &mdash;  
    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> 
    236250      <tr valign="top">  
    237251        <th width="20%" scope="row"><?php _e('Contact Page Only:', 'ajaxcontact') ?></th>  
    238252        <td> 
    239253                                <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> 
    242256                                </select> &mdash; 
    243257                                <?php _e('My Contact Page:', 'ajaxcontact'); ?> <select name="contact_page"> 
     
    251265                                <?php _e('Set this true if you want use contact-form only on "Contact" page. And select your page', 'ajaxcontact'); ?></td> 
    252266                        </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 } ?> 
    253278      <tr valign="top">  
    254279        <th width="20%" scope="row"><?php _e('E-mail:', 'ajaxcontact') ?></th>  
     
    285310                </fieldset> 
    286311    <p class="submit"> 
    287     <input style="float:left;margin-left:5%;" type="submit" name="reset_options" value="<?php _e('Reset Options', 'ajaxcontact') ?> &raquo;" /> 
     312    <!-- <input style="float:left;margin-left:5%;" type="submit" name="reset_options" value="<?php _e('Reset Options', 'ajaxcontact') ?> &raquo;" /> --> 
    288313    <input type="submit" name="update_options" value="<?php _e('Update Options', 'ajaxcontact') ?> &raquo;" /> 
    289314    </p> 
     
    294319 
    295320        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'] : ''; 
    297322                $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"; 
    315342                $text .= "\t" . '<div><div id="acf_container">' . "\n"; 
    316343                $text .= "\t" . '<form action="'.$this->pluginURL.'/r/aj-contact.php" method="post" id="acfForm" onsubmit="acf_sendMail(); return false;">' . "\n"; 
     
    392419add_action('admin_menu', array(&$AjaxContact, 'add_options')); 
    393420add_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')); 
     421add_action('wp_head', array(&$AjaxContact, 'enqueue_scripts'), 0); 
     422add_action('wp_head', array(&$AjaxContact, 'wp_head'), 99); 
    396423unset($AjaxContact); 
    397424?> 
  • ajaxcontact/trunk/js/aj-contact-prototype.js

    r233 r401  
    11function acf_sendMail() { 
     2        if(!$('acfForm')) 
     3                return; 
    24        var url = $('acfForm').action +"?ajax=true"; 
    35        var pars = "&" + Form.serialize($('acfForm')); 
  • ajaxcontact/trunk/lang

    • Property svn:ignore set to
      ajaxcontact.mo
  • ajaxcontact/trunk/lang/ajaxcontact-ko_KR.po

    r233 r401  
    11msgid "" 
    22msgstr "" 
    3 "Plural-Forms: s\n" 
    43"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" 
    77"Last-Translator: 082net <082net@gmail.com>\n" 
    88"Language-Team: 082NeT <082net@gmail.com>\n" 
    99"MIME-Version: 1.0\n" 
    10 "Content-Type: text/plain; charset=utf-8\n" 
     10"Content-Type: text/plain; charset=UTF-8\n" 
    1111"Content-Transfer-Encoding: 8bit\n" 
     12"Plural-Forms: s\n" 
    1213"X-Poedit-Language: Korean\n" 
    1314"X-Poedit-Country: KOREA, REPUBLIC OF\n" 
     
    1516"X-Poedit-KeywordsList: __;_e\n" 
    1617"X-Poedit-Basepath: .\n" 
    17 "X-Poedit-SearchPath-0: \n" 
    1818 
    19 # ajaxcontact.php:43 
    20 msgid "AjaxContactForm is not active" 
    21 msgstr "AjaxContactFrom이 제대로 작동하지 않습니다" 
     19#: ../ajaxcontact.php:77 
     20msgid "You E-mail is defined as spam by <a href=\"http://akismet.com\">Akismet</a>. " 
     21msgstr "<a href=\"http://akismet.com\">Akismet</a>에의해 스팸으로 인식되었습니다." 
    2222 
    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 
    2824msgid "There is a plugin update available" 
    2925msgstr "플러그인이 업데이트 되었습니다." 
    3026 
    31 # ajaxcontact.php:133 
     27#: ../ajaxcontact.php:223 
    3228msgid "AjaxContact Options" 
    3329msgstr "AjaxContact Options" 
    3430 
    35 # ajaxcontact.php:191 
     31#: ../ajaxcontact.php:230 
    3632msgid "Update Check:" 
    3733msgstr "업데이트 확인:" 
    3834 
    39 # ajaxcontact.php:197 
     35#: ../ajaxcontact.php:236 
    4036msgid "Automatically check if plugin update is available" 
    4137msgstr "이 페이지를 표시 할 때 마다 자동으로 업데이트를 확인합니다." 
    4238 
    43 # ajaxcontact.php:145 
     39#: ../ajaxcontact.php:239 
    4440msgid "Base Javascirpt:" 
    4541msgstr "기본 자바스크립트:" 
    4642 
    47 # ajaxcontact.php:151 
     43#: ../ajaxcontact.php:248 
    4844msgid "Select javascript library you want to use." 
    4945msgstr "사용하고자 하는 자바스크립트를 선택하세요." 
    5046 
    51 # ajaxcontact.php:213 
     47#: ../ajaxcontact.php:251 
    5248msgid "Contact Page Only:" 
    5349msgstr "Contact 페이지 전용:" 
    5450 
    55 # ajaxcontact.php:219 
     51#: ../ajaxcontact.php:257 
    5652msgid "My Contact Page:" 
    5753msgstr "내 블로그의 Contact 페이지:" 
    5854 
    59 # ajaxcontact.php:227 
     55#: ../ajaxcontact.php:265 
    6056msgid "Set this true if you want use contact-form only on \"Contact\" page. And select your page" 
    6157msgstr "Contact 페이지에서만 AjaxContactForm을 사용하려면 true 로 설정하신 뒤 해당 페이지를 설정하세요." 
    6258 
    63 # ajaxcontact.php:140 
     59#: ../ajaxcontact.php:269 
     60msgid "Akismet Check:" 
     61msgstr "Akismet 사용:" 
     62 
     63#: ../ajaxcontact.php:275 
     64msgid "Automatically check if mail is spam" 
     65msgstr "메일을 발송하기전에 Akismet을 이용해 스팸확인" 
     66 
     67#: ../ajaxcontact.php:279 
    6468msgid "E-mail:" 
    6569msgstr "이메일:" 
    6670 
    67 # ajaxcontact.php:142 
     71#: ../ajaxcontact.php:281 
    6872msgid "(\"To\" email address(your email))" 
    6973msgstr "( 받는메일 )" 
    7074 
    71 # ajaxcontact.php:145 
     75#: ../ajaxcontact.php:284 
    7276msgid "Subject:" 
    7377msgstr "제목:" 
    7478 
    75 # ajaxcontact.php:147 
     79#: ../ajaxcontact.php:286 
    7680msgid "(Email subject)" 
    7781msgstr "( 이메일 제목 )" 
    7882 
    79 # ajaxcontact.php:150 
     83#: ../ajaxcontact.php:289 
    8084msgid "Success:" 
    8185msgstr "성공:" 
    8286 
    83 # ajaxcontact.php:152 
     87#: ../ajaxcontact.php:291 
    8488msgid "(Success message)" 
    8589msgstr "( 발송 성공 메세지 )" 
    8690 
    87 # ajaxcontact.php:155 
     91#: ../ajaxcontact.php:294 
    8892msgid "Error:" 
    8993msgstr "오류:" 
    9094 
    91 # ajaxcontact.php:157 
     95#: ../ajaxcontact.php:296 
    9296msgid "(Failure message)" 
    9397msgstr "( 발송 오류 메세지 )" 
    9498 
    95 # ajaxcontact.php:170 
     99#: ../ajaxcontact.php:299 
    96100msgid "Check email:" 
    97101msgstr "메일주소 검사:" 
    98102 
    99 # ajaxcontact.php:172 
     103#: ../ajaxcontact.php:301 
    100104msgid "If checked, it will check email address is valid" 
    101105msgstr "(체크하시면 이메일 주소가 형식에 맞는지 검사합니다.)" 
    102106 
    103 # ajaxcontact.php:175 
     107#: ../ajaxcontact.php:304 
    104108msgid "Check email domain:" 
    105109msgstr "메일주소 도메인 검사:" 
    106110 
    107 # ajaxcontact.php:177 
     111#: ../ajaxcontact.php:306 
    108112msgid "(You must make sure \"Check email\" is \"Checked\".)" 
    109113msgstr "( 메일주소 검사 설정이 체크되어있어야 작동합니다. )" 
    110114 
    111 # ajaxcontact.php:178 
     115#: ../ajaxcontact.php:307 
    112116msgid "(If checked, it will block email address like someone@" 
    113117msgstr "( 체크하시면, 메일아이디@" 
    114118 
    115 # ajaxcontact.php:178 
     119#: ../ajaxcontact.php:307 
    116120msgid " - almost SPAM)" 
    117121msgstr " 와 같은 메일주소를 거부하게됩니다 - 대부분이 스팸 )" 
    118122 
    119 # ajaxcontact.php:183 
     123#: ../ajaxcontact.php:312 
    120124msgid "Reset Options" 
    121125msgstr "설정 초기화" 
    122126 
    123 # ajaxcontact.php:184 
     127#: ../ajaxcontact.php:313 
    124128msgid "Update Options" 
    125129msgstr "설정 업데이트" 
    126130 
    127 # ajaxcontact.php:196 
     131#: ../ajaxcontact.php:325 
     132msgid "Your E-mail could not be sent." 
     133msgstr "이메일을 발송 할 수 없습니다." 
     134 
     135#: ../ajaxcontact.php:327 
     136msgid "check your email address. " 
     137msgstr "이메일 주소를 확인하세요." 
     138 
     139#: ../ajaxcontact.php:328 
     140msgid "check your website URL. " 
     141msgstr "누리집주소를 확인하세요" 
     142 
     143#: ../ajaxcontact.php:329 
     144msgid "check your message text. " 
     145msgstr "메일 내용을 확인하세요." 
     146 
     147#: ../ajaxcontact.php:346 
    128148msgid "Name (required):" 
    129149msgstr "이름 (필수):" 
    130150 
    131 # ajaxcontact.php:198 
     151#: ../ajaxcontact.php:348 
    132152msgid "Email (required):" 
    133153msgstr "전자우편 (필수):" 
    134154 
    135 # ajaxcontact.php:200 
     155#: ../ajaxcontact.php:350 
    136156msgid "Website:" 
    137157msgstr "누리집 주소:" 
    138158 
    139 # ajaxcontact.php:196 
     159#: ../ajaxcontact.php:352 
    140160msgid "Message (required):" 
    141161msgstr "내용 (필수):" 
    142162 
     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__) ); 
     3if (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} 
    28if(!class_exists('ajaxContactForm')) die('There is no AjaxContactForm plugin'); 
    39header('Content-Type: text/html; charset: '.get_option('blog_charset').''); 
     
    612// call instance of plugin 
    713$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 
    915$pname = stripslashes(trim($_POST['acfName'])); 
    1016$pemail = stripslashes(trim($_POST['acfEmail'])); 
     
    1218$text = stripslashes($_POST['acfText']); 
    1319$ip = $_SERVER["REMOTE_ADDR"]; 
    14 $pfrom = '=?utf-8?b?'.base64_encode($pname).'?='; 
     20$pfrom = $use_mail ? '=?utf-8?b?'.base64_encode($pname).'?=' : $pname; 
    1521$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;