Changeset 2963072
- Timestamp:
- 09/05/2023 12:14:30 PM (3 years ago)
- Location:
- apm-child/trunk
- Files:
-
- 6 edited
-
admin/share-your-success.php (modified) (9 diffs)
-
affiliate-jvzoo-ipn-listener.php (modified) (1 diff)
-
functions/core-function.php (modified) (6 diffs)
-
mc-main.php (modified) (7 diffs)
-
optin-monster-settings.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
apm-child/trunk/admin/share-your-success.php
r2917796 r2963072 29 29 $form['share_success_headline'] = isset($_POST['share_success_headline']) ? sanitize_text_field($_POST['share_success_headline']) : ''; 30 30 $form['social_share_message'] = isset($_POST['social_share_message']) ? wp_kses_post(stripslashes($_POST['social_share_message'])) : ''; 31 $form['set_success_story_amount'] = isset($_POST['set_success_story_amount']) ? wp_kses_post(stripslashes($_POST['set_success_story_amount'])) : ''; 32 $form['share_success_image'] = isset($_POST['share_success_image']) ? sanitize_text_field($_POST['share_success_image']) : ''; 31 33 32 34 update_option('apm_apm_cron_daily', $form['apm_cron_daily']); … … 37 39 update_option('apm_share_success_headline', $form['share_success_headline']); 38 40 update_option('apm_social_share_message', $form['social_share_message']); 41 update_option('apm_set_success_story_amount', $form['set_success_story_amount']); 42 update_option('apm_share_success_image', $form['share_success_image']); 39 43 } 40 44 … … 46 50 $share_success_headline = get_option('apm_share_success_headline'); 47 51 $social_share_message = get_option('apm_social_share_message'); 52 $set_success_story_amount = get_option('apm_set_success_story_amount'); 53 $share_success_image = get_option('apm_share_success_image'); 48 54 49 55 if($egmail_error_found == TRUE && isset($egmail_errors[0]) == TRUE) … … 78 84 <label class="apm_radio_container">Daily<input type="radio" <?php if ($apm_post_schedule == 'Daily'){?> checked="checked" <?php } ?> name="apm_post_schedule" value="Daily" onclick="apm_post_schedule_cron('daily');" /><span class="checkmark"></span></label> 79 85 <label class="apm_radio_container">Weekly<input type="radio" <?php if ($apm_post_schedule == 'Weekly'){?> checked="checked" <?php } ?> name="apm_post_schedule" value="Weekly" onclick="apm_post_schedule_cron('weekly');" /><span class="checkmark"></span></label> 86 <label class="apm_radio_container">Fix Price<input type="radio" <?php if ($apm_post_schedule == 'fixprice'){?> checked="checked" <?php } ?> name="apm_post_schedule" value="fixprice" onclick="apm_post_schedule_cron('fixprice');" /><span class="checkmark"></span></label> 80 87 <label class="apm_radio_container">Turn Off<input type="radio" <?php if ($apm_post_schedule == 'TurnOff'){?> checked="checked" <?php } ?> name="apm_post_schedule" value="TurnOff" onclick="apm_post_schedule_cron('TurnOff');" /><span class="checkmark"></span></label> 81 88 </div> … … 112 119 <option value="Sun" <?php if($apm_cron_week == 'Sun'){?> selected="selected" <?php } ?>>Sun</option> 113 120 </select> 121 114 122 <!--<input style="width:100px;" class="txt-apmbox" id="apm-filter-date" type="text" name="apm_cron_weekly" value="<?php echo $apm_cron_weekly; ?>" />--> 115 123 … … 130 138 <p>Choose as per GMT Time Zone</p> 131 139 </div> 132 140 141 142 <div class="row-full-width apm_schedule_cron" id="apm_cron_fixprice" style="display:none;"> 143 <label for="share_success_headline">Set Target Amount</label> 144 <strong style="font-size: 16px;">$</strong><input type="number" class="txt-apmbox" min="0" id="set_success_story_amount" name="set_success_story_amount" value="<?php echo $set_success_story_amount;?>" /> 145 <span style="display: block; font-style: italic;">When the commission amount reaches this threshold, a new post will be triggered.</span> 146 </div> 133 147 134 148 <div class="row-full-width hide-on-turn-off"> … … 161 175 <input type="text" class="txt-apmbox" id="share_success_headline" name="share_success_headline" value="<?php echo $share_success_headline;?>" /> 162 176 </div> 177 178 <div class="row-full-width hide-on-turn-off"> 179 <label for="share_success_headline">Post Feature Image URL</label> 180 <input type="text" class="txt-apmbox" id="share_success_image" name="share_success_image" value="<?php echo $share_success_image;?>" style="max-width:600px" /> 181 </div> 163 182 164 183 <div class="row-full-width hide-on-turn-off"> … … 183 202 </div> 184 203 <script> 204 185 205 function apm_post_schedule_cron(val) 186 206 { 187 207 if(val == "TurnOff" || val == "turnoff") 188 208 { 209 jQuery(".apm_schedule_cron").hide(); 189 210 jQuery(".hide-on-turn-off").hide(); 190 211 } … … 199 220 200 221 apm_post_schedule_cron('<?php echo strtolower($apm_post_schedule);?>'); 222 201 223 </script> -
apm-child/trunk/affiliate-jvzoo-ipn-listener.php
r2344825 r2963072 45 45 $wpdb->query($sql); 46 46 $insert_id = $wpdb->insert_id; 47 //fwrite($fp, "\n".$sql);48 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 }55 47 } 56 48 -
apm-child/trunk/functions/core-function.php
r2917821 r2963072 48 48 49 49 global $wpdb; 50 $flag_publish_post = false; 50 51 51 52 $income_id = $arr_request_val['income_id']; … … 58 59 $social_share_message = get_option('apm_social_share_message'); 59 60 $share_success_headline = get_option('apm_share_success_headline'); 61 $share_success_imageURL = get_option('apm_share_success_image'); 60 62 61 63 //--> create category when it is not selected at settings page … … 91 93 $post_title = $apm_cron_weekly.'-'.$apm_cron_weekly_time; 92 94 95 96 93 97 $post_title = $share_success_headline.' '.$post_title; 94 98 95 99 96 100 //--> Affiliate Information 101 102 97 103 $egSqlCrediantial = "SELECT * FROM `".$wpdb->prefix."cso_options` WHERE 1"; 98 104 $record = array(); 99 105 $recordCrediantial = $wpdb->get_row($egSqlCrediantial, ARRAY_A); 100 106 107 101 108 //--> Get Information of income. 102 109 if($income_id > 0) 103 110 { 111 104 112 //--> Instant 105 113 $egSql = "SELECT * FROM `".$wpdb->prefix."cso_my_income` WHERE ID = '".$income_id."'"; … … 110 118 111 119 $egUpdate = $wpdb->prepare("UPDATE ".$wpdb->prefix."cso_my_income SET `social_post_created` = 'Yes' WHERE ID = %s ", array($income_id)); 112 $wpdb->query($egUpdate); 120 $wpdb->query($egUpdate); 121 $flag_publish_post = true; 122 123 } 124 elseif($apm_post_schedule == 'fixprice') 125 { 126 $flag_publish_post = false; 127 128 $egSql = "SELECT * FROM `".$wpdb->prefix."cso_my_income` WHERE social_post_created = 'No'"; 129 $egRecords = $wpdb->get_results($egSql, ARRAY_A); 130 131 $inc_ctransamount = 0; 132 $inc_commision_amt = 0; 133 134 foreach ($egRecords as $egRecord) 135 { 136 $inc_ctransamount += $egRecord['inc_ctransamount']; 137 $inc_commision_amt += $egRecord['inc_commision_amt']; 138 139 $arr_income_ids[] = $egRecord['ID']; 140 141 if( $inc_commision_amt >= $set_success_story_amount ) 142 { 143 $flag_publish_post = true; 144 break; 145 } 146 } 113 147 } 114 148 else … … 130 164 131 165 $egUpdate = $wpdb->prepare("UPDATE ".$wpdb->prefix."cso_my_income SET `social_post_created` = 'Yes' WHERE ID = %s ", array($record->ID)); 166 $wpdb->query($egUpdate); 167 $flag_publish_post = true; 168 } 169 } 170 171 /* This is for the fix amount set */ 172 if( ( $inc_commision_amt >= $set_success_story_amount ) && count($arr_income_ids) > 0) 173 { 174 foreach($arr_income_ids as $income_ids) 175 { 176 $egUpdate = $wpdb->prepare("UPDATE ".$wpdb->prefix."cso_my_income SET `social_post_created` = 'Yes' WHERE ID = %s ", array($income_ids)); 132 177 $wpdb->query($egUpdate); 133 178 } … … 140 185 141 186 //--> 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 155 156 //--> Post Body 157 $social_share_message = wpautop($social_share_message); 158 159 $social_share_message = str_replace("[Platform]", $egRecord['inc_income_type'], $social_share_message); 160 $social_share_message = str_replace("[Vendor]", $egRecord['inc_ctransvendor'], $social_share_message); 161 $social_share_message = str_replace("[CustomerName]", $egRecord['inc_ccustname'], $social_share_message); 162 $social_share_message = str_replace("[CustomerEmail]", $egRecord['inc_ccustemail'], $social_share_message); 163 $social_share_message = str_replace("[AffiliateName]", $recordCrediantial['first_name'].' '.$recordCrediantial['last_name'], $social_share_message); 164 $social_share_message = str_replace("[AffiliateID]", $egRecord['inc_ctransaffiliate'], $social_share_message); 165 $social_share_message = str_replace("[Clickid]", $egRecord['inc_caffitid'], $social_share_message); 166 $social_share_message = str_replace("[ItemName]", $egRecord['inc_cprodtitle'], $social_share_message); 167 $social_share_message = str_replace("[SalesAmount]", $inc_ctransamount, $social_share_message); 168 $social_share_message = str_replace("[CommissionAmount]", $inc_commision_amt, $social_share_message); 169 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); 187 if($flag_publish_post == true) 188 { 189 $post_title = str_replace("[Platform]", $egRecord['inc_income_type'], $post_title); 190 $post_title = str_replace("[Vendor]", $egRecord['inc_ctransvendor'], $post_title); 191 $post_title = str_replace("[CustomerName]", $egRecord['inc_ccustname'], $post_title); 192 $post_title = str_replace("[CustomerEmail]", $egRecord['inc_ccustemail'], $post_title); 193 $post_title = str_replace("[AffiliateName]", $recordCrediantial['first_name'].' '.$recordCrediantial['last_name'], $post_title); 194 $post_title = str_replace("[AffiliateID]", $egRecord['inc_ctransaffiliate'], $post_title); 195 $post_title = str_replace("[Clickid]", $egRecord['inc_caffitid'], $post_title); 196 $post_title = str_replace("[ItemName]", $egRecord['inc_cprodtitle'], $post_title); 197 $post_title = str_replace("[SalesAmount]", $inc_ctransamount, $post_title); 198 $post_title = str_replace("[CommissionAmount]", $inc_commision_amt, $post_title); 199 200 201 202 //--> Post Body 203 $social_share_message = wpautop($social_share_message); 204 205 $social_share_message = str_replace("[Platform]", $egRecord['inc_income_type'], $social_share_message); 206 $social_share_message = str_replace("[Vendor]", $egRecord['inc_ctransvendor'], $social_share_message); 207 $social_share_message = str_replace("[CustomerName]", $egRecord['inc_ccustname'], $social_share_message); 208 $social_share_message = str_replace("[CustomerEmail]", $egRecord['inc_ccustemail'], $social_share_message); 209 $social_share_message = str_replace("[AffiliateName]", $recordCrediantial['first_name'].' '.$recordCrediantial['last_name'], $social_share_message); 210 $social_share_message = str_replace("[AffiliateID]", $egRecord['inc_ctransaffiliate'], $social_share_message); 211 $social_share_message = str_replace("[Clickid]", $egRecord['inc_caffitid'], $social_share_message); 212 $social_share_message = str_replace("[ItemName]", $egRecord['inc_cprodtitle'], $social_share_message); 213 $social_share_message = str_replace("[SalesAmount]", $inc_ctransamount, $social_share_message); 214 $social_share_message = str_replace("[CommissionAmount]", $inc_commision_amt, $social_share_message); 215 216 if($inc_ctransamount > 0) 217 { 218 $page_data = array( 219 'post_status' => 'publish', 220 'post_type' => 'post', 221 'post_author' => 1, 222 'post_name' => $post_title, 223 'post_title' => $post_title, 224 'post_content' => $social_share_message, 225 'post_parent' => '', 226 'post_category' => array( $share_success_category ), 227 'comment_status' => 'closed', 228 ); 229 230 $post_id = wp_insert_post( $page_data ); 231 232 233 234 $image = media_sideload_image( $share_success_imageURL, $post_id, $post_title, 'id' ); 235 set_post_thumbnail( $post_id, $image ); 236 237 238 } 239 240 $TodaysDate = date('Y-m-d H:i:s'); 241 update_option('success_story_last_execution_time', $TodaysDate); 242 } 189 243 190 244 return true; -
apm-child/trunk/mc-main.php
r2933347 r2963072 9 9 Author: Nick James 10 10 E-mail: admin@nickjamesadmin.com 11 Version: 3.6. 211 Version: 3.6.3 12 12 Author URI: http://www.pluginpixie.com 13 13 */ 14 14 15 15 global $APM_SUBSCRIPTION_VER; 16 $APM_SUBSCRIPTION_VER = "3.6. 2";16 $APM_SUBSCRIPTION_VER = "3.6.3"; 17 17 18 18 define('APM_SUBSCRIPTION_PATH', plugins_url().'/'. basename(dirname(__FILE__)).'/'); … … 22 22 define("APM_MASTER_PLUGIN_URL", "https://affiliatepromembership.com/"); 23 23 define('APM_PLUGIN_PATH', plugins_url() . '/apm-child/'); 24 25 require_once(ABSPATH . 'wp-admin/includes/media.php'); 26 require_once(ABSPATH . 'wp-admin/includes/file.php'); 27 require_once(ABSPATH . 'wp-admin/includes/image.php'); 24 28 25 29 … … 204 208 { 205 209 wp_clear_scheduled_hook( 'apm_social_post_weekly_cron_hook' ); 210 wp_clear_scheduled_hook( 'apm_social_post_regular_cron_hook' ); 206 211 207 212 if ( ! wp_next_scheduled( 'apm_social_post_daily_cron_hook' ) ) … … 215 220 { 216 221 wp_clear_scheduled_hook( 'apm_social_post_daily_cron_hook' ); 222 wp_clear_scheduled_hook( 'apm_social_post_regular_cron_hook' ); 217 223 218 224 if ( ! wp_next_scheduled( 'apm_social_post_weekly_cron_hook' ) ) … … 223 229 } 224 230 225 226 ///Hook into that action that'll fire every day 231 if($apm_post_schedule == 'Fix Price') 232 { 233 wp_clear_scheduled_hook( 'apm_social_post_weekly_cron_hook' ); 234 wp_clear_scheduled_hook( 'apm_social_post_daily_cron_hook' ); 235 236 if ( ! wp_next_scheduled( 'apm_social_post_regular_cron_hook' ) ) 237 { 238 wp_schedule_event( strtotime("23:30"), 'daily', 'apm_social_post_regular_cron_hook' ); 239 } 240 } 241 242 243 244 //--> Hook into that action that'll fire every day 227 245 add_action( 'apm_social_post_daily_cron_hook', 'apm_social_post_daily_cron' ); 228 246 function apm_social_post_daily_cron() { … … 231 249 232 250 233 // /Hook into that action that'll fire every week251 //--> Hook into that action that'll fire every week 234 252 add_action( 'apm_social_post_weekly_cron_hook', 'apm_social_post_weekly_cron' ); 235 253 function apm_social_post_weekly_cron() { … … 238 256 239 257 258 //--> Hook into that action that'll fire every day to target fix price 259 add_action( 'apm_social_post_regular_cron_hook', 'apm_social_post_daily_cron_fix_price' ); 260 function apm_social_post_daily_cron_fix_price() { 261 create_post_for_social_media(array("income_id" => 0)); 262 } 263 264 265 266 240 267 function apm_powered_by_arpreach_aweber() { 241 268 $content = '<div class="powered-by-alert">Powered By Aweber.com and ARPreach.com</div>'; -
apm-child/trunk/optin-monster-settings.php
r2933347 r2963072 98 98 $recaptcha_site_key = $resultList->google_recaptcha_key; 99 99 100 $recaptcha_key_message = ''; 101 102 if($recaptcha_site_key == '') 103 { 104 $recaptcha_key_message = "Google reCAPTCHA key has not assigned for this affiliate member."; 105 } 100 106 101 107 ?> … … 106 112 function OptinMonsterCustomVariables(app) 107 113 { 108 109 114 app.setCustomVariable('val_error_message', '<?php echo $recaptcha_key_message;?>'); 115 110 116 app.setCustomVariable('account_id', '<?php echo esc_html($recordCrediantial['aweber_account_number'],'apm-child')?>'); 111 117 … … 140 146 141 147 function anchorTest() 142 143 148 { 144 149 … … 208 213 209 214 215 216 210 217 211 218 </script> -
apm-child/trunk/readme.txt
r2933347 r2963072 236 236 Bug Fixes 237 237 *Version update 238 239 3.6.3 240 Share Your Success logic changed 241 Notice for Empty Google reCPATCHA Key 242 *Version update
Note: See TracChangeset
for help on using the changeset viewer.