Author Topic: Request: Expiring Unused Items  (Read 2533 times)

Offline texasyojimbo

Request: Expiring Unused Items
« on: June 15, 2007, 06:44:20 pm »
Perhaps for a future edition, it would be nice to have the option to create items which expire after a certain date, e.g. June 15, or after so many days, e.g. 30 days after purchase.

I might be able to do this by putting a date check in the item's onUse function (if date > June 15, return expiration message) but rather than a true "self-destruct" the item will simply sit until its used unsuccessfully. It would be nice if the item simply blinked out of existence.

Offline feeble

Re: Request: Expiring Unused Items
« Reply #1 on: June 15, 2007, 07:21:13 pm »
Sounds like a good idea.

Offline Xarcell

Re: Request: Expiring Unused Items
« Reply #2 on: June 19, 2007, 01:20:44 pm »
Really good idea.

Offline feeble

Re: Request: Expiring Unused Items
« Reply #3 on: June 19, 2007, 01:59:14 pm »
its probably doable now.

all you need to do it put a timestamp column in the inventory table

when buying an time put time() into it

then in dointerest file just delete any row thats below a certain timestamp.

or instead of delete replace, with another item, that all it shows is that this item has been deleted...which may not work exactly like that.....

could be fleshed out more, but thats the gist of it.