View Single Post
  #24  
Old 12-10-2009, 04:17 PM
Haylzee Haylzee is offline
Member
 
Join Date: Jun 2009
Posts: 34
Credits: 537
Haylzee
Default RE: Item Shop - 100% Done (For Now)

ETA: After now looking at this mod, I think it's set up differently from mine so what I've put below might not apply.

Ok this is how I set mine up, I have a shop.php which is the same as adopt.php (at the time I had free adoptables and shop adoptables which is why I made them separate, the free adoptables showed up on adopt.php and the ones that cost money showed up on the shop.php). adopt.php uses doadopt.php to put the pets into the owned adoptables table in the database. I made a copy of doadopt.php and called it buy.php, and edited shop.php so that instead of going to doadopt when adopting, it goes to buy.php instead. My buy.php page is coded to check that the user has enough money, if they don't they get told they don't have enough to buy the pet. If they do have enough, the price of the pet gets deducted from their total and the pet goes into their owned adoptables in the database.

Since promo.php still uses adopt.php and doadopt.php, I left it there as normal, but it didn't take long to realize that people could use adopt.php to get free adoptables, so I altered adopt.php to also link to buy.php (basically removing the need for doadopt.php altogether) because now even the free adoptables will still have to go through the process of the money check (which will of course go through because they are set at 0 currency anyway). So even if someone was to use a shop pet id with adopt.php, they will still get charged for it because it's going through the same system.

Of course, this can all be simplified down to just editing doadopt.php to do what buy.php does, but at the time I wanted to keep my doadopt.php unchanged. And I have simplified it a little by charging currency for all the adoptables, none are free. So they all show up on the same page now anyway.

I'm not entirely sure how you have yours set up, but as long as you make sure any adoptions have to go through the money check and money deduction process, no one can get shop adoptables for free.
Reply With Quote