[TH] Credits [Deleted]

Hello. Not working permissions for different nodes. After these settings, credits are count only to administrators, for other groups did not count.
0118673399a9.png
 
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?
 
Upon trying to use the Purchase system all my packages received the following error upon trying to follow the navigation to the Paypal portal:
f22737e4d7.png


Turns out the issue was due to float precision on the "amount" post parameter:
710e1f29f0.png


Found the problematic line in the adcredit_packages template:
a3554d421a.png


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. :p

---

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 :D)

ce283fd4c08606d841eb2327a2e94dbd.png


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:
b9fe8daf988a21c5da46004029559251.png

However, the currency still shows up in the Withdraw template and refreshing the admincp page shows that the option has been checked again.
0940e8aad25dea5e8ba3e368b3eb5580.png

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>
@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).

f65e497cec.png


2) 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.

2a01ed7d10.png


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:
6fd026f374.png


Right data:
a6309d61c3.png


I must admit I'm getting a little frustrated with this plugin's bugs and the lack of confirmation of incorporating my fixes (or improvements on them) doesn't help. I hope we can resolve this soon.
 
Hey guys,

When selling a resource with AD Credits, it only let's me insert a price if the resource is a
  • Uploaded file
  • External download URL
  • External purchase and download
BUT NOT if it's a
  • Does not have a file

The problem is that some things we will sell are not items that you can download, but rather a service that doesn't have an actual file to it. Think of things like a website review, song review, buy a facebook share, etc - things that don't require a user to download anything, but they're still purchasing an resource/service.

Can you let us add a price to the resource, without requiring user to download a file, in your next update? That would help our user to user sales...thanks.
 
Hello. Not working permissions for different nodes. After these settings, credits are count only to administrators, for other groups did not count.
0118673399a9.png
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.
 
Last edited:
I got this addon with the intention to keep members motivated and posting good content, but I'm finding it just need a few things to be really, really, really good.

  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.
 
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!!what am i missing.webp
 
Last edited:
Having watched the addon evolve, I have two questions:
  1. Is it possible to convert from [bd] Banking
  2. 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?
Thanks :)
 
@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) {
  }
}
 
Hello. Not working permissions for different nodes. After these settings, credits are count only to administrators, for other groups did not count.
0118673399a9.png

It actually is working as intended. If you want everyone to be able to use them, don't check anything. When you start checking boxes it requires a match with all of the checked usergroups. I will update the description to be a bit more clear in the future as we've had this reported quite a few times :)

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

1. Yes
2. Yes
3. Yes
4. No

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?

Yep, it is possible :)

Any chance of adding a tip jar function? Something similar to https://www.changetip.com/

Doesn't seem like something many people would use, but if you (or a group of people) would like to fund a feature like this we could definitely look into it!

@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.

Yes, I'll go through them tomorrow morning. Sorry, I must've missed that post :)

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).

f65e497cec.png

That is odd, I'll have to look into this a bit more.

2) 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.

2a01ed7d10.png
So it does, that's an easy fix and it will be fixed in the next release :)

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:
6fd026f374.png


Right data:
a6309d61c3.png

This has already been fixed for the next release.

Hey guys,

When selling a resource with AD Credits, it only let's me insert a price if the resource is a
  • Uploaded file
  • External download URL
  • External purchase and download
BUT NOT if it's a
  • Does not have a file
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.

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.

See the first response in this post :)

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.

This issue has already been fixed for the next release. We're just waiting on a couple more things before we can push it :)

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.
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.

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."

This feature is already planned for a future release, though this is not a part of the core, it's part of a separate add-on we've released :)

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.

We'd likely integrate it with an existing system, or make our own as a separate add-on, not as part of the core. Though there are currently no plans to do so. Though, as I said earlier if people are interested in funding features, or grouping together to fund a feature we will look into 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.

See above

Having watched the addon evolve, I have two questions:
  1. Is it possible to convert from [bd] Banking
  2. 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?
Thanks :)

1. That is not a current feature, though we can possibly look into creating this feature if there are people wanting to convert from [bd] Banking
2. This is included with the Shop Add-on (though it does not use the user upgrades feature)

@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) {
  }
}

I don't think this has anything to do with the resource renamer as that is just an XML full of phrases. I'll definitely look into this for you though. Are you running the latest version?

Regards,

Jake
 
I don't think this has anything to do with the resource renamer as that is just an XML full of phrases. I'll definitely look into this for you though. Are you running the latest version?
This is what I'm running currently.

Screen Shot 2015-04-21 at 7.50.06 PM.webp
 
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

@Mike Creuzer or @Jake B. - can you guys check that?

My users aren't getting the credits. I am 99% sure I have everything correct. I checked the group that I want to get the credits, but they don't receive any credits for the action. I set it so that no user groups were checked, meaning all groups would get credit for the action, but still - no one except the admin is getting credits.

Totally stuck on this.
 
@Jake B., any update on the ability to select multiple nodes for use of applying credit to? I know that I can go and do it for each node, but that's about 60 nodes I'd need to do and each with a different priority level - and then to top it off, it's rather hard to see which one is what as they all show as Create Thread. :D
I've already had to do that with the resources for uploading.. but I only have about 3 categories there.
 
Top Bottom