Plugin Directory

Changeset 1259173


Ignore:
Timestamp:
10/04/2015 08:54:49 AM (10 years ago)
Author:
haruncpi
Message:

new version ready 1.1

Location:
wpcf/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wpcf/trunk/css/style.css

    r1150337 r1259173  
    1 input,textarea{
    2             width: 95%;
    3         }
    4         input[type='submit'],input[type='reset']
    5         {
    6             width: 20%;
    7             margin-top: 10px;
    8         }
    9         .error{
    10             color: #f00;
    11             display: block;
    12         }
     1#wpcf input,#wpcf textarea
     2{
     3    width: 100%;
     4    border-color: 999;
     5   
     6}
     7#wpcf input[type='submit'],#wpcf input[type='reset']
     8{
     9    width: 12%;
     10    border: none;
     11    border-radius: 3px;
     12    padding: 5px;
     13    margin-top: 10px;
     14}
     15.error
     16{
     17    color: #f00;
     18    display: block;
     19}
    1320
    14         #statusMsg{
    15             display: none;
    16         }
     21#statusMsg
     22{
     23    display: none;
     24}
  • wpcf/trunk/inc/ajaxWork.php

    r1150337 r1259173  
    11<?php
     2
    23// WordPress Ajax Call
    34add_action('wp_ajax_nopriv_wpcf_ajax', 'wpcf_ajax_callback');
     
    910    $subject=sanitize_text_field($_POST['txtSubject']);
    1011    $message=sanitize_text_field($_POST['txtMsg']);
    11 
     12    $answer=sanitize_text_field($_POST['txtAnswer']);
     13    $answerInSession=sanitize_text_field($_POST['txtSessionAnswer']);
     14   
    1215    // Send mail to
    1316    $mail_to=$a['to'];
     
    1922    $site_name= get_bloginfo('name');
    2023
    21     if(!empty($name) && !empty($email) && !empty($subject) && !empty($message))
     24    if(!empty($answer) && $answerInSession==md5($answer))
    2225    {
    23         $headers = "From: ".$site_name."<".$email.">\n";
    24         $headers .= "Return-Path: <".$email.">\n";
    25         $headers .= "Reply-To: <".$email.">\n";
    26         $body ="Sender : " .$name."\n";
    27         $body .="Message :" .$message."\n";
    28         //mail($mail_to,$subject,$message,$headers);
    29         wp_mail($mail_to, $subject, $body, $headers);
    30         echo "success";
    31        
     26        if(!empty($name) && !empty($email) && !empty($subject) && !empty($message))
     27        {
     28            $headers = "From: ".$site_name."<".$email.">\n";
     29            $headers .= "Return-Path: <".$email.">\n";
     30            $headers .= "Reply-To: <".$email.">\n";
     31            $body ="Sender : " .$name."\n";
     32            $body .="Message :" .$message."\n";
     33            //mail($mail_to,$subject,$message,$headers);
     34            wp_mail($mail_to, $subject, $body, $headers);
     35            echo "success";
     36           
     37        }
     38
     39        else
     40        {
     41            echo "All field required";
     42        }
    3243    }
    33 
    3444    else
    3545    {
    36         echo "All field required";
     46        echo "wrong_captcha";
    3747    }
     48   
    3849   
    3950    die("");
  • wpcf/trunk/js/function.js

    r1150337 r1259173  
    1 jQuery(document).ready(function() {
    2     //validattion
    3     jQuery(function() {
    4             jQuery("#wpcf").validate();
    5         })
    6         //end validation
    7 
    8     jQuery('#wpcf').submit(function(e) {
    9         var url = jQuery(this).attr('action');
    10         var data = jQuery(this).serialize();
    11 
    12         jQuery.ajax({
    13             type: "POST",
    14             url: url,
    15             data: data,
    16             success: function(data) {
    17                 if (data == 'success') {
    18                     jQuery('#wpcf').slideUp('slow');
    19                     jQuery('#statusMsg').html('Your message successfully send!');
    20                     jQuery('#statusMsg').css({
    21                         display: 'block',
    22                         color: 'green'
    23                     });
    24                 }
    25 
    26             },
    27             error: function(errorThrown) {
    28                 alert(errorThrown);
    29             }
    30 
    31         });
    32         return false;
    33 
    34     });
    35 });
     1jQuery(document).ready(function()
     2    {
     3        //validattion
     4        jQuery(function()
     5            {
     6                jQuery("#wpcf").validate();
     7            })
     8        //end validation
     9        jQuery('#wpcf').submit(function(e)
     10            {
     11                var url = jQuery(this).attr('action');
     12                var data = jQuery(this).serialize();
     13                jQuery.ajax(
     14                    {
     15                        type: "POST",
     16                        url: url,
     17                        data: data,
     18                        success: function(data)
     19                        {
     20                            console.log(data);
     21                            if (data == 'success')
     22                            {
     23                                jQuery('#wpcf').slideUp('slow');
     24                                jQuery('#statusMsg').html('Your message successfully send!');
     25                                jQuery('#statusMsg').css(
     26                                    {
     27                                        display: 'block',
     28                                        border: '1px solid green',
     29                                        padding: '10px',
     30                                        marginButtom: '10px',
     31                                        width: '100%',
     32                                        fontWeight:'bold',
     33                                        color: 'green'
     34                                    });
     35                            }
     36                            if (data =='wrong_captcha')
     37                            {
     38                                jQuery('#statusMsg').html('Wrong Captcha Answer');
     39                                jQuery('#statusMsg').css(
     40                                    {
     41                                        display: 'block',
     42                                        border: '1px solid red',
     43                                        padding: '10px',
     44                                        marginButtom: '10px',
     45                                        width: '100%',
     46                                        fontWeight:'bold',
     47                                        color: 'red'
     48                                    });
     49                            }
     50                        },
     51                        error: function(errorThrown)
     52                        {
     53                            alert(errorThrown);
     54                        }
     55                    });
     56                return false;
     57            });
     58    });
  • wpcf/trunk/readme.txt

    r1150341 r1259173  
    44Tags: wordpress contact form
    55Requires at least: 3.0
    6 Tested up to: 4.2
    7 Stable tag: trunk
     6Tested up to: 4.3
     7Stable tag: 1.1
    88
    99WPCF is a simple WordPress contact form. You can easily add this in your page,post anywhere with shortcode.
     
    2929  <span style="white-space: pre;"> </span>  Just add this shortcode in your post or page<strong> [wpcf]</strong>
    3030</div>
     31
     32== Changelog ==
     33
     34= 1.1 =
     35
     36* captcha included with contact form.
     37* some bug fix.
     38* some design changes. 
  • wpcf/trunk/wpcf.php

    r1150337 r1259173  
    44 * Plugin URI: http://learn24bd.com/portfolio/wpcf
    55 * Description: WPCF (Wordpress Contact Form) is simple contact form. You can add this in any where whare you need it. It support sortcode.
    6  * Version: 1.0
     6 * Version: 1.1
    77 * Author: Harun
    88 * Author URI: http://learn24bd.com
     
    1010 */
    1111
     12include 'inc/mc.php';
    1213/// Register Script
    1314function wpcf_load_scripts() {
     
    4950        <label for="txtMsg">Message</label>
    5051        <textarea name="txtMsg" id="" cols="30" rows="4" required></textarea>
     52        <?php putMcData(); ?>
     53        <label for="txtAnswer">Put answer of <?php echo getMcQuestion(); ?></label>
     54        <input type="text" name="txtAnswer" required style="width:50px;"><br>
     55       
     56        <input type="hidden" name="txtSessionAnswer" value="<?php echo md5(getMcAnswer());?>"/>
    5157       
    5258        <input type="submit" value="Send">
Note: See TracChangeset for help on using the changeset viewer.