WordPress.org

Ready to get started?Download WordPress

Forums

myCRED
[resolved] Show ranks but not balance (4 posts)

  1. fbenver
    Member
    Posted 6 months ago #

    Hello everyone,

    I was wondering, is it possible to make the ranks on profiles visible for everyone while keeping the balance of the person private?

    Thanks to everyone in advance.

    Kind regards.

    http://wordpress.org/plugins/mycred/

  2. Gabriel
    Member
    Plugin Author

    Posted 5 months ago #

    Hi.

    You can set the visibility for users balances on the myCRED > Settings page under the BuddyPress tab. Make sure "Members can view each others token balance." is not checked.

    You can set the rank visibility under "Ranks" on the same page.

  3. fbenver
    Member
    Posted 5 months ago #

    Hello Gabriel,

    I have done that.

    My current settings are:

    Under myCRED > Settings > BuddyPress: I already had the "Members can view each others token balance" unchecked.

    At Settings > Ranks > Public : (checked this box)
    If you want to create a template archive for each rank, you must select to have ranks public. Defaults to disabled.

    It only shows the ranks when the members can view each others token balance.

    But I want the ranks to be shown without other members view the token balance.

    Please let me know how I can solve this problem.

    Thank you very much in advance.

    Kind regards,

  4. Gabriel
    Member
    Plugin Author

    Posted 5 months ago #

    Making Ranks Public has nothing to do with visibility.
    If enabled, the custom post type "Ranks" will have an archive and you will be able to display all available ranks on your website. If disabled, ranks will not have an archive and with that, users will not see all ranks.

    Note that I am talking about the post type archive and not what rank a user has.

    If you visit the myCRED website, I have enabled Ranks to be public, which means that you can view all ranks you can have on our website by visiting http://mycred.me/members/ranks/.

    Now, myCRED can either show each users rank only to the user (and admin) or to other members. myCRED will NOT show users ranks to visitors (non members). You would need to add this yourself by hooking into BuddyPress or WordPress and show the rank in the appropriate place.

    To show a users rank you simply use the mycred_get_users_rank function which by default shows the users rank name but you can also use it to show the rank.

    Here is an example of inserting a users rank in their BuddyPress profile header:

    add_action( 'bp_before_member_header_meta', 'show_users_rank_in_header' );
    function show_users_rank_in_header() {
    	$user_id = bp_displayed_user_id();
    	if ( mycred_exclude_user( $user_id ) ) return;
    	$rank_name = mycred_get_users_rank( $user_id );
    	echo 'Rank: ' . $rank_name;
    }

Reply

You must log in to post.

About this Plugin

About this Topic

Tags