PDA

View Full Version : Just need to know how i can start this


Killgore
03-24-2009, 10:05 PM
Okay, i wanted to make that "shop" idea in the Suggestions forum. I made the basic HTML page, and this is what i have so far: http://sylonia.comyr.com/adoptables/gem.php

What i want to do, is edit levelup.php (or is i a different file?) so that it would give the user one pearl of any random color (the dots on top) and one out of every 10 or so clicks, give them an emerald of any random color (the gem underneath the pearls). When they click an adoptable and receive the pearl or emerald, the corresponding number on the "shop" page is incremented by 1. When the user wants to adopt one, it checks to see if the user has enough pearls or emeralds to buy it. If yes, it proceeds with the adoption and subtracts the price that corresponds with the creature adopted, from their total balance of that particular currency.

1: Would i create a new table with the user ID and/or username, plus how much of each gem they have, or would i be able to add new fields to the "users" section already in place?
2: Which files would i need to edit to make this happen?
3: I've gone through w3schools.com to find a way to do this, but i only found bits and pieces. Does anyone have an excellent PHP tutorial website they can refer me to?

When i finish this to my satisfaction (I'm a huge perfectionist, so it will be good ;)), I'll be putting this up in the mods section :)

BMR777
03-25-2009, 09:54 AM
1: Would i create a new table with the user ID and/or username, plus how much of each gem they have, or would i be able to add new fields to the "users" section already in place?

I would suggest making a new database table that records how many emeralds and pearls the user has along with how many clicks are required to get another emerald or pearl. Then in levelup.php you would have to run a check as the clicks are counted to see if the user has enough clicks to get an emerald or pearl. Then you would on your custom page whenever the user redeems one of these items, you would decrease their emerald / pearl count in the table.

2: Which files would i need to edit to make this happen?

Your custom file would need to be edited, along with levelup.php. You'll also probably want to make a new database table for this. :)

Hope it helps,
Brandon

Killgore
03-25-2009, 02:27 PM
Okay, that's a big help as to how i would start it. I'm almost positive I'll need more help sometime in the future ;)