Plugin Directory

Changeset 1466698


Ignore:
Timestamp:
08/03/2016 08:03:15 AM (10 years ago)
Author:
InTrigger
Message:

fixed deduped issue

Location:
intrigger/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • intrigger/trunk/inc/class-model-contacts.php

    r1406624 r1466698  
    6161        $current_date = date('Y-m-d');
    6262
    63         $contact_deduped = get_option('itrr_setting_contacts') == false ? "1" : get_option('itrr_setting_contacts');
    64 
    65         $result = true;
    66 
    67         if($contact_deduped) {
     63        $contact_deduped = get_option('itrr_setting_contacts');
     64        /* check if contact email already exists for dedupe setting */
     65        $check_query = "SELECT * FROM " .self::table_name ." WHERE email='".$data["email"]."';";
     66        $check_exist = $wpdb->get_results($check_query);
     67        if( $check_exist && $contact_deduped) {
    6868            // update
    6969            $query = 'UPDATE ' . self::table_name . ' ';
    7070            $query .= "SET scenario='{$data['scenario']}',indget='{$data['indget']}',page='{$data['page']}',date='{$current_date}' ";
    71             $query .= "WHERE email='" . $data['email'] . "';";
    72             $result = $wpdb->query($query);
     71            $query .= "WHERE email='" . $data['email'] . "' ORDER BY id DESC LIMIT 1;";
     72            $wpdb->query($query);
    7373        }
    74         if($result == false || $result === false || !$contact_deduped){
     74        else{
    7575            // insert
    7676            $query = 'INSERT INTO ' .  self::table_name  . ' ';
  • intrigger/trunk/intrigger.php

    r1455117 r1466698  
    44Plugin URI: http://intriggerapp.com/
    55Description: InTrigger Plugin allows webmasters to set up on-site personalization scenarios in order to generate more subscribers and conversions.
    6 Version: 1.0.4
     6Version: 1.0.5
    77Author: InTrigger
    88Author URI: http://intriggerapp.com/
  • intrigger/trunk/readme.txt

    r1455117 r1466698  
    1 === InTrigger - Conversion & Lead Generation ===
     1=== InTrigger - Conversion & Lead Generation ===
    22Contributors: InTrigger
    33
     
    120120* Fix statistics issue in Scenarios / Indgets pages
    121121= 1.0.3 =
    122 * Add Pages excluded rules
     122* add Pages excluded rules
    123123= 1.0.4 =
    124 * Fix deprecated jQuery function.
     124* fix duplicated jQuery function.
     125= 1.0.5 =
     126* fix deduped contacts issue.
Note: See TracChangeset for help on using the changeset viewer.