Status
Not open for further replies.

peppies

Customer
I set up activity THREAD to charge users 50 Credits when posting new thread in certain area of the forum.

I'm getting inconsistent results when the same person is first time charged 100 Credits which is double the amount while transaction history still only shows -50 Credits. When I posted another new thread correct amount was charged the second and third time. Tried different user, same pattern: charged 2x the first time and then correctly 1x per each thread. Same thing is currently happening in my testing forum and live site.

And just recently a user edited their existing post and was charged 50 Credits again while his transaction history shows that 50 Credits were returned to him
error.webp:

Any ideas?
 
Editing will reverse and then reapply the original transaction so any changes will take effect.

Are there two "charged 50 credits" and one "earned 50 credits" transactions for a user creating and then editing a thread? Then that is working as designed and calculates out to the correct end result (a thread existing = 50 credits paid for it)
 
I understand the theory behind this, but no, the user was charged 50 Credits even for editing only, while their log shows they earned 50. The log is correct and the real Credit count is not. So I have to manually adjust their Credits every time they post the thread, because they are 50 Credits short. You can try it in my testing forum. The login details are the same.
 
Last edited:
Ok, here is an example. I created a user with 500 Credits.

- user created a thread; log shows "spent 50" (450 left)
- user edited the same thread; log shows "earned 50" (400 left)
- user edited the same thread; log shows "earned 50" (350 left)
- user edited the same thread; clicked on "PREVIEW CHANGES" 3x; log shows 3 "spent 50" messages (50 left)

So even clicking on Preview post charges for every single click! The user only posted ONE THREAD and after 2 edits and pressing the Preview button 3x, he ends up 450 Credits short, earned nothing. Something is seriously wrong here. Here is the log showing all transactions I described above:

log.webp
 
I am setting this up to test locally. I dont think I've ever tried it with previewing :D Do you have more than one Thread event?
 
I am setting this up to test locally. I dont think I've ever tried it with previewing :D Do you have more than one Thread event?

Thank you. On the testing forum I only have one Thread event, on the live site there are two. Both installations behave the same way. The above example is from a testing forum with only one Thread event with correctly set Thread amount and Thread Negation Amount to 50. Perhaps I'm the only one here charging for threads so it has never been reported before.
 
Last edited:
Charging for threads and posting is pretty common, but nobody has reported this yet, possibly because of vB4.1 - still working on it.
 
Can you try this to see if it stops the junk when you preview?

In dbtech/credits/credits_vbulletin.php find

PHP:
VBCREDITS::apply($thread->vbcredits, $thread->fetch_field('threadid'));

replace with

PHP:
if (empty($thread->info['preview'])) VBCREDITS::apply($thread->vbcredits, $thread->fetch_field('threadid'));

similarly, for post previewing, find in the same file

PHP:
        if ($post->fetch_field('visible') == 1)
        {
            VBCREDITS::apply($post->vbcredits[0], $refid);
            if (sizeof($post->vbcredits) > 1) VBCREDITS::apply($post->vbcredits[1], $threadid);
        }

replace with

PHP:
        if ($post->fetch_field('visible') == 1 AND empty($post->info['preview']))
        {
            VBCREDITS::apply($post->vbcredits[0], $refid);
            if (sizeof($post->vbcredits) > 1) VBCREDITS::apply($post->vbcredits[1], $threadid);
        }
 
You must be using some different version of VBcredits, I'm using ver2 for VB 4.1.2 and the first part of your code does not exist:

Code:
VBCREDITS::apply($thread->vbcredits, $thread->fetch_field('threadid'));

Instead I got this:

Code:
$threadid = $thread->fetch_field('threadid');
		VBCREDITS::apply($thread->vbcredits, $threadid);
 
Hm you're right - I think I was accidentally looking at the lite version. In any case, you found the correct area to edit.

In dbtech/credits/credits_vbulletin.php find:

PHP:
        $threadid = $thread->fetch_field('threadid');
        VBCREDITS::apply($thread->vbcredits, $threadid);

replace with

PHP:
        $threadid = $thread->fetch_field('threadid');
        if (empty($thread->info['preview'])) VBCREDITS::apply($thread->vbcredits, $threadid);
 
Unfortunately that didn't fix anything. My forum still charges for post editing and hitting the Preview button. Perhaps you should write your instructions more clearly, you have some extra " } " in your code that wasn't there originally, but you wanted it replaced (marked in red):

Code:
if ($post->fetch_field('visible') == 1)
        {
            VBCREDITS::apply($post->vbcredits[0], $refid);
            if (sizeof($post->vbcredits) > 1) VBCREDITS::apply($post->vbcredits[1], $threadid);
        [COLOR="red"]}[/COLOR]

If I went with your instructions I was getting a syntax error so I removed the " } " which cleared the syntax error but didn't fix the original problem.
 
Last edited:
I am certain there were no incorrect amount of braces included in my instructions. I checked it again right now.

Is the ftp/admin access you sent me for the other issue still active? I can go take a look directly for you if it is.
 
Status
Not open for further replies.

Similar threads

Legacy vBCredits II Deluxe

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
846
Customer rating
0.00 star(s) 0 ratings
Back
Top