ID; $table_name = WPAM_AFFILIATES_TBL; $affiliate = $wpdb->get_row("SELECT * FROM $table_name WHERE userId = '$user_id' AND status = 'active'"); $record_found = true; if(!$affiliate){ $record_found = false; } $table_name = WPAM_CREATIVES_TBL; $default_creative_id = get_option(WPAM_PluginConfig::$DefaultCreativeId); $creative = ''; if(empty($default_creative_id)){ $record_found = false; } else{ $creative = $wpdb->get_row("SELECT * FROM $table_name WHERE creativeId = '$default_creative_id'"); if(!$creative){ $record_found = false; } } $alink = ''; $alink_id = ''; $alink_email = ''; if($record_found){ $aid = $affiliate->affiliateId; $alink_id = add_query_arg( array( WPAM_PluginConfig::$RefKey => $aid ), home_url('/') ); $aemail = $affiliate->email; $alink_email = add_query_arg( array( WPAM_PluginConfig::$RefKey => $aemail ), home_url('/') ); $trackingKey = new WPAM_Tracking_TrackingKey(); $trackingKey->setAffiliateRefKey($affiliate->uniqueRefKey); $trackingKey->setCreativeId($creative->creativeId); $alink = add_query_arg( array( WPAM_PluginConfig::$RefKey => $trackingKey->pack() ), home_url('/') ); } ****/ $db = new WPAM_Data_DataAccess(); $currentUser = wp_get_current_user(); $alink_id = ''; $aff_id = ''; $affiliateRepos = $db->getAffiliateRepository(); $affiliate = $affiliateRepos->loadBy(array('userId' => $currentUser->ID, 'status' => 'active')); if ( $affiliate === NULL ) { //affiliate with this WP User ID does not exist return; } $default_url = home_url('/'); $aff_landing_page = get_option(WPAM_PluginConfig::$AffLandingPageURL); if(isset($aff_landing_page) && !empty($aff_landing_page)){ $default_url = $aff_landing_page; } $aff_id = $affiliate->affiliateId; $alink_id = add_query_arg( array( WPAM_PluginConfig::$wpam_id => $aff_id ), $default_url ); if(isset($_REQUEST['wpam_link_generation_url'])) { $default_url = esc_url_raw($_REQUEST['wpam_link_generation_url']); } ?>

'.__('Referral URL Generator', 'affiliates-manager').''; $output .= ''; $custom_content = ''; $custom_content = apply_filters('wpam_after_referral_url_generator', $custom_content, $aff_id); //show custom content if (!empty($custom_content)) { $output .= $custom_content; } echo $output; ?>

viewData['creatives'] as $creative) { ?> type == 'image'){ $creative_url = '?page_id='.get_the_ID().'&sub=creatives&action=detail&creativeId='.$creative->creativeId; ?> creativeId; ?>
type ?> name) ?>