Author Topic: Coding Help Needed  (Read 2276 times)

stephen1133

  • Guest
Coding Help Needed
« on: March 06, 2007, 02:04:17 am »
In SMF shop is it possible to have an item disappear after x uses (i.e. 5) or after a certain time frame...

$this->delete_after_use = true; is probably the code I need to change - but what to?

Any help would be greatly appriciated (as I'm a bit of a PHP novice...:P)

Offline Basil Beard

Re: Coding Help Needed
« Reply #1 on: March 06, 2007, 04:23:34 am »
I would add a "uses" the the shop_inventory table. Each time you use the item, increase uses by one. Then, if uses reaches x, manually delete the item in the file.
Arrrrr!

Offline gondie

Re: Coding Help Needed
« Reply #2 on: March 09, 2007, 07:37:16 am »
Hm, why do it manually?

Just add like maxUses and totalUses to the table, after ever use increase totalUses by 1 then an if statement like totalUses = maxUses and delete it that way?