SMF Shop
Home
Help
Search
Shop
Login
Register
SMF Shop
»
SMFShop
»
Coding
»
Coding Help Needed
Print
Pages: [
1
]
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...
)
Logged
Basil Beard
SMFShop Helper
Posts: 234
80 credits
View Inventory
Send Money To Basil Beard
Karma: +100/-2
Avast ye scurvy dog!
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.
Logged
Arrrrr!
gondie
Newbie
Posts: 0
71 credits
View Inventory
Send Money To gondie
Karma: +0/-0
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?
Logged
Print
Pages: [
1
]
SMF Shop
»
SMFShop
»
Coding
»
Coding Help Needed