Question Award user a credit after x days of activity. | Not working as expected.

Status
Not open for further replies.
@Fillip H. I understand. Does the latest credits addon work the way I need it? If so I'm willing to remove the shop addon until it's compatible with new credits addon.

For my forum the credits addon with this functionality is much more important than the shop. :)

Thanks. :)
 
I'm not 100% sure if I'm honest, the logic of the code would seem to indicate that it should work that way but I can't be certain as I've not attempted to use it that way.

It's not easy to test either, since unless I want to manually wait for several days I have to fudge the numbers :P

I'll see if I can slot in testing this today :)
 
I'll help you test it as well. :)

Is it a simple upgrade? Or do I need to do anything special to upgrade.

I assume that since this is the main branch of the addon you are working on any issues would be a higher priority vs the old credits?
 
Is it a simple upgrade? Or do I need to do anything special to upgrade.
Disable Shop, then disable Credits, then upload the new files for Credits in order to ensure there aren't any issues while upgrading :)

I assume that since this is the main branch of the addon you are working on any issues would be a higher priority vs the old credits?
Of course, the difficulty here is just how tricky it is to actually test for the reasons I stated above.
 
@Fillip H.
I just updated to the latest 5.1.0rc2 and I'm unable to adjust currency with the adjust event or user edit in admincp.

I'm not seeing any errors when trying to modify it. It just simply doesn't change it. No errors in admin log either.

Should I do a fresh install?
 
Make sure you have an Adjust event defined for each of your currencies, and that it's active.

Lastly, try running this query:
UPDATE xf_dbtech_credits_event SET user_group_ids = '[]' WHERE event_trigger_id = 'adjust'

In case you were using the user group filter for it before.
 
I confirmed that the adjusts events are enabled for my currency, and I ran that query.

But im still unable to edit the value in user edit in admincp or from adjust event via credits.

Only able to edit the values by directly changing it in mysql xf_user table.

EDIT: I just uninstalled and reinstalled latest credits and I'm still having this issue.
 
Last edited:
I confirmed that the adjusts events are enabled for my currency, and I ran that query.

But im still unable to edit the value in user edit in admincp or from adjust event via credits.

Only able to edit the values by directly changing it in mysql xf_user table.

EDIT: I just uninstalled and reinstalled latest credits and I'm still having this issue.
I'm unable to replicate this issue. Can you please PM me with an FTP and AdminCP account so I can look into this @ your site?
 
Ok so I uninstalled v5.1.0rc2 and then installed 5.0.3 then upgraded to v5.1.0rc2 again. I can now adjust currency again. But now when I try to add a new currency I get this error.

2018-11-04_12-28-44.webp

As for access goes I don't have ftp only sftp via ssh. I will need to figure out how to create a new ssh key again.

Is there something I need to chmod? the files are untouched but If you need I can upload the files to google drive for you?

If you still need admincp access I can get that for you in a bit.


EDIT: After looking through the setup.php file I found...

PHP:
$tables['xf_dbtech_credits_currency'] = function (Create $table)
        {
            $table->addColumn('currency_id', 'int')->autoIncrement();
            $table->addColumn('title', 'varchar', 255)->setDefault('');
            $table->addColumn('description', 'blob')->nullable(true);
            $table->addColumn('active', 'tinyint')->setDefault(1);
            $table->addColumn('display_order', 'int')->setDefault(0);
            $table->addColumn('table', 'varchar', 255)->setDefault('');
            $table->addColumn('use_table_prefix', 'tinyint')->setDefault(1);
            $table->addColumn('column', 'varchar', 255)->setDefault('');
            $table->addColumn('use_user_id', 'tinyint')->setDefault(1);
            $table->addColumn('user_id_column', 'varchar', 255)->setDefault('user_id');
            $table->addColumn('decimals', 'tinyint', 2)->setDefault(0);
            $table->addColumn('privacy', 'tinyint')->setDefault(0);
            $table->addColumn('blacklist', 'tinyint')->setDefault(0);
            $table->addColumn('prefix', 'varchar', 50)->setDefault('');
            $table->addColumn('suffix', 'varchar', 50)->setDefault('');
            $table->addColumn('negative', 'tinyint')->setDefault(0);
            $table->addColumn('maxtime', 'int')->setDefault(0);
            $table->addColumn('earnmax', 'double')->setDefault(0);
            $table->addColumn('value', 'double')->unsigned(false)->setDefault(1);
            $table->addColumn('inbound', 'tinyint')->setDefault(1);
            $table->addColumn('outbound', 'tinyint')->setDefault(1);
            $table->addColumn('is_display_currency', 'tinyint')->setDefault(0);
            $table->addColumn('sidebar', 'tinyint')->setDefault(1);
            $table->addColumn('postbit', 'tinyint')->setDefault(1);
            $table->addColumn('member_dropdown', 'tinyint')->setDefault(0);
        };

I checked my database and saw that "postbit" table was not in "xf_dbtech_credits_currency". I manually added it via phpMyAdmin and it is now allowing me to add currencies.

I'm not sure if the installation is bugged or If I caused an anomaly while upgrading (un/re)installing and upgrading lol
 
Last edited:
Does the Adjust event work now?

Yes, that started working along with editing credit values in user admincp after the uninstall of rc and installing stable and then upgrading again to latest rc.

After that I just had to add the postbit table to database to be able to add new currencies in admincp.

As far as the daily activities event goes...

I have received my 1st credit for the default daily frequency.

Tomorrow I will see if I get another for 2 frequency.

I also have the 30 day frequency that I plan to use on my site setup.

Now I play the waiting game... Unless you know what to edit to make it think it's been 30 days without waiting.


I am currently at work. 10 hours left for my shift. Until I'm off I will not be able to do any testing involving direct MySQL edits or commands.

Thanks for your help in this matter!!!
 
Yes, that started working along with editing credit values in user admincp after the uninstall of rc and installing stable and then upgrading again to latest rc.
Just as a side note here, this is actually the same thing :)

In order to properly log transactions, the AdminCP credits editing also uses the Adjust event in order to save the edits. This is why I've taken gradually more aggressive steps to ensure an adjust event exists and is valid before loading the form in the AdminCP :)

In order to test this event I'll have to manually adjust the existing "last daily credits" time stamp then trick the forum into thinking the time is actually X days ago, I'll report back with my testing methodology and results.
 
Update: Actually, I think I might be able to say this is working even without any trickery. I noticed I'd already set up my event with a frequency of 30, and this is the result in the database:

1541418354266.webp

The highlighted row on the 14th of September is the last successful trigger, so it's been 24 days of "missed" triggers since then (not including today).

My question is: If the "Frequency" setting is set to 25, and it's skipped 24 transactions (14th Sept - 4th Nov inclusive), would you expect it to trigger today (on the 25th valid event trigger) or tomorrow (on the 26th valid event trigger)?

My guess is you'd expect it to trigger today. In the current RC2 version, the logic is actually bugged by two whole steps (it checks if the skipped transactions is less than or equal to the frequency, meaning it would trigger successfully on the 27th trigger).

Let me know your thoughts so I can ensure I get it right for RC3 :)
 
Hello @Rick7C2,

We hope your ticket regarding DragonByte Credits has been addressed to your satisfaction. This ticket has now been closed.

If your ticket has not been resolved, you can reply to this thread at any point in the next 7 days in order to reopen the ticket, afterwards this thread will be closed.

Please do not reply to this thread if your ticket has been resolved.

Thank you.


- DragonByte Technologies, Ltd.
 
Status
Not open for further replies.

DragonByte Credits

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