MyCred issue

Home Forums Legacy Support Support queries Setup issues MyCred issue

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #355009
    edner
    Spectator
    Hello, Check this screenshot: https://prnt.sc/125c7gd. This is where I put the mycred short code [mycred_affiliate_link] to display the user referral link. As you can see it puts a zero instead of the link. The short code is very well. Access the backend to check all is ok. I think there is an issue with WPLMS V4. The mycred module is very helpful for us. We want to give point to student to help us recruit more student. I already discuss the registration problem with Alex [Working on it: https://trello.com/c/CcZ5y7sE]. For the V4 the registration via firebase (social login) is very helpful but not compatible with mycred (give points for member referral) We need you to help resolving that.
    #355010
    edner
    Spectator
    This reply has been marked as private.
    #355204
    Anshuman Sahu
    Keymaster
    please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
    add_shortcode('mycred_link',function($atts,$content){
    	if(bp_displayed_user_id()){
    		$user_id = bp_displayed_user_id();
    	}else{
    		global $members_template;
    		if(!empty($members_template->member)){
    			$user_id = $members_template->member->id;
    		}
    	}
    	if(empty($user_id)){
    		$init = VibeBP_Init::init();
    		if(!empty($init->user_id)){
    			$user_id = $init->user_id;
    		}else{
    			$user_id = get_current_user_id();
    		}
    	}
    	if(!empty($user_id) && class_exists('myCRED_Hook_Affiliate')){
    		$init = new myCRED_Hook_Affiliate();
    	
    		return $init->get_ref_link( $user_id, $url );
    	}
    	
    });
    #355241
    edner
    Spectator
    Not work https://prnt.sc/12a5ds9 > https://prnt.sc/12a5f9b
    #355399
    Anshuman Sahu
    Keymaster
    Ok the code adds the shortcode : you need to use this shortcode : [mycred_link]
    #355433
    edner
    Spectator
    I changed [mycred_affiliate_link] for [mycred_link] but not work Alex.
    #355437
    edner
    Spectator
    This reply has been marked as private.
    #355561
    Anshuman Sahu
    Keymaster
    Ok try this code : TESTED and works : use new shortcode : [mycred_linked]
    add_shortcode('mycred_linked',function($atts,$content){
    	if(bp_displayed_user_id()){
    		$user_id = bp_displayed_user_id();
    	}else{
    		global $members_template;
    		if(!empty($members_template->member)){
    			$user_id = $members_template->member->id;
    		}
    	}
    	if(empty($user_id)){
    		$init = VibeBP_Init::init();
    		if(!empty($init->user_id)){
    			$user_id = $init->user_id;
    		}else{
    			$user_id = get_current_user_id();
    		}
    	}
    	
    	if(!empty($user_id) && class_exists('myCRED_Hook_Affiliate')){
    		
    	
    		return do_shortcode('[mycred_affiliate_link user_id="'.$user_id.'"]');
    	}
    	
    });	
    #355572
    edner
    Spectator
    Could you send me a screenshot of your test worked? You need to fix the domain now: https://prnt.sc/12d8bpo Should be https://oukaap.com/?mref=charlee and not /wp-json/vbp/v1/profile/?mref=charlee /wp-json/vbp/v1/profile/ > https://oukaap.com/
    #355751
    Anshuman Sahu
    Keymaster
    ok simple to fix please use this code :
    add_shortcode('mycred_linked',function($atts,$content){
    	if(bp_displayed_user_id()){
    		$user_id = bp_displayed_user_id();
    	}else{
    		global $members_template;
    		if(!empty($members_template->member)){
    			$user_id = $members_template->member->id;
    		}
    	}
    	if(empty($user_id)){
    		$init = VibeBP_Init::init();
    		if(!empty($init->user_id)){
    			$user_id = $init->user_id;
    		}else{
    			$user_id = get_current_user_id();
    		}
    	}
    	
    	if(!empty($user_id) && class_exists('myCRED_Hook_Affiliate')){
    		
    	
    		return str_replace('/wp-json/vbp/v1/profile/','https://oukaap.com/',do_shortcode('[mycred_affiliate_link user_id="'.$user_id.'"]'));
    	}
    	
    });
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘MyCred issue’ is closed to new replies.