WordPress.org

Support

Support » Plugins and Hacks » myCRED » Show to Points to Public visitors or not logged in Users

Show to Points to Public visitors or not logged in Users

  • Hi

    I’m trying to implement myCred with bbpress forum.

    I’m looking for a way to show the Users points and their rank on public for not logged in users. So that new users can know that their is a point system going on the forum.

    Currently i’m using this short code under my template to display the points
    <?php echo do_shortcode( '[mycred_my_balance login="" title="points - " title_el="" balance_el="" wrapper="1" type="dig_cash"]' ); ?>

    But it will only be show to the logged in users.

    How can i show this to all visitors logged in and Logged out users.

    Hoping to get an answer soon.

    Thanks

    https://wordpress.org/plugins/mycred/

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Gabriel

    @designbymerovingi

    Hi.

    That is correct, the mycred_my_balance shows the current users balance so using this shortcode will insert your point balance on all topics.

    You will need to get the authors ID and and use for example the mycred_get_users_fcred function to display that users balance formatted.

    Example:

    if ( function_exists( 'mycred_get_users_fcred' ) ) {
    	$topic_author = 1;
    	echo mycred_get_users_fcred( $topic_author );
    }

    Depending on where you are showing balances you can get the appropriate author ID with built-in bbPress functions.

    Hi

    Really thanks for the reply. That worked out pretty well.

    So i have now used –

    <?php if ( function_exists( ‘mycred_get_users_fcred’ ) ) {
    $topic_author = 1;
    $type = ‘dig_cash’;
    echo ‘Cash: ‘ . mycred_get_users_fcred( $topic_author, $type );
    } ?>

    and its displaying for both logged in and logged out users.

    But i see its also pulling the decimals in the points ( like3.00) which i have not used. I have set no decimal on the settings, but its show in decimal out here.

    * i’m displaying the second made point system

    Plugin Author Gabriel

    @designbymerovingi

    Hi Verma.

    If you see decimals, then your main point type is using decimals which is then enforced on all other point types you create.

    You could adjust your code to remove decimals:

    $topic_author = 1;
    $type = 'dig_cash';
    // Get balance unformatted
    $balance = mycred_get_users_cred( $topic_author, $type );
    // Force all values to be integers
    echo 'Cash: ' . intval( $balance );

    Note that the above code will just convert values to integers and will not append any suffix or prefix you might be using. You would need to add that in yourself.

    Thanks that worked.. awesome..

    But another issue on my site ( its not relevant to this topic, still)

    the Points seems to be not getting added while i make a topic or reply from the front-end of bbpress.
    Also points are not getting added to my other two custom post types posts.

    I have not excluded the admin from the point collection, so he should be getting points on every post.

    But it seems to be not that case.

    Any help on that.

    Plugin Author Gabriel

    @designbymerovingi

    You have enabled the bbPress hook for all point types (green icon) and you are not awarding zero points? Do you get any errors when adding topics / replies? If you enable WP_DEBUG in your wp-config.php file and post a topic or reply, do you see any error messages? (note that enabling WP_DEBUG will show all errors not just myCRED related).

    Hi

    Yes enabled bbpress hook, awarded 1 point each for newtopic, reply, forum etc.

    While enabling WP_DEBUG and posting getting error from another plugin – Configure SMTP & Category pagination fix , no error coming from myCred plugin side.

    Is Configure SMTP causing this issue? ( compatibility issue)

    Plugin Author Gabriel

    @designbymerovingi

    I do not see a reason why that plugin should be the cause of any issue here.

    Try this:
    Disable the bbPress hook for all point types but your main type so you only award your main type points for new bbPress actions and no other point system and see if you get points awarded.

    A few other things I would check:
    1. In case “Topic authors can receive tokens for replying to their own Topic” is not checked, then topic authors will not receive points for replying to their own topics.

    2. In case “Forum authors can receive points for creating new topics.” is not checked, forum authors will not receive points for creating new topics.

    3. If you are posting in the forum but your ID is set to be excluded under “Core” on your myCRED > Settings page you will not receive points.

    Ha..missed that “In case “Forum authors can receive points for creating new topics.” is not checked, forum authors will not receive points for creating new topics

    That worked out for bbPress . Now counting points

    But still not able to get the two custom post types to work on my site.. I have enabled the ‘points for publishing content’. There my two custom posts are listed and i have awarded 1 point each for it.

    But it seems not working. Any setting need to be changed on the custom post types?

    On the way really thanks for the support.

    Plugin Author Gabriel

    @designbymerovingi

    Is all the checkboxes checked on all point types the way you want them to be?
    What instances are not awarding points for you now?

    Hi

    Yes i have enabled 1 point each for my Custom post types under ” publishing content”. ( here is the screenshot – http://i.imgur.com/yAy0lpr.png)

    But the point seems to be not getting accumulated when i write any post on this custom post types.

    Plugin Author Gabriel

    @designbymerovingi

    Hey.

    Thank you for the image.
    So if you create a new myCRED Coupon, you do not get 1 points?
    Do you get points for publishing posts? Pages?

    Hi

    Yes creating post under my custom post type (Coupon & Offer) don’t offer points.

    Buy yes publishing posts provides points. ( pages i have marked 0 points )

    Plugin Author Gabriel

    @designbymerovingi

    After some investigation I found that this is a bug in the current version. I will include a fix in tonights update.

    Superb, that’s great..

    Waiting for the update…

    Keep up with your awesome support 🙂

    Plugin Author Gabriel

    @designbymerovingi

    I have updated the current version 1.4.1 to include this fix if you want to try it out before the update is released and please let me know if the update fixes the issue for you or if it persists.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Show to Points to Public visitors or not logged in Users’ is closed to new replies.
Skip to toolbar