Plugin Directory

Changeset 2344825


Ignore:
Timestamp:
07/22/2020 03:02:05 PM (6 years ago)
Author:
nickjamescom
Message:

*Added Social Media Post Feature
*Bug fixes for APM data save to master websute
*Version update

Location:
apm-child/trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • apm-child/trunk/admin/classes/ESP.Class.php

    r2331496 r2344825  
    481481        $getresponse_custom_field  = $recordCrediantial['getresponse_custom_field'];
    482482       
     483       
     484        $postdata = array(
     485            'mode' => 'update_affiliates',
     486            'user_email_id' => $user_email_id,
     487            'first_name' => $first_name,
     488            'last_name' => $last_name,
     489            'jv_zoo_id' => $jv_zoo_id,
     490            'aweber_auth_code' => $aweber_auth_code,
     491            'clickmagick_tracking_code' => $clickmagick_tracking_code,
     492            'consumerKey' => $consumerKey,
     493            'consumerSecret' => $consumerSecret,
     494            'accessKey' => $accessKey,
     495            'accessSecret' => $accessSecret,
     496            'aweber_account_number' => $aweber_account_number,
     497            'email' => $email,
     498            'version' => $GLOBALS['APM_SUBSCRIPTION_VER'],
     499            'email_service_provider' => $email_service_provider,
     500            'clickbank_affiliate_nickname' => $clickbank_affiliate_nickname,
     501            'warriorplus_aff_id' => $warriorplus_aff_id,
     502            'sendeagle_api_key' => $sendeagle_api_key,
     503            'sendeagle_company_unique_id' => $sendeagle_company_unique_id,
     504            'sendeagle_company_name' => $sendeagle_company_name,
     505            'jvz_infusionsoft_app_name' => $jvz_infusionsoft_app_name,
     506            'jvz_infusionsoft_api_key' => $jvz_infusionsoft_api_key,
     507            'getresponse_api_key' => $getresponse_api_key,
     508            'getresponse_custom_field' => $getresponse_custom_field,
     509        );
     510       
    483511        if($type ==  "update_aff_setting")
    484512        {
    485             $postdata = array(
    486                 'mode' => 'update_affiliates',
    487                 'user_email_id' => $user_email_id,
    488                 'first_name' => $first_name,
    489                 'last_name' => $last_name,
    490                 'jv_zoo_id' => $jv_zoo_id,
    491                 'aweber_auth_code' => $aweber_auth_code,
    492                 'clickmagick_tracking_code' => $clickmagick_tracking_code,
    493                 'consumerKey' => $consumerKey,
    494                 'consumerSecret' => $consumerSecret,
    495                 'accessKey' => $accessKey,
    496                 'accessSecret' => $accessSecret,
    497                 'aweber_account_number' => $aweber_account_number,
     513            $postdata_updae = array(
     514                'esp_list_id' => $esp_list_id,
    498515                'funnel_id' => $funnel_id,
    499                 'email' => $email,
    500                 'version' => $GLOBALS['APM_SUBSCRIPTION_VER'],
    501                 'email_service_provider' => $email_service_provider,
    502                 'clickbank_affiliate_nickname' => $clickbank_affiliate_nickname,
    503                 'warriorplus_aff_id' => $warriorplus_aff_id,
    504                 'sendeagle_api_key' => $sendeagle_api_key,
    505                 'sendeagle_company_unique_id' => $sendeagle_company_unique_id,
    506                 'sendeagle_company_name' => $sendeagle_company_name,
    507                 'esp_list_id' => $esp_list_id,
    508                 'jvz_infusionsoft_app_name' => $jvz_infusionsoft_app_name,
    509                 'jvz_infusionsoft_api_key' => $jvz_infusionsoft_api_key,
    510                 'getresponse_api_key' => $getresponse_api_key,
    511                 'getresponse_custom_field' => $getresponse_custom_field,
    512             );
    513         }
    514         else
    515         {
    516             $postdata = array(
    517                 'mode' => 'update_affiliates',
    518                 'user_email_id' => $user_email_id,
    519                 'first_name' => $first_name,
    520                 'last_name' => $last_name,
    521                 'email' => $email,
    522                 'jv_zoo_id' => $jv_zoo_id,
    523                 'clickbank_affiliate_nickname' => $clickbank_affiliate_nickname,
    524                 'warriorplus_aff_id' => $warriorplus_aff_id,
    525                 'email_service_provider' => $email_service_provider,
    526                 'version' => $GLOBALS['APM_SUBSCRIPTION_VER'],
    527             );
    528         }
     516            );
     517           
     518            $postdata = array_merge($postdata, $postdata_updae);
     519        }
     520   
    529521   
    530522        $args = array(
  • apm-child/trunk/affiliate-jvzoo-ipn-listener.php

    r2331496 r2344825  
    2323       
    2424        //---> This Query Does Duplicate Checking of Same Transaction ID // This was added by kailash because JVZoo IPN was sending duplicate data for same transaction
    25         $egSql = "SELECT * FROM ".$wpdb->prefix."cso_my_income` WHERE `inc_ctransreceipt` = '".addslashes_gpc(sanitize_text_field($_REQUEST['ctransreceipt']))."'";
     25        $egSql = "SELECT * FROM `".$wpdb->prefix."cso_my_income` WHERE `inc_ctransreceipt` = '".addslashes_gpc(sanitize_text_field($_REQUEST['ctransreceipt']))."'";
    2626        $egRecord = array();
    2727        $egRecord = $wpdb->get_results($egSql, ARRAY_A);
     
    3636       
    3737       
    38        
    3938        if(count($egRecord) <= 0)
    4039        {
     
    4544           
    4645            $wpdb->query($sql);
     46            $insert_id = $wpdb->insert_id;
     47            //fwrite($fp, "\n".$sql);
    4748           
    48             //fwrite($fp, "\n".$sql);
     49            $apm_post_schedule = get_option('apm_apm_post_schedule');
     50           
     51            if( $apm_post_schedule == 'Instant' )
     52            {
     53                create_post_for_social_media(array("income_id" => $insert_id));
     54            }
    4955        }
     56       
    5057       
    5158        if(!isset($_REQUEST['mode']) && $_REQUEST['mode'] != 'jvzoo_ipn_listner')
  • apm-child/trunk/css/apm-style.css

    r2331496 r2344825  
    1010.txt-apmboxarea{width:100%; height:80px;}
    1111.txt-apmbox{margin-bottom:10px; height:28px}
     12
     13.frm_share_success .txt-apmbox{max-width:300px; width:100%;}
     14
     15.frm_share_success .row-full-width > label{
     16    font-weight: 700;
     17    font-size: 16px;
     18    margin-bottom: 10px;
     19}
     20
    1221.form-area{width:70%; float:left; margin-top:30px;}
    1322.form-row{width:100%; float:left;}
     
    7786    }
    7887   
    79 
     88.frm_share_success{
     89    max-width:750px;
     90}
    8091
    8192/* The apm_radio_container */
     93
     94.frm_share_success .apm_radio_container{
     95    display:block !important;
     96}
     97
     98.frm_share_success .apm_radio_container,
    8299.frm_notification_settings .apm_radio_container {
    83100  display: inline-block;
     
    92109  user-select: none;
    93110  margin-right:10px;
     111  font-weight:400 !important
    94112}
    95113
  • apm-child/trunk/functions/core-function.php

    r2331496 r2344825  
    4141}
    4242
     43
     44
     45function create_post_for_social_media($arr_request_val)
     46{
     47    require_once( ABSPATH . "wp-includes/pluggable.php" );
     48
     49    global $wpdb;
     50   
     51    $income_id = $arr_request_val['income_id'];
     52   
     53    $apm_post_schedule = get_option('apm_apm_post_schedule');
     54    $apm_cron_daily  = get_option('apm_apm_cron_daily');
     55    $apm_cron_weekly = get_option('apm_apm_cron_weekly');
     56    $apm_cron_weekly_time = get_option('apm_cron_weekly_time');
     57    $share_success_category = get_option('apm_share_success_category');
     58    $social_share_message = get_option('apm_social_share_message');
     59    $share_success_headline = get_option('apm_share_success_headline');
     60   
     61    //--> create category whne it is not selected at settings page
     62    if($share_success_category == '')
     63    {
     64        $parent_term = term_exists( 'social' );
     65        if(!$parent_term)
     66        {
     67            wp_insert_term(
     68                'Social',
     69                'category',
     70                array(
     71                  'description' => 'This category will be used for APM Social Media Posting.',
     72                  'slug'        => 'social'
     73                )
     74            );
     75        }
     76       
     77        $social_category = get_category_by_slug('social');
     78        $share_success_category = $social_category->term_id;
     79    }
     80   
     81    //--> Create Post Title and Body
     82   
     83    if($apm_post_schedule == 'Instant')
     84    $post_title = date("H:i");
     85   
     86    if($apm_post_schedule == 'Daily')
     87    $post_title = $apm_cron_daily;
     88   
     89    if($apm_post_schedule == 'Weekly')
     90    $post_title = $apm_cron_weekly.'-'.$apm_cron_weekly_time;
     91   
     92    $post_title = $share_success_headline.' '.$post_title;
     93   
     94   
     95    //--> Affiliate Information
     96    $egSqlCrediantial = "SELECT * FROM `".$wpdb->prefix."cso_options` WHERE 1";
     97    $record = array();
     98    $recordCrediantial = $wpdb->get_row($egSqlCrediantial, ARRAY_A);
     99   
     100
     101    //--> Get Information of income.
     102    if($income_id > 0)
     103    {
     104        //--> Instant
     105        $egSql = "SELECT * FROM `".$wpdb->prefix."cso_my_income` WHERE ID = '".$income_id."'";
     106        $egRecord = $wpdb->get_row($egSql, ARRAY_A);
     107       
     108        $inc_ctransamount = $egRecord['inc_ctransamount'];
     109        $inc_commision_amt = $egRecord['inc_commision_amt'];
     110    }
     111    else
     112    {
     113        //--> Daily and Weekly
     114       
     115        $egSql = "SELECT * FROM `".$wpdb->prefix."cso_my_income` WHERE social_post_created = 'No'";
     116        $egRecords =   $wpdb->get_results($egSql, ARRAY_A);
     117       
     118        $inc_ctransamount = 0;
     119        $inc_commision_amt = 0;
     120       
     121        foreach ($egRecords as $egRecord)
     122        {
     123            $inc_ctransamount += $egRecord['inc_ctransamount'];
     124            $inc_commision_amt += $egRecord['inc_commision_amt'];
     125           
     126            $egUpdate = $wpdb->prepare("UPDATE ".$wpdb->prefix."cso_my_income SET `social_post_created` = 'Yes' WHERE ID = %s ", array($record->ID));
     127            $wpdb->query($egUpdate);       
     128        }
     129    }
     130   
     131       
     132    $inc_ctransamount  = number_format($inc_ctransamount, 2, '.', '');
     133    $inc_commision_amt = number_format($inc_commision_amt, 2, '.', '');
     134   
     135    //--> Post Body
     136    $social_share_message = wpautop($social_share_message);
     137   
     138    $social_share_message = str_replace("[Platform]", $egRecord['inc_income_type'], $social_share_message);
     139    $social_share_message = str_replace("[Vendor]", $egRecord['inc_ctransvendor'], $social_share_message);
     140    $social_share_message = str_replace("[CustomerName]", $egRecord['inc_ccustname'], $social_share_message);
     141    $social_share_message = str_replace("[CustomerEmail]", $egRecord['inc_ccustemail'], $social_share_message);
     142    $social_share_message = str_replace("[AffiliateName]", $recordCrediantial['first_name'].' '.$recordCrediantial['last_name'], $social_share_message);
     143    $social_share_message = str_replace("[AffiliateID]", $egRecord['inc_ctransaffiliate'], $social_share_message);
     144    $social_share_message = str_replace("[Clickid]", $egRecord['inc_caffitid'], $social_share_message);
     145    $social_share_message = str_replace("[ItemName]", $egRecord['inc_cprodtitle'], $social_share_message);
     146    $social_share_message = str_replace("[SalesAmount]", $inc_ctransamount, $social_share_message);
     147    $social_share_message = str_replace("[CommissionAmount]", $inc_commision_amt, $social_share_message);
     148
     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 );
     162    return true;
     163}
     164   
     165
     166
    43167/**** Plugin Menu *****/
    44168
     
    78202   
    79203    add_submenu_page( 'apm-child', __( 'List Lead Orders', 'apm-child' ), __( 'List Lead Orders', 'apm-child' ), $role, 'apm_orders', 'apm_subscription_options' );
     204   
    80205    add_submenu_page( 'apm-child', __( 'List Solo Ad Orders', 'apm-child' ), __( 'List Solo Ad Orders', 'apm-child' ), $role, 'apm_my_solo_income', 'apm_subscription_options' );
    81206   
     207    add_submenu_page( 'apm-child', __( 'Share Your Success', 'apm-child' ), __( 'Share Your Success', 'apm-child' ), $role, 'share_your_success', 'apm_subscription_options' );
     208   
    82209    add_submenu_page( 'apm-child', __( 'Logout', 'apm-child' ), __( 'Logout', 'apm-child' ), $role, 'apm_logout', 'apm_subscription_options' );
    83210}
  • apm-child/trunk/functions/database-function.php

    r2331496 r2344825  
    9494        cron_status ENUM('Yes', 'No') NOT NULL DEFAULT 'No',
    9595        inc_income_type ENUM('JvZoo', 'ClickBank', 'Warrior') NOT NULL DEFAULT 'JvZoo',
    96         income_source ENUM('Master', 'Child') NOT NULL DEFAULT 'Master'
     96        income_source ENUM('Master', 'Child') NOT NULL DEFAULT 'Master',
     97        social_post_created ENUM('Yes', 'No') NOT NULL DEFAULT 'No'
    9798    )$charset_collate;";
    9899    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
  • apm-child/trunk/mc-main.php

    r2331496 r2344825  
    99Author: Nick James
    1010E-mail: admin@nickjamesadmin.com
    11 Version: 2.6
     11Version: 2.7
    1212Author URI: http://www.pluginpixie.com
    1313*/
    1414//ini_set('display_errors',1);
    1515global $APM_SUBSCRIPTION_VER;
    16 $APM_SUBSCRIPTION_VER = "2.6";
     16$APM_SUBSCRIPTION_VER = "2.7";
    1717
    1818define('APM_SUBSCRIPTION_PATH', plugins_url().'/'. basename(dirname(__FILE__)).'/');
     
    4141register_activation_hook( __FILE__, 'apm_subscription_init' );
    4242
     43
    4344function apm_subscription_options()
    4445{
     
    9192        case 'apm_info':
    9293            include('admin/apm-info.php');
     94            break;
     95        case 'share_your_success':
     96            include('admin/share-your-success.php');
    9397            break;
    9498        case 'apm_logout':
     
    153157}
    154158
    155 
    156159add_action( 'ws_cron_hook', 'execute_jvzoo_affiliate_commission' );
    157160if ( ! wp_next_scheduled( 'ws_cron_hook' ) ) {
     
    159162}
    160163
     164
     165/* Social Media posting CRON */
     166
     167function apm_social_media_cron_schedule( $schedules ) {
     168   
     169    $apm_post_schedule = get_option('apm_apm_post_schedule');
     170   
     171   
     172    if($apm_post_schedule == 'Weekly')
     173    {
     174        $apm_cron_weekly = get_option('apm_apm_cron_weekly');
     175        $apm_cron_weekly = strtotime("next ".$apm_cron_weekly);
     176       
     177        $schedules['weekly'] = array(
     178            'interval' => $apm_cron_weekly,
     179            'display'  => __( 'Every Weekly' ),
     180        );
     181       
     182    }
     183   
     184    return $schedules;
     185}
     186add_filter( 'cron_schedules', 'apm_social_media_cron_schedule' );
     187
     188
     189//--> Schedule an action if it's not already scheduled
     190$apm_post_schedule = get_option('apm_apm_post_schedule');
     191
     192if($apm_post_schedule == 'Daily')
     193{
     194    wp_clear_scheduled_hook( 'apm_social_post_weekly_cron_hook' );
     195   
     196    if ( ! wp_next_scheduled( 'apm_social_post_daily_cron_hook' ) )
     197    {
     198        $apm_cron_daily  = get_option('apm_apm_cron_daily');
     199        wp_schedule_event( strtotime($apm_cron_daily), 'daily', 'apm_social_post_daily_cron_hook' );
     200    }
     201}
     202
     203if($apm_post_schedule == 'Weekly')
     204{
     205    wp_clear_scheduled_hook( 'apm_social_post_daily_cron_hook' );
     206   
     207    if ( ! wp_next_scheduled( 'apm_social_post_weekly_cron_hook' ) )
     208    {
     209        $apm_cron_weekly_time = get_option('apm_cron_weekly_time');
     210        wp_schedule_event( strtotime($apm_cron_weekly_time), 'weekly', 'apm_social_post_weekly_cron_hook' );
     211    }
     212}
     213
     214
     215///Hook into that action that'll fire every day
     216add_action( 'apm_social_post_daily_cron_hook', 'apm_social_post_daily_cron' );
     217function apm_social_post_daily_cron() {
     218    create_post_for_social_media(array("income_id" => 0));
     219}
     220
     221
     222///Hook into that action that'll fire every week
     223add_action( 'apm_social_post_weekly_cron_hook', 'apm_social_post_weekly_cron' );
     224function apm_social_post_weekly_cron() {
     225    create_post_for_social_media(array("income_id" => 0));
     226}
     227
     228
    161229function apm_powered_by_arpreach_aweber() {
    162230  $content = '<div class="powered-by-alert">Powered By Aweber.com and ARPreach.com</div>';
     
    171239    wp_register_script('apm_child_autosearch', plugins_url('scripts/autosearch.min.js', __FILE__), array('jquery'),'1.1', true);
    172240    wp_enqueue_script('apm_child_autosearch');
     241
    173242}
    174243
     
    182251    wp_register_style('amp_child_autosearch', plugins_url('css/autosearch.min.css', __FILE__));
    183252    wp_enqueue_style('amp_child_autosearch');
     253   
    184254}
    185255add_action( 'admin_enqueue_scripts', 'apm_child_styles' );
  • apm-child/trunk/readme.txt

    r2331496 r2344825  
    183183*Minor Update
    184184*Version update
     185
     1862.7
     187*Added Social Media Post Feature
     188*Bug fixes for APM data save to master websute
     189*Version update
  • apm-child/trunk/scripts/apm-settings.js

    r2327903 r2344825  
    101101
    102102
     103
    103104jQuery(document).ready(function(){
    104105   
    105106    // Initialize select2
    106107    jQuery(".infusionsoft_lists").select2();
    107 
     108   
     109    /*jQuery("#apm-filter-date").datetimepicker({
     110        datepicker:false,
     111        format: 'H:i',
     112        formatTime: 'H:i',
     113    });
     114   
     115    jQuery("#apm-filter-time").datetimepicker({
     116        datepicker:false,
     117        format: 'H:i',
     118        formatTime: 'H:i',
     119    });*/
     120   
     121   
    108122});
    109123 
Note: See TracChangeset for help on using the changeset viewer.