• Resolved nicholaus1221

    (@nicholaus1221)


    Hi,

    I’m really loving this plugin, I’m just scratching my head why the points of the user being viewed don’t show up in the profile header. I have the “Include in the profile tab and profile header” setting set and the one that works is the profile tab which is great, but I really need the user points visible in the profile header. I think my theme might be getting in the way a bit, is there any code that I could place on line 14 in the member-header.php file to display the points of the user being viewed?? Or if you have a better idea ??

    Thanks and really appreciate your excellent plugin, I will rate it 5 stars for sure!

    Nicholaus

    https://www.ads-software.com/plugins/mycred/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author myCred

    (@designbymerovingi)

    Hey.

    The balance is inserted into the BuddyPress Profile Header though the bp_before_member_header_meta action hook which in the default BuddyPress theme is inserted in the member-header.php file.

    So start by checking if this action hook is present in your theme file. If not, you have two options:

    A) Insert the action. This option will allow myCRED AND all other plugins that use this action to “hook in”:

    <?php do_action( 'bp_before_member_header_meta' ); ?>

    B) Insert a users balance directly:

    <?php
    if ( function_exists( 'mycred_get_settings' ) ) {
    	$user_id = bp_displayed_user_id();
    	$mycred = mycred_get_settings();
    	$balance = $mycred->get_users_cred( $user_id );
    	echo 'Your balance is ' . $mycred->format_creds( $balance );
    }
    ?>
    Thread Starter nicholaus1221

    (@nicholaus1221)

    Hey Gabriel,

    The code worked perfectly! Thank you!

    I have a couple more questions if it’s ok. One is, I was wondering if you had planned to provide compatibility with the Buddypress Wall plugin or the Facebook Like User Activity Stream for BuddyPress plugin from BuddyDev?

    Two, is there a shortcode for displaying all the ways for a user to get points and how many points it’s worth? (Like the history shortcode, but for users who haven’t done anything yet)

    And three, could you help with some additional code for the ranks add-on to display the users rank info in the profile header like what you gave me for the users balance info? I love the ranks add-on it keeps me from using the BadgeOs plugin which messes up my site a bit.

    Thanks for your help and awesome support,
    I’ll rank your plugin 5 stars right now ??
    Nicholaus

    Plugin Author myCred

    (@designbymerovingi)

    Hey.

    I was wondering if you had planned to provide compatibility with the Buddypress Wall plugin or the Facebook Like User Activity Stream for BuddyPress plugin from BuddyDev?

    I will add them to the list. Support for other plugins really depend on how that plugin was written. Not every plugin out there can be “hooked into” as myCRED needs to know when to award points.

    is there a shortcode for displaying all the ways for a user to get points and how many points it’s worth?

    Unfortunately no. I am however looking into adding this in future versions. Right now you would need to show this information “manually” by writing down all the active hooks you have and show the amount given.

    could you help with some additional code for the ranks add-on to display the users rank info in the profile header like what you gave me for the users balance info?

    Using the same code as above:

    if ( function_exists( 'mycred_get_users_rank' ) ) {
    	$user_id = bp_displayed_user_id();
    	echo 'Your current rank is:  ' . mycred_get_users_rank( $user_id );
    }

    Or if you want to show the rank “logo” (feature image):

    if ( function_exists( 'mycred_get_users_rank' ) ) {
    	$user_id = bp_displayed_user_id();
    	echo 'Your current rank is:  ' . mycred_get_users_rank( $user_id, 'logo' );
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘User Points Don't Show in Profile Header’ is closed to new replies.