'.__("Affiliate registration is disabled. Please contact the administrator.", 'affiliates-manager').''; return; } $request = @$this->viewData['request']; if(is_user_logged_in()){ //this block checks whether the user is logged in and already has an affiliate account global $wpdb; $current_user = wp_get_current_user(); $user_id = $current_user->ID; $query = "SELECT * FROM ".WPAM_AFFILIATES_TBL." WHERE userId = %d"; $affiliate = $wpdb->get_row($wpdb->prepare($query, $user_id)); if($affiliate != null) { //The affiliate has an account already echo '