Status
Not open for further replies.
I am rewriting a key part of the core, because here is whats happening:

vBCredits used to keep track of exactly how many credits you had as it went through producing a page. The problem was, it did it all selfishly, and any addons that changed the currency amounts on the database might be overwriting the direct database editing of integrated addons (like say, buying something in vbshop).

My current solution to that was to keep a backup value of your currency on the userinfo, and when it comes time to save to the database, it saves the difference vs the direct amount, to preserve any changes to the database that happened by something else.

What this bug report has uncovered though, is that vb sometimes has multiple copies of the userinfo flying around, and will swap them in and out of play in between vbcredits' attempts to update. The result? Now my own updates are getting lost :p So vbcredits trips up and is doing extra math trying to compensate behind the scenes, but as you can see, it isnt adding up and isnt recording to the transaction log about it.

So, this is taking forever, because this was a complicated and central part of the core. The good news though, is that you are forcing me to actually get to the bottom of a session issue whereupon i never really liked or trusted the bandaid that i originally came up with to fix it :p

**the post preview thing is a minor, unrelated issue that i will address separately after this

Thank you as usual, for your patience.
 
I updated the pro version with the edits that i think will do the trick. Do you still have access to download it?
If so, download and upload the files (dont need to run the upgrade). Let me know how it goes.
 
Thank you for your attention on this one. I still have access to the download area and I did re-upload all files and tested it.

1. The issue where user is charged 2x for creating new thread seems to be fixed.
2. However clicking on the post PREVIEW link charges the user again and it does it as many times as you click on it. I'm charging 50 per new thread and clicked 10x on the preview link, ended up charged 500 credits. When you start a new thread and hit the preview 1x and then submit (common practice) you are charged 100 credits for this action. (50 for new thread + 50 for previewing the post)
3. Also, when user clicks on a new thread button but decides to cancel and not post, he's being charged anyway as if the thread was posted

You can test the above on my testing forum which you have the details and access for.
 
Last edited:
lol, as i said, the preview thing is MINOR, compared to the charged 2x thing. I just wanted you to confirm the fix for that before I give you the fix for the preview :p

edit the vBCredits II - Thread plugin and replace the PHP Code with:
PHP:
if ($this->fetch_field('visible') == 1 AND empty($this->info['preview'])) $this->vbcredits = VBCREDITS::action('thread', $this->fetch_field('postuserid'), true, false, array('forumid' => $this->fetch_field('forumid'), 'multiplier' => $this->post['pagetext']));

and you should be all set
 
That fixed it. Thank you very much!!! Worth the wait. Hopefully when updates are released this fix will be included. Thanks again.
 
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
845
Customer rating
0.00 star(s) 0 ratings
Back
Top