Home › Forums › Legacy Support › Support queries › Setup issues › MyCred issue
Tagged: mycred
- This topic has 9 replies, 2 voices, and was last updated 3 years, 6 months ago by Anshuman Sahu.
Viewing 10 posts - 1 through 10 (of 10 total)
-
AuthorPosts
-
April 28, 2021 at 5:17 pm #355009ednerSpectatorHello, 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.April 28, 2021 at 5:18 pm #355010ednerSpectatorThis reply has been marked as private.April 29, 2021 at 3:03 pm #355204Anshuman SahuKeymasterplease 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 ); } });
April 30, 2021 at 2:15 am #355241ednerSpectatorNot work https://prnt.sc/12a5ds9 > https://prnt.sc/12a5f9bApril 30, 2021 at 1:58 pm #355399Anshuman SahuKeymasterOk the code adds the shortcode : you need to use this shortcode : [mycred_link]April 30, 2021 at 6:39 pm #355433ednerSpectatorI changed [mycred_affiliate_link] for [mycred_link] but not work Alex.April 30, 2021 at 7:48 pm #355437ednerSpectatorThis reply has been marked as private.May 1, 2021 at 3:10 pm #355561Anshuman SahuKeymasterOk 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.'"]'); } });
May 1, 2021 at 7:20 pm #355572ednerSpectatorCould 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/May 3, 2021 at 2:19 pm #355751Anshuman SahuKeymasterok 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.'"]')); } });
-
AuthorPosts
Viewing 10 posts - 1 through 10 (of 10 total)
- The topic ‘MyCred issue’ is closed to new replies.