Plugin Directory

Changeset 2447180


Ignore:
Timestamp:
12/29/2020 05:47:29 AM (5 years ago)
Author:
nickjamescom
Message:

2.9
*Fix Bugs od success story
*Version update

Location:
apm-child/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apm-child/trunk/add-manual-commission.php

    r2262951 r2447180  
    1919       
    2020        $sql = $wpdb->prepare("INSERT INTO `".$wpdb->prefix."cso_my_income`
    21                          (`inc_caffitid`, `inc_cprodtype`, `inc_ccustname`, `inc_cprodtitle`, `inc_ctransamount`, `inc_commision_amt`, `inc_ctranspaymentmethod`, `inc_ctransreceipt`, `inc_processed`, `income_date`, `cron_status`, `inc_income_type`)
    22                          VALUES(%s, %s, %s, %s, %s, %s, %s, %s, 'No', NOW(), 'Yes', 'Manual')",
    23                          array(addslashes_gpc(sanitize_text_field($_REQUEST['caffitid'])), addslashes_gpc(sanitize_text_field($_REQUEST['cprodtype'])), addslashes_gpc(sanitize_text_field($_REQUEST['ccustname'])), addslashes_gpc(sanitize_text_field($_REQUEST['cprodtitle'])), addslashes_gpc(sanitize_text_field($_REQUEST['ctransamount'])), addslashes_gpc(sanitize_text_field($_REQUEST['commission_amount'])), addslashes_gpc(sanitize_text_field($_REQUEST['ctranspaymentmethod'])), addslashes_gpc(sanitize_text_field($_REQUEST['ctransreceipt']))  ));
     21                         (`inc_caffitid`, `inc_cprodtype`, `inc_ccustname`, `inc_cprodtitle`, `inc_ctransamount`, `inc_commision_amt`, `inc_ctranspaymentmethod`, `inc_ctransreceipt`, `inc_processed`, `income_date`, `cron_status`, `inc_income_type`, `income_date`)
     22                         VALUES(%s, %s, %s, %s, %s, %s, %s, %s, 'No', NOW(), 'Yes', 'Manual', %s)",
     23                         array(addslashes_gpc(sanitize_text_field($_REQUEST['caffitid'])), addslashes_gpc(sanitize_text_field($_REQUEST['cprodtype'])), addslashes_gpc(sanitize_text_field($_REQUEST['ccustname'])), addslashes_gpc(sanitize_text_field($_REQUEST['cprodtitle'])), addslashes_gpc(sanitize_text_field($_REQUEST['ctransamount'])), addslashes_gpc(sanitize_text_field($_REQUEST['commission_amount'])), addslashes_gpc(sanitize_text_field($_REQUEST['ctranspaymentmethod'])), addslashes_gpc(sanitize_text_field($_REQUEST['ctransreceipt'])), $TodaysDate));
    2424        $wpdb->query($sql);
    2525       
  • apm-child/trunk/functions/core-function.php

    r2344825 r2447180  
    5959    $share_success_headline = get_option('apm_share_success_headline');
    6060   
    61     //--> create category whne it is not selected at settings page
     61    //--> create category when it is not selected at settings page
    6262    if($share_success_category == '')
    6363    {
    6464        $parent_term = term_exists( 'social' );
     65       
    6566        if(!$parent_term)
    6667        {
     
    9899    $recordCrediantial = $wpdb->get_row($egSqlCrediantial, ARRAY_A);
    99100   
    100 
    101101    //--> Get Information of income.
    102102    if($income_id > 0)
     
    108108        $inc_ctransamount = $egRecord['inc_ctransamount'];
    109109        $inc_commision_amt = $egRecord['inc_commision_amt'];
     110       
     111        $egUpdate = $wpdb->prepare("UPDATE ".$wpdb->prefix."cso_my_income SET `social_post_created` = 'Yes' WHERE ID = %s ", array($income_id));
     112        $wpdb->query($egUpdate);   
    110113    }
    111114    else
     
    113116        //--> Daily and Weekly
    114117       
    115         $egSql = "SELECT * FROM `".$wpdb->prefix."cso_my_income` WHERE social_post_created = 'No'";
     118        $success_story_last_execution_time = get_option('success_story_last_execution_time');
     119       
     120        $egSql = "SELECT * FROM `".$wpdb->prefix."cso_my_income` WHERE social_post_created = 'No' AND income_date > '".$success_story_last_execution_time."' ";
    116121        $egRecords =   $wpdb->get_results($egSql, ARRAY_A);
    117122       
     
    132137    $inc_ctransamount  = number_format($inc_ctransamount, 2, '.', '');
    133138    $inc_commision_amt = number_format($inc_commision_amt, 2, '.', '');
     139   
     140   
     141    //--> Replace Title short code
     142   
     143    $post_title = str_replace("[Platform]", $egRecord['inc_income_type'], $post_title);
     144    $post_title = str_replace("[Vendor]", $egRecord['inc_ctransvendor'], $post_title);
     145    $post_title = str_replace("[CustomerName]", $egRecord['inc_ccustname'], $post_title);
     146    $post_title = str_replace("[CustomerEmail]", $egRecord['inc_ccustemail'], $post_title);
     147    $post_title = str_replace("[AffiliateName]", $recordCrediantial['first_name'].' '.$recordCrediantial['last_name'], $post_title);
     148    $post_title = str_replace("[AffiliateID]", $egRecord['inc_ctransaffiliate'], $post_title);
     149    $post_title = str_replace("[Clickid]", $egRecord['inc_caffitid'], $post_title);
     150    $post_title = str_replace("[ItemName]", $egRecord['inc_cprodtitle'], $post_title);
     151    $post_title = str_replace("[SalesAmount]", $inc_ctransamount, $post_title);
     152    $post_title = str_replace("[CommissionAmount]", $inc_commision_amt, $post_title);
     153   
     154   
    134155   
    135156    //--> Post Body
     
    147168    $social_share_message = str_replace("[CommissionAmount]", $inc_commision_amt, $social_share_message);
    148169
    149     $page_data = array(
    150             'post_status'    => 'publish',
    151             'post_type'      => 'post',
    152             'post_author'    => 1,
    153             'post_name'      => $post_title,
    154             'post_title'     => $post_title,
    155             'post_content'   => $social_share_message,
    156             'post_parent'    => '',
    157             'post_category' => array( $share_success_category ),
    158             'comment_status' => 'closed',
    159     );
    160    
    161     wp_insert_post( $page_data );
     170    if($inc_ctransamount > 0)
     171    {
     172        $page_data = array(
     173                'post_status'    => 'publish',
     174                'post_type'      => 'post',
     175                'post_author'    => 1,
     176                'post_name'      => $post_title,
     177                'post_title'     => $post_title,
     178                'post_content'   => $social_share_message,
     179                'post_parent'    => '',
     180                'post_category' => array( $share_success_category ),
     181                'comment_status' => 'closed',
     182        );
     183       
     184        wp_insert_post( $page_data );
     185    }
     186       
     187    $TodaysDate = date('Y-m-d H:i:s');
     188    update_option('success_story_last_execution_time', $TodaysDate);
     189   
    162190    return true;
    163191}
  • apm-child/trunk/mc-main.php

    r2389762 r2447180  
    99Author: Nick James
    1010E-mail: admin@nickjamesadmin.com
    11 Version: 2.8
     11Version: 2.9
    1212Author URI: http://www.pluginpixie.com
    1313*/
    1414//ini_set('display_errors',1);
    1515global $APM_SUBSCRIPTION_VER;
    16 $APM_SUBSCRIPTION_VER = "2.8";
     16$APM_SUBSCRIPTION_VER = "2.9";
    1717
    1818define('APM_SUBSCRIPTION_PATH', plugins_url().'/'. basename(dirname(__FILE__)).'/');
  • apm-child/trunk/readme.txt

    r2389762 r2447180  
    193193*Dispaying Buyers Email at my income page
    194194*Version update
     195
     1962.9
     197*Fix Bugs od success story
     198*Version update
Note: See TracChangeset for help on using the changeset viewer.