• Resolved AlexBangkok

    (@alexbangkok)


    Hi, I would like to allow a negative value of 120 credits.

    Example: User 1 wants to send credits to User 2, User one only have 10 credits, but want to send 60 credits. As it is now User 1 is getting a warning “not enough credits”, but I would like to allow this. So instead of having the limit of 0, the limit should be instead -120.

    Any advices?

    Thanks.

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

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

    (@designbymerovingi)

    Hey Alex

    In the myCRED-addon-tranfer.php file located in your add-ons directory holds the mycred_user_can_transfer() function. On line 755 you will find the zero balance check which you could change to a negative value; allowing your users account to go minus. In version 1.0.8 I will be adding a filter hook so you can change this value without editing plugin files but till then, this is the only way to achieve what you are looking for.

    Thread Starter AlexBangkok

    (@alexbangkok)

    Hi, and thanks!

    But I did not get it to work πŸ™

    Even when I commented the line out I got the same string in return when trying to send credits.

    I tried with a higher value too, but even then the limit was still at 0.

    Plugin Author myCred

    (@designbymerovingi)

    Yes you are correct, forgot about the ajax check. Question. Would you want users to be able to go minus just once then cut them off or would you want to allow them to transfer even if their account is already minus as long as they do not reach a certain amount?

    Thread Starter AlexBangkok

    (@alexbangkok)

    I would like them to be able to send credits even if they already are at a negative value, down to a negative value of 120.

    I am building a timebank and I would like it to be easy to see who are in debt to the rest of the community and who have been working more then they have received labor.
    Your plugin is absolutly perfect for this project!

    Plugin Author myCred

    (@designbymerovingi)

    You will also need to adjust the function handling the AJAX call for transfers. In the same file around line 322. Here we check for zero balance again so you will need to change this but I should have 1.0.8 out later today.

    You can see how it will work at http://mycred.me/filters/mycred_transfer_acc_limit/

    Plugin Author myCred

    (@designbymerovingi)

    Feature introduced in 1.0.8

    Thread Starter AlexBangkok

    (@alexbangkok)

    Thanks!

    So, to change the limit in version 1.0.8, how do i do? I cant find the feature anywhere in the settings panel πŸ™

    Plugin Author myCred

    (@designbymerovingi)

    Hey Alex.
    There is no feature under settings for this. Visit the mycred_transfer_acc_limit page and copy the example to your themes functions.php file.

    Change the value in the example from -100 to the value you need and save. Thats all you need to do.

    Thread Starter AlexBangkok

    (@alexbangkok)

    Sigh, think i have tried everything with out success now πŸ™

    Anybody else who have tried changing the limit to a negative value?

    Plugin Author myCred

    (@designbymerovingi)

    Can you send me a link where I could have a look?

    Thread Starter AlexBangkok

    (@alexbangkok)

    I am using it at http://tidsbank.se/

    I have added following code at the bottom of my themes functions.php.

    I have installet version 1.0.8 of your plugin.

    I run WP Version 3.5.1

    <?php
    add_filter( 'mycred_transfer_acc_limit', 'adjust_transfer_account_limit' );
    function adjust_transfer_account_limit( $amount )
    {
    	return 0-100;
    }
    ?>
    Thread Starter AlexBangkok

    (@alexbangkok)

    When added the code I get this message when trying to upload an image

    Warning: Cannot modify header information – headers already sent by (output started at /public_html/tidsbank.se/wp-content/themes/OneCommunity/functions.php:1408) in /public_html/tidsbank.se/wp-admin/async-upload.php on line 32
    105

    Plugin Author myCred

    (@designbymerovingi)

    Could you send me an email on support@mycred.me and I can send you an updated version to see if that resolves the issue.

    Thread Starter AlexBangkok

    (@alexbangkok)

    Thank you soo much for all the help! I am very happy for the help since this was a big thing before the soft launch of the site, and I dont think the website could operate without your plugin.

    Thanks so much!

    //Alex

    Plugin Author myCred

    (@designbymerovingi)

    My pleasure, let me know if you have any future issues.

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Allow Negative Value’ is closed to new replies.