Solved Negative value

Blackhat

Licensed
Licensed
User Upgrade Duration
User Upgrade Pro
Credit System
Advanced User Profile
Joined
Dec 7, 2019
Messages
163
Reaction score
25
Negative number can't be entered in different places; user criteria, node permissions, edit user credits and color property.

I got this error when editing user credits with negative number.

FxVHEqH.png


Also, if a user has a negative number, it won't appear in the front-end. It should be displayed as it is since the "Rounding value up" option isn't enabled.
 
Last edited:
Hello,

In any case the credit user can not be negative, because if he wants to post a reply or even put a reaction it will put him that he has no right to post because he has no credit.

On the other hand, for the modified credits, there is an error, it will be settled in the next update.

Regards, CRUEL-MODZ
 
It's possible to make the input field in node permissions support negative numbers just like the credit field in event options?
It must support negative numbers since the add-on allows the user to create own method for credits calculation, therefore the user may use a method result in a negative number.
Also, we can't use user criteria to add members with a negative value to a specific usergroup.
 
Last edited:
It's possible to make the input field in node permissions support negative numbers just like the credit field in even options?
Unfortunately in the permssion it's not possible to make negative

It must support negative numbers since the add-on allows the user to create own method for credits calculation, therefore the user may use a method result in a negative number.
Also, we can't use user criteria to add members with a negative value to a specific usergroup.
And to post a thread or a post or to put a reaction it is necessary that it is the number of credit that is asked (if in the event is in negative )

Under no circumstances may the user have a negative value.
 
Last edited:
Well, can you at least make user criteria and color property support negative numbers?

And;
Also, if a user has a negative number, it won't appear in the front-end. It should be displayed as it is since the "Rounding value up" option isn't enabled.
 
Yes I can but, you don't understand that it is not possible for a user to be a negative value,

let's take an example:

3 events for 3 different categories:

event A = -12 credit for category A
Event B = 12 credit for category B
Event C = 50 credit for category C

User A wants to post a thred in category A he has only 5 credits, he can't, because he hasn't asserted any credit.

On the other hand, if he wants to post in category B he can because it adds credit to him.

END :

Also, if a user has a negative number, it won't appear in the front-end. It should be displayed as it is since the "Rounding value up" option isn't enabled.
I can't put in the database all the numbers of the calculation, I put a number after the comma, but I can change and put 2.
 
Yes I can but, you don't understand that it is not possible for a user to be a negative value,

let's take an example:

3 events for 3 different categories:

event A = -12 credit for category A
Event B = 12 credit for category B
Event C = 50 credit for category C

User A wants to post a thred in category A he has only 5 credits, he can't, because he hasn't asserted any credit.
What about adding an option to trigger the event even if the user doesn't have enough credits?

qbuFFsO.png

I can't put in the database all the numbers of the calculation, I put a number after the comma, but I can change and put 2.
Do you mean you can't store negative numbers in the database?
 
What about adding an option to trigger the event even if the user doesn't have enough credits?
It's ridiculous because if I add a system to buy credit, if we can have a negative credit there is no more interest, the user will be able to write with a negative credit.

Do you mean you can't store negative numbers in the database?
NO, that's not it I can't put too many numbers after the decimal point example: 2.8552555 I can't, I limit myself to 1 or 2 numbers after the decimal point
 
It's ridiculous because if I add a system to buy credit, if we can have a negative credit there is no more interest, the user will be able to write with a negative credit.
The current behavior of how the add-on deal with negative numbers doesn't support the main idea of this add-on which allow creating custom method for calculating user credits. For example, if user has 2 threads, 1 post and 6 replies, we used a simple method ({threads} + {posts}) - ({reply}) it will result in a negative number.

I understand that node permissions don't support negative numbers. However, we can still use user criteria under usergroup promotions to add who have a negative credit to specific usergroup which would override node permissions.
 
Last edited:
The current behavior of how the add-on deal with negative numbers doesn't support the main idea of this add-on which allow creating custom method for calculating user credits. For example, if user has 2 threads, 1 post and 6 replies, we used a simple method ({threads} + {posts}) - ({reply}) it will result in a negative number.

I understand that node permissions don't support negative numbers. However, we can still use user criteria under usergroup promotions to add who have a negative credit to specific usergroup which would override node permissions.
Hello,

Yes ok I agree, but if users can have negative credit, a system where you can buy credit is useless, users will be able to write even with negative credit, why buy it?

Regards, CRUEL-MODZ
 
It's up to site admin he can either make the event charged or not. Even if the "Not charged" option used you still can restrict access for users with negative credits using usergroup promotions. The example below to move users who have less than -5 credits to specific usergroup.

6y8IBWq.png


Implementing a system for buying credits still needed, users may use it to purchase and donate credits for other users, sticky a thread or to gain access to some forums when they reach -5 credits like in the example above.
 
It's up to site admin he can either make the event charged or not. Even if the "Not charged" option used you still can restrict access for users with negative credits using usergroup promotions. The example below to move users who have less than -5 credits to specific usergroup.

.......
Implementing a system for buying credits still needed, users may use it to purchase and donate credits for other users, sticky a thread or to gain access to some forums when they reach -5 credits like in the example above.
Understood that if you don't block the users when they don't have credit nobody will buy credit, all simple because it would be useless and he wouldn't see the difference.
 
Understood that if you don't block the users when they don't have credit nobody will buy credit, all simple because it would be useless and he wouldn't see the difference.
Certainly, if there are no restrictions for users with negative credits, then the add-on itself will be useless. For this reason, I mentioned in the above example the ability to restrict access for users who have negative credits when they reach X negative credits.
 
Last edited:
I'm still unable to enter a negative number in the user criteria.

2rmQTjT.png
 
Back
Top Bottom