Status
Not open for further replies.

Vcize

Customer
I run the occasional contest/giveaway (for real physical goods) on my forum. I would like to allow users to buy entries to the contest with credits through vbshop.

For the entries, I have a table that stores the userid, date, and contest name each time they make an entry. As such, I'd like to create an item that runs a simple SQL query (to insert an entry into that table) whenever a user purchases it.

Is this possible? I see that I can create custom items but I don't see any way to tie it to custom functionality like a sql query.
 
That's not possible in the default modification, you'd have to create an entirely new item type in order to make this happen.

My personal opinion is that it's unlikely we'll ever create an item type that allows for arbitrary SQL execution, since this is extremely dangerous and can potentially irreversibly wipe a forum clean off the face of the internet.
 
I'm not talking about letting the user enter an SQL query. They buy an item that triggers an event (SQL query or php file) that I have pre-defined, similar to the way VBCredits can add a custom action that was written by me.

Is there any way you can think of given the default vbshop application that I could accomplish what I'm going after? That is to let users buy raffle tickets for a drawing/giveaway I will hold.
 
You meant the ability to define a SQL query in the Item Configuration part of the AdminCP, to be run post user configuration, right?

If so, that's what I thought, but the problem still remains.

Let's say some of your "lesser admins" (i.e. those without Super Administrator and Can Run Queries from config.php) has gotten their accounts compromised. Now if they can access vBShop, currently they can't do much beyond delete your items or rename them to something that's funny for a 9 year old that just learned about human anatomy.

But if there was an item type that allowed for arbitrary SQL execution, they could change the SQL to DROP DATABASE and then the next time someone bought an item, poof. Your forum would be gone.

Unless it would severely harm the functionality of the mod, we avoid making our products potential vectors for mass destruction.


There's really no way of doing this in the default vBShop without code changes - you'd need to edit an existing item type's definition file and add code to the post-purchase function.
 
Status
Not open for further replies.

Legacy vBShop

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