Comments on: Block users with negative balances https://mycred.me/tutorials/block-users-with-negative-balances/?utm_source=rss&utm_medium=rss&utm_campaign=block-users-with-negative-balances Free WordPress Reward, Badge, Loyalty & Points Management Plugin Tue, 22 Mar 2022 14:41:30 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Tony https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62142 Mon, 20 Dec 2021 14:45:41 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62142 Hi Gabriel, thank you for the answer. I tried but it does not work, the user’s current balance is always below 0 and does not redirect to the desired page, is the $ balance variable the current balance or the total of Balance of the user? Because what I want to do is when the current balance is below 0 then it will be redirected to another page

]]>
By: Tony https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62141 Mon, 20 Dec 2021 14:45:41 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62141 Hi Gabriel, thank you for the answer. I tried but it does not work, is the $ balance variable the current balance or the total balance of the user? Because what I want to do is when the current balance is below 0 then it will be redirected to another page
Thanks

]]>
By: Gabriel Merovingi https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62140 Mon, 20 Dec 2021 14:45:41 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62140 Hey

You could use something like this: https://gist.github.com/gabrielmerovingi/ebf588c2c0e860c5f7898dfa8e3655d5
It goes into your theme’s functions.php file and all you got to do is to adjust the ID of the page where you want your users to be redirected to when they have run out of points.
Note that it will not enforce this redirection if: Someone is not logged in or if myCRED has been disabled.

]]>
By: Tony https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62139 Mon, 20 Dec 2021 14:45:41 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62139 Hi, your plugin interests me a lot, and I’ve already tried it. My problem is that I want to redirect users to a points purchase page in case its balance is negative. Can you help me?

]]>
By: Gabriel Merovingi https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62138 Mon, 20 Dec 2021 14:45:33 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62138 Since this tutorial blocks users from logging in to your website if they do not have points, you can not get them to buy more points (since they must be logged in to do so). You might want to look at a different solution all together, where you might allow users to login to the site with zero points but then force them to a page where they can buy points.

]]>
By: BirminghamIU https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62137 Mon, 20 Dec 2021 14:45:33 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62137 I would too like to find a way for them to buy points if account is blocked to restore access. Any updates on this would be great!

]]>
By: Gabriel Merovingi https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62136 Mon, 20 Dec 2021 14:44:59 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62136 Hey.

myCRED has no built-in capability adjustments for WordPress. Initially I was thinking of connecting things with roles but then I realized there are a lot of different approaches for how user capabilities are handled in WordPress sites and building something that would accomodate / work with all of these would be a headache.

But that does not mean it is not impossible. In 1.3.2 I included two custom actions in myCRED: mycred_user_got_demoted and mycred_user_got_promoted. These fire when a users rank changes. Demoted is triggered when the new rank the user gained has a lower minimum point requirement then their current rank while promoted is triggered for the complete opposite.

You could use these hooks to execute custom code like changing a users role in WP. Just make sure the user in question is not an admin.

]]>
By: Matt M https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62134 Mon, 20 Dec 2021 14:44:59 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62134 Hi. I’m new to your plugin but I can really see the potential. One thing I”m trying to work out that would be very beneficial:

I want to use the points system as a reward system that allows users to spend them on guest posts. I set the reward for posts as negative hoping that any insufficient balance would dissalow the user from submitting the post, but instead the mycred balance just went negative.

Is there any way to have the plugin check whether there are enough points to complete the action and if not, then dissalow it?

As another thought for the future of the plugin, if there was some way to develop posting credits as a secondary type of currency. For example, 100 mycred points are worth 1 post credit, and the user can spend the credit to submit a guest post. I think that would be an in-demand feature and one I’d be willing to pay for.

Thanks much,
Matt

]]>
By: Matt M https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62135 Mon, 20 Dec 2021 14:44:59 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62135 Actually I was wondering if this could even be accomplished in an easier way. I was reading through your mycred ranks tutorial. If it is possible to change the wordpress user privleges based on their mycred rank then I could achieve this with no code customization necessary.

If you don’t have enough points, you won’t have the rank required to post articles. Once you post and lose -100 points, you may drop in rank and have to earn it back. It was not clear from the tutorial however, whether the rank system can change user privileges or if it is just a badge system.

Thanks again!

]]>
By: Jon Asnon https://mycred.me/tutorials/block-users-with-negative-balances/#comment-62132 Mon, 20 Dec 2021 14:44:38 +0000 https://devstages.wpengine.com/?post_type=tutorial&p=464#comment-62132 Hi Gabriel,

Great plugin! Out of the box this has pretty much everything I was looking for! One question I did have though (sort of related to this topic) was if there was a way to prevent users from having negative points. I want to set the minimum at 0 points or something like that, so when a user tries to perform a task that has a hook which deducts points, it won’t let them do it if they don’t have sufficient points. Essentially 0 would be the lowest amount of points, and if a user needs more to perform the task, they would need to purchase more.

Thanks for the help!

]]>