Added compatability with [AD] Notifications for Withdrawal Requests
@Jake B. any chance you could respond to my feedback & bug reports? I spent a lot of time compiling them for you guys and am very hesitant to upgrade to the latest version until I know that these bugs are fixed. I don't want to have to manually go in and modify all of these again.Upon trying to use the Purchase system all my packages received the following error upon trying to follow the navigation to the Paypal portal:
Turns out the issue was due to float precision on the "amount" post parameter:
Found the problematic line in the adcredit_packages template:
Fixed it by replacing it with:
Code:<input type="hidden" name="amount" value="{xen:helper currency, $package.price, 0}" />
Hopefully this fix can be implemented (or improved on) for the official build. Would save me the hassle of having to modify it each upgrade.
---
Here's another revision I had to make for my use case.
class Audentio_Credit_Core_DataWriter_Transaction
Old:
Code:protected function _preSave() { if ($this->get('credits') < 1) { $this->error(new XenForo_Phrase('adcredit_invalid_amount'), 'amount'); } $currencyModel = $this->getModelFromCache('Audentio_Credit_Core_Model_Currency'); $currency = $currencyModel->getCurrencyById($this->get('currency_id')); $sender = $this->getOption('sender'); if ($sender) { if ($this->get('credits') > $sender[$currency['currency_id']] && !$currency['allow_negative']) { $this->error(new XenForo_Phrase('adcredit_not_enough_X_you_need_Y',array('creditName' => $currency['name'], 'amount'=>Audentio_Credit_Core_Template_Helper_Credit::formatCredit($this->get('credits'), $this->get('currency_id')))), 'amount'); } } }
New:
Code:protected function _preSave() { $currencyModel = $this->getModelFromCache('Audentio_Credit_Core_Model_Currency'); $currency = $currencyModel->getCurrencyById($this->get('currency_id')); $min = 1 / pow(10, $currency['decimal_points']) - 1 / pow(10, $currency['decimal_points'] + 1); if ($this->get('credits') <= $min) { $this->error(new XenForo_Phrase('adcredit_invalid_amount'), 'amount'); } $sender = $this->getOption('sender'); if ($sender && $this->isInsert() && $this->get('credits') > $sender[$currency['currency_id']] && !$currency['allow_negative']) { $this->error(new XenForo_Phrase('adcredit_not_enough_X_you_need_Y',array('creditName' => $currency['name'], 'amount'=>Audentio_Credit_Core_Template_Helper_Credit::formatCredit($this->get('credits'), $this->get('currency_id')))), 'amount'); } }
The first notable change are that it now supports transfers of the smallest precision allowed by the currency (as configured). Apologies for the second hacky part of calculating the min, but it was necessary because I believe there is some precision loss going through the AJAX layer and I'm sure you can come up with a more elegant fix. The second is the addition of "$this->isInsert()" condition to the insufficient funds error, because for my use, and presumably anyone building on top of this, there may be a need to edit transactions after it is created and that error state makes no sense then.
Lastly, please let me know if you would like me to continue posting my mods/thoughts/etc., PM you instead, or just leave you alone. Each dev has their own style and I'll respect it.
---
Edit:
More tweaks I made that I thought I should share. I really wanted to a display like this (yes I'm using the AD theme Intrepid; it's awesome )
To achieve this I modified the beginning of template adcredit_navigation_visitor_tabs_end as such:
Code:<li class="navTab credits Popup PopupControl PopupClosed {xen:if $adcredit_selectedTab, 'selected'}"> <a href="{xen:link adcredits}" rel="Menu" class="navLink NoPopupGadget"> {xen:if '{$xenOptions.adcreidt_visitorTabDisplayMethod} == 2 OR {$xenOptions.adcreidt_visitorTabDisplayMethod} == 1', '<i class="{$xenOptions.adcreidt_visitorTabIconClass}"></i> '}{xen:if '{$xenOptions.adcreidt_visitorTabDisplayMethod} == 0 OR {$xenOptions.adcreidt_visitorTabDisplayMethod} == 1', '{xen:phrase adcredit_wallet}'} <strong class="itemCount alert" id="PrimaryCurrency_Counter"> <span class="Total">{xen:helper credit, '{$visitor.adcredit}', 'adcredit'}</span> <span class="arrow"></span> </strong> </a>
Obviously this is horrible since I hard-coded the currency_id, but I'm sure it can be improved on to provide such a display option out-of-box.
Edit x2:
Couple more notes.
1) I would like to have a space between the end of my currency and the suffix. I managed to do this by manually modifying the currency table, but trying to do some through admincp trims the leading space.
2) I want only one currency withdrawable and the other not. I tried to turn off "Can Withdraw" through the Currency page in admincp:
However, the currency still shows up in the Withdraw template and refreshing the admincp page shows that the option has been checked again.
I'm assuming this is undesired behavior. I also didn't notice a can_withdraw flag in the MySQL table, so I'm not sure how the setting is retained.
Edit x3:
Fixed* #2 above by replacing the following line in template adcredit_withdraw
Code:<xen:if is="{$currency.withdraw_conversion_rate}">
with
Code:<xen:if is="{$currency.withdraw_conversion_rate} > 0">
* While this fixes the front-end I fear that the back-end will still allow a withdrawal to be made on a currency that has withdrawal disabled (or conversion_rate == 0).
Edit x4:
Gifting is also susceptible to the same double precision bug documented at the beginning. The fix involves modifying template adcredit_package_purchase_do in a similar fashion. Also the lower case "submit" button using the submit phrase looks a little improper. I replaced it with the go phrase, which is properly capitalized.
Code:<form action="{$payPalUrl}" method="post" class="xenForm formOverlay"> <input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="amount" value="{xen:helper currency, $package.price, 0}" /> <dl class="ctrlUnit submitUnit"> <dt></dt> <dd style="text-align: center;"> {xen:phrase adcredit_click_here_if_redirect_takes_longer_than_X_seconds, 'seconds=<span id="numSeconds">5</span>'}<br> <input type="submit" value="{xen:phrase go}" class="button primary"> </dd> </dl>
I'm experiencing the same problem where actions are not being triggered. A lot of users are complaining about not getting rewarded for their daily login. My actions were configured to be active for ALL of my usergroups.Hello. Not working permissions for different nodes. After these settings, credits are count only to administrators, for other groups did not count.
ErrorException: Undefined property: XenForo_ControllerResponse_Redirect::$params - library/Audentio/Credit/Core/ControllerPublic/Resource.php:8
Generated By: Unknown Account, Yesterday at 11:11 PM
Stack Trace
#0 /usr/local/lsws/TWD/html/library/Audentio/Credit/Core/ControllerPublic/Resource.php(8): XenForo_Application::handlePhpError(8, 'Undefined prope...', '/usr/local/lsws...', 8, Array)
#1 /usr/local/lsws/TWD/html/library/XenForo/FrontController.php(347): Audentio_Credit_Core_ControllerPublic_Resource->actionView()
#2 /usr/local/lsws/TWD/html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#3 /usr/local/lsws/TWD/html/index.php(13): XenForo_FrontController->run()
#4 {main}
Request State
array(3) {
["url"] => string(62) "http://twowheeldemon.com/resources/sightseeing.104/?update=105"
["_GET"] => array(1) {
["update"] => string(3) "105"
}
["_POST"] => array(0) {
}
}
rrorException: Undefined property: XenForo_ControllerResponse_Redirect::$params - library/Audentio/Credit/Core/ControllerPublic/Resource.php:9
Generated By: Unknown Account, Yesterday at 11:11 PM
Stack Trace
#0 /usr/local/lsws/TWD/html/library/Audentio/Credit/Core/ControllerPublic/Resource.php(9): XenForo_Application::handlePhpError(8, 'Undefined prope...', '/usr/local/lsws...', 9, Array)
#1 /usr/local/lsws/TWD/html/library/XenForo/FrontController.php(347): Audentio_Credit_Core_ControllerPublic_Resource->actionView()
#2 /usr/local/lsws/TWD/html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#3 /usr/local/lsws/TWD/html/index.php(13): XenForo_FrontController->run()
#4 {main}
Request State
array(3) {
["url"] => string(62) "http://twowheeldemon.com/resources/sightseeing.104/?update=105"
["_GET"] => array(1) {
["update"] => string(3) "105"
}
["_POST"] => array(0) {
}
}
Hello. Not working permissions for different nodes. After these settings, credits are count only to administrators, for other groups did not count.
my question its simple does your plugin support next options:
to open new thread or replay use credits in specific forums/50 credits to open thread example?
pay to download from resource/ 100 credits to download resource
buy credits over paypal
pay to watch videos in media gallery
i am interested to buy it but need option mentioned above and bugs free
I want to let users buy/sell resources using the credits. Is that possible?
That way I could sell a package of credits to users, then users could buy items with the credits and sellers could cash out using credits.
Is that possible now, or is it something we can hack together as a custom setup?
Any chance of adding a tip jar function? Something similar to https://www.changetip.com/
@Jake B. any chance you could respond to my feedback & bug reports? I spent a lot of time compiling them for you guys and am very hesitant to upgrade to the latest version until I know that these bugs are fixed. I don't want to have to manually go in and modify all of these again.
Additionally found three new bugs.
1) In AdminCP under the Credits tab my "Income This Week" is completely blank even though there have been multiple credit package purchases (as seen in #2).
So it does, that's an easy fix and it will be fixed in the next release2) In AdminCP under the Credits tab my "Recent Credits Purchase" only show the first five transactions made, as opposed to the five most recent transactions. I'm assuming the order just needs to be flipped.
3) In AdminCP in the detail view of the "Transactions" view the dates of all the transactions are the same (specifically the current day's date) even though in reality they were handled previously.
Wrong data:
Right data:
It actually only works with an uploaded file. I'm not sure if I'd be able to get it to work for the others as "External Purchase & Download" is nothing more than a link to an external site, same with External Download URL. I may be able to get something for "Does not have a file" though, but I'll have to look into it a bit more.Hey guys,
When selling a resource with AD Credits, it only let's me insert a price if the resource is a
BUT NOT if it's a
- Uploaded file
- External download URL
- External purchase and download
- Does not have a file
I'm experiencing the same problem where actions are not being triggered. A lot of users are complaining about not getting rewarded for their daily login. My actions were configured to be active for ALL of my usergroups.
I started to investigate those claims and turns out it was working for users with secondary user groups but not for users with no secondary usergroups. The action log is displaying the action as being triggered but the actual credits are not being delivered to the users.
I've also found a problem in the admincp options: If you choose several usergroups when editing an action, save the action and afterwards you want to clear all the usergroups from that action, you cannot do it. You can edit some of the usergroups but if at some point you leave the action with no usergroup selected, it doesn't save the usergroup list.
Honestly not sure if this is possible as there would have to be a way to verify they actually liked it and didn't just click the link.1. give credits to people who use the social share buttons. If user likes our site on facebook, twitter, etc, they get a credit. Put a limit on it though, so your users aren't considered spamming and taking advantage of the credit system.
2.When a user gets their content featured, then THEY get a credit. I thought when I got that extra module, that that's how it would work. Currently it gives the credit to the person who features it, which is typically an admin or moderator and they don't need to give themselves points. This will motivate users to post good content and reward them for it. "Congrats! Your thread (title here) was featured. You've earned $x credits."
3.Refer a new user to sign up, get a credit. This will help our sites grow. Or if there's a current/good user invite system, then tie it in with that and link me to the addon. I'll gladly get it.
4.Affiliate system tied into user referrals. Let a user refer new members and earn a % of what they earn. Example Let's say the referral % is 5%. I invite someone to the site and that person earns 100 credits. Then I get 5 credits as a bonus.
These options could help your site grow and be more active.
Having watched the addon evolve, I have two questions:
Thanks
- Is it possible to convert from [bd] Banking
- Any integration into the User Upgrades feature so users can buy them with credits? Or is that available in the shop addon as something similar?
@Jake B., I'm getting this error now.
This started happening after I used the the feature Audentio has to rename the Resources to something else (in my case, Downloads)
Code:ErrorException: Undefined property: XenForo_ControllerResponse_Redirect::$params - library/Audentio/Credit/Core/ControllerPublic/Resource.php:8 Generated By: Unknown Account, Yesterday at 11:11 PM Stack Trace #0 /usr/local/lsws/TWD/html/library/Audentio/Credit/Core/ControllerPublic/Resource.php(8): XenForo_Application::handlePhpError(8, 'Undefined prope...', '/usr/local/lsws...', 8, Array) #1 /usr/local/lsws/TWD/html/library/XenForo/FrontController.php(347): Audentio_Credit_Core_ControllerPublic_Resource->actionView() #2 /usr/local/lsws/TWD/html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch)) #3 /usr/local/lsws/TWD/html/index.php(13): XenForo_FrontController->run() #4 {main} Request State array(3) { ["url"] => string(62) "http://twowheeldemon.com/resources/sightseeing.104/?update=105" ["_GET"] => array(1) { ["update"] => string(3) "105" } ["_POST"] => array(0) { } }
Code:rrorException: Undefined property: XenForo_ControllerResponse_Redirect::$params - library/Audentio/Credit/Core/ControllerPublic/Resource.php:9 Generated By: Unknown Account, Yesterday at 11:11 PM Stack Trace #0 /usr/local/lsws/TWD/html/library/Audentio/Credit/Core/ControllerPublic/Resource.php(9): XenForo_Application::handlePhpError(8, 'Undefined prope...', '/usr/local/lsws...', 9, Array) #1 /usr/local/lsws/TWD/html/library/XenForo/FrontController.php(347): Audentio_Credit_Core_ControllerPublic_Resource->actionView() #2 /usr/local/lsws/TWD/html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch)) #3 /usr/local/lsws/TWD/html/index.php(13): XenForo_FrontController->run() #4 {main} Request State array(3) { ["url"] => string(62) "http://twowheeldemon.com/resources/sightseeing.104/?update=105" ["_GET"] => array(1) { ["update"] => string(3) "105" } ["_POST"] => array(0) { } }
ThanksIntegration with Product Manager by @Chris D
We have it on our list of things to start in the near future.
I made a new user group called CreditsGroup and it has all credits permissions enabled.
I made an action Post New Thread, ticked the CreditsGroup, set the amount, and it's active for all nodes.
Logged in as a user in the CreditsGroup, posted 5 new threads, no credits were added. When I did it as an admin, the credits were added.
Noticed that when I untick the usergroup and press save, when I go back to the action - the usergroup is still checked. In order to uncheck the box, I have to delete and recreate the action.
Anything else I can check? @Mike Creuzer
Thanks!!View attachment 104092
Thanks. Please give ETA if it is possible.We have it on our list of things to start in the near future.
We use essential cookies to make this site work, and optional cookies to enhance your experience.