Question Automatically Converting Currency (or Allowing Decimal Values)

Status
Not open for further replies.

kbryant414

Customer
Looking at the add-on, I feel like this should be possible, but I haven't figured out how to, yet.

A use-case scenario: user posts an article in a designated forum, I want to be able to give currency by the word count. I can do that without issue (this add-on is pretty great). However, I want to give currency at a rate of 1 per 10 words, or 0.1 per word. Since this doesn't appear to be an option, I thought an alternative would be to have two currencies, one with a value of 1 (Pennies) and the other with a value of 100 (Dollars). The idea would be that they would earn Pennies initially, then have it converted to Dollars they can use in the DBShop.

The currency has been in use on a previous forum, so I don't want to just increase prices users are familiar with from, say, 250 to 25000, although that is an option if nothing else works. I'm hoping to add a bit more automation to the earning rather than requiring manual adjustment for each payment as I've done in the past.

Am I missing something simple? Or if it isn't possible, is it plausible to add the functionality?

Thank you.
 
Decimals are definitely supported, I've tested it in the XF2 versions just now and I am able to save using decimals for the Words / Characters options :)

Did you try entering the value manually rather than using the steps?
 
I did, yes. It highlights the field in red and says, "Please select a valid value. The two nearest values are 0 and 1." I do know there is the option to round decimals or display them, but where I'm actually having the problem is setting a "Post" Event to award 0.01 credits per word. The goal is that if a user makes a 1,000 word post (in the designated area), they should get 10.00 in the currency.

I tested the idea itself, and it works well as long as I have both a "Thread" Event and a "Post" Event (as the Post event doesn't seem to capture the first post in a thread). The word counting seems accurate, it's quick, rewarding, and simple. The add-on is really impressive. My only problem is that I can't get 1000 Words = 10 Currency, the lowest I can get is 1000 Words = 1000 Currency. To get decimals I have to manually "Adjust" them, as far as I can tell.

I had thought that it must be limited to integers for a reason if it was giving me that error message, which is why I was brainstorming a way to work around it without asking for a feature change. From your response, it seems like it's supposed to allow decimals in the events, though? I've included screenshots below, starting from a fresh reinstall of DBCredits.

As a quick aside, this is a minor, separate issue, but I can't seem to Edit existing currencies. When I try, the Save button is missing, and it will only let me make duplicate currencies. It's included in the screenshots below, at the bottom.

KEE8qKC.png
 
What browser are you using? This does not occur for me in Chrome (latest) on Windows 10.
 
What browser are you using? This does not occur for me in Chrome (latest) on Windows 10.

I was using Firefox (57.0.1). I just tested on the latest version of Chrome (62.0.3202.94) and it does not do the red highlight, but gives the same error message when I try so save the "Post" Event. Using Windows 10 Home.

Can you confirm the steps you're taking to get it to work?

nl4o1ht.png
 
Update: I have a potential hotfix for this for Beta 2, based on this web page: HTML5 input type=number and decimals/floats in Chrome | Isotoma: Our blog

It's strange I don't have the error message, but maybe changing the step to "any" will fix it for you.

Ahh. That works, yes. :)

Edit: Well, I thought it did. It said it was saved successfully when I modified those values in Chrome, but no events appear in Event management. Not even the default "Adjust" one. I might have to reinstall this again.
 
Anything in the server error log?

Nothing that seems related. I just uninstalled the add-on completely and then reinstalled. It will let me create Events successfully, but not show them to me. If I look in phpMyAdmin, I can see the created events are there.
 
Could you please create and PM me with a temporary FTP and AdminCP account?

For security reasons, we recommend you create a new FTP account only for DBTech support, then disable or delete it after we have both confirmed the issue has been solved and there are no further issues.

The same applies to AdminCP accounts; they should ideally be temporary accounts created for us only. If we have created an account on your site already, you can optionally boost that account to Administrator and then de-admin this account once the issue has been solved.

If you use a .htaccess password protection for your AdminCP directory, it is recommended that you create a new authorised user for DBTech and remove this user once the issue has been solved.

Please test any temporary accounts you create to ensure that the FTP account has access to the forum files, and that the AdminCP account can access the administrative controls for the product we are assisting you with.

Ensuring this is all in order before submitting the information will significantly speed up the process of assisting you. We will alert you via PM if there's any issues with the login information you have provided.

When sending the PM, for your security you should also un-tick the "Save a copy in my Sent Items folder" checkbox. When the access details have been received, we will delete the PM from our inbox. Ensuring you have not kept a copy of the PM reduces the risk of security breaches.

Thank you for helping us debug our products and allowing us to assist you, we appreciate it :D
 
Should be resolved now, I edited the file to fix the display issue and also added the "any" step so you should be able to edit the events properly now.
 
Hello kbryant414,

This ticket has now been closed with the status Answered.

We hope your issue or question has been addressed to your satisfaction. If not, please feel free to re-open it by clicking this link.

If you have any further issues or questions, please feel free to start a new support ticket via the button at the top of every page.

Thank you!
 
Status
Not open for further replies.

DragonByte Credits

XenForo 1.5.3+ XenForo 2.0.x XenForo 2.1.x XenForo 2.2.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
4,396
Customer rating
5.00 star(s) 4 ratings
Back
Top