Changeset 2344825
- Timestamp:
- 07/22/2020 03:02:05 PM (6 years ago)
- Location:
- apm-child/trunk
- Files:
-
- 1 added
- 8 edited
-
admin/classes/ESP.Class.php (modified) (1 diff)
-
admin/share-your-success.php (added)
-
affiliate-jvzoo-ipn-listener.php (modified) (3 diffs)
-
css/apm-style.css (modified) (3 diffs)
-
functions/core-function.php (modified) (2 diffs)
-
functions/database-function.php (modified) (1 diff)
-
mc-main.php (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
-
scripts/apm-settings.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
apm-child/trunk/admin/classes/ESP.Class.php
r2331496 r2344825 481 481 $getresponse_custom_field = $recordCrediantial['getresponse_custom_field']; 482 482 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 483 511 if($type == "update_aff_setting") 484 512 { 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, 498 515 '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 529 521 530 522 $args = array( -
apm-child/trunk/affiliate-jvzoo-ipn-listener.php
r2331496 r2344825 23 23 24 24 //---> 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']))."'"; 26 26 $egRecord = array(); 27 27 $egRecord = $wpdb->get_results($egSql, ARRAY_A); … … 36 36 37 37 38 39 38 if(count($egRecord) <= 0) 40 39 { … … 45 44 46 45 $wpdb->query($sql); 46 $insert_id = $wpdb->insert_id; 47 //fwrite($fp, "\n".$sql); 47 48 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 } 49 55 } 56 50 57 51 58 if(!isset($_REQUEST['mode']) && $_REQUEST['mode'] != 'jvzoo_ipn_listner') -
apm-child/trunk/css/apm-style.css
r2331496 r2344825 10 10 .txt-apmboxarea{width:100%; height:80px;} 11 11 .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 12 21 .form-area{width:70%; float:left; margin-top:30px;} 13 22 .form-row{width:100%; float:left;} … … 77 86 } 78 87 79 88 .frm_share_success{ 89 max-width:750px; 90 } 80 91 81 92 /* 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, 82 99 .frm_notification_settings .apm_radio_container { 83 100 display: inline-block; … … 92 109 user-select: none; 93 110 margin-right:10px; 111 font-weight:400 !important 94 112 } 95 113 -
apm-child/trunk/functions/core-function.php
r2331496 r2344825 41 41 } 42 42 43 44 45 function 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 43 167 /**** Plugin Menu *****/ 44 168 … … 78 202 79 203 add_submenu_page( 'apm-child', __( 'List Lead Orders', 'apm-child' ), __( 'List Lead Orders', 'apm-child' ), $role, 'apm_orders', 'apm_subscription_options' ); 204 80 205 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' ); 81 206 207 add_submenu_page( 'apm-child', __( 'Share Your Success', 'apm-child' ), __( 'Share Your Success', 'apm-child' ), $role, 'share_your_success', 'apm_subscription_options' ); 208 82 209 add_submenu_page( 'apm-child', __( 'Logout', 'apm-child' ), __( 'Logout', 'apm-child' ), $role, 'apm_logout', 'apm_subscription_options' ); 83 210 } -
apm-child/trunk/functions/database-function.php
r2331496 r2344825 94 94 cron_status ENUM('Yes', 'No') NOT NULL DEFAULT 'No', 95 95 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' 97 98 )$charset_collate;"; 98 99 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); -
apm-child/trunk/mc-main.php
r2331496 r2344825 9 9 Author: Nick James 10 10 E-mail: admin@nickjamesadmin.com 11 Version: 2. 611 Version: 2.7 12 12 Author URI: http://www.pluginpixie.com 13 13 */ 14 14 //ini_set('display_errors',1); 15 15 global $APM_SUBSCRIPTION_VER; 16 $APM_SUBSCRIPTION_VER = "2. 6";16 $APM_SUBSCRIPTION_VER = "2.7"; 17 17 18 18 define('APM_SUBSCRIPTION_PATH', plugins_url().'/'. basename(dirname(__FILE__)).'/'); … … 41 41 register_activation_hook( __FILE__, 'apm_subscription_init' ); 42 42 43 43 44 function apm_subscription_options() 44 45 { … … 91 92 case 'apm_info': 92 93 include('admin/apm-info.php'); 94 break; 95 case 'share_your_success': 96 include('admin/share-your-success.php'); 93 97 break; 94 98 case 'apm_logout': … … 153 157 } 154 158 155 156 159 add_action( 'ws_cron_hook', 'execute_jvzoo_affiliate_commission' ); 157 160 if ( ! wp_next_scheduled( 'ws_cron_hook' ) ) { … … 159 162 } 160 163 164 165 /* Social Media posting CRON */ 166 167 function 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 } 186 add_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 192 if($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 203 if($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 216 add_action( 'apm_social_post_daily_cron_hook', 'apm_social_post_daily_cron' ); 217 function 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 223 add_action( 'apm_social_post_weekly_cron_hook', 'apm_social_post_weekly_cron' ); 224 function apm_social_post_weekly_cron() { 225 create_post_for_social_media(array("income_id" => 0)); 226 } 227 228 161 229 function apm_powered_by_arpreach_aweber() { 162 230 $content = '<div class="powered-by-alert">Powered By Aweber.com and ARPreach.com</div>'; … … 171 239 wp_register_script('apm_child_autosearch', plugins_url('scripts/autosearch.min.js', __FILE__), array('jquery'),'1.1', true); 172 240 wp_enqueue_script('apm_child_autosearch'); 241 173 242 } 174 243 … … 182 251 wp_register_style('amp_child_autosearch', plugins_url('css/autosearch.min.css', __FILE__)); 183 252 wp_enqueue_style('amp_child_autosearch'); 253 184 254 } 185 255 add_action( 'admin_enqueue_scripts', 'apm_child_styles' ); -
apm-child/trunk/readme.txt
r2331496 r2344825 183 183 *Minor Update 184 184 *Version update 185 186 2.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 101 101 102 102 103 103 104 jQuery(document).ready(function(){ 104 105 105 106 // Initialize select2 106 107 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 108 122 }); 109 123
Note: See TracChangeset
for help on using the changeset viewer.