|
Currency for leveling up / Adoptable shop (Fixed again)
|
|
03-26-2009, 04:33 AM
(This post was last modified: 04-05-2009 08:03 AM by kisazeky.)
Post: #1
|
|||
|
|||
|
Currency for leveling up / Adoptable shop (Fixed again)
Note with this update! Please, re-run the queries to add the shop adoptables, if you have already installed it. Thanks.
Important!! A way to prevent people stealing shop adoptables! Open adopt.php and find something like this in the code (it won't be exactly like mine): PHP Code: if($newID != $aID){below it, insert this: PHP Code: if($memberlevel != free){Earning money on level up Step 1: Run this here MySQL query to add the money field in your users table: PHP Code: ALTER TABLE usersStep 2: This is where the magic happens. Download levelup.php and edit it to suit your site. Replace the number 10 with your desired amount of currency per level up. Step 3: This is important if you still want people to be able to register. ![]() Edit register2.php and find this line: PHP Code: mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free',)"); Replace it with: PHP Code: mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free','0')"); Show the total amount of money to your users Add this.... PHP Code: if ($isloggedin == "yes"){In between ... PHP Code: //$isloggedin = "no"; PHP Code: }On all of your pages. Shop to buy adoptables Step 1: Download shop.php, buy.php, and buyconfirm.php and upload them to your main folder. Step 2: Add adoptables for sale by running a query like this. Do not change the shop part unless you know what you're doing. PHP Code: INSERT INTO adoptables VALUES ('', 'name','level 0 image','shop','cost') Then add the rank images, too. Put the image urls in place of the numbers. 1 will have its level 1 image, 2 the level 2 image, etc. PHP Code: INSERT INTO adoptable_rankimages VALUES ('name','1','2','3','4','5','6','7','8') DigiAdopt |
|||
|
03-26-2009, 04:57 AM
Post: #2
|
|||
|
|||
|
RE: [In Development] Currency for leveling up
Well, using your system of altering the users table will break the user registration system.
![]() You would want to also find in register2.php: PHP Code: mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free')"); Replace With: PHP Code: mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free','0')"); You need to add the extra column in there for the user's money. If the columns don't match, MySQL freaks out and new users are not registered correctly. Also, I would change: Code: ALTER TABLE usersTo: Code: ALTER TABLE usersUse INT when only a number is expected. ![]() Brandon Brandon Rusnak - RusnakWeb Admin and Founder A New Version of the MyBB Multiforums Mod is on the way! More details here. MyAdopts - Free Adoptables Site Hosting powered by Rusnak PHP Adoptables Lead, follow or get out of the way. |
|||
|
03-26-2009, 08:33 AM
(This post was last modified: 03-26-2009 08:34 AM by Killgore.)
Post: #3
|
|||
|
|||
|
RE: [In Development] Currency for leveling up
So Brandon, would i be able to fuse this with my idea i was working on? If so, how?
|
|||
|
03-26-2009, 08:37 AM
Post: #4
|
|||
|
|||
RE: [In Development] Currency for leveling up
(03-26-2009 08:33 AM)Killgore Wrote: So Brandon, would i be able to fuse this with my idea i was working on? If so, how? I would suggest do the same, except add a second column to the database to account for pearls and emeralds. Brandon Rusnak - RusnakWeb Admin and Founder A New Version of the MyBB Multiforums Mod is on the way! More details here. MyAdopts - Free Adoptables Site Hosting powered by Rusnak PHP Adoptables Lead, follow or get out of the way. |
|||
|
03-26-2009, 08:40 AM
Post: #5
|
|||
|
|||
|
RE: [In Development] Currency for leveling up
Okay. But there's still the dilemma that there's a chance of getting one out of five colors for each pearl or emerald. I'm guessing I'd need to create a field for each color pearl and emerald?
|
|||
|
03-26-2009, 09:31 AM
Post: #6
|
|||
|
|||
|
RE: [In Development] Currency for leveling up
PHP Code: $color = "";Just do that to assign a random pebble image and save in the db.
Brandon Rusnak - RusnakWeb Admin and Founder A New Version of the MyBB Multiforums Mod is on the way! More details here. MyAdopts - Free Adoptables Site Hosting powered by Rusnak PHP Adoptables Lead, follow or get out of the way. |
|||
|
03-26-2009, 10:22 AM
Post: #7
|
|||
|
|||
|
RE: [In Development] Currency for leveling up
Does it work right now?
|
|||
|
03-26-2009, 01:24 PM
(This post was last modified: 03-26-2009 01:24 PM by kisazeky.)
Post: #8
|
|||
|
|||
|
RE: [In Development] Currency for leveling up
Yes rosepose, getting currency for leveling up works. Just make sure to include Brandon's amendment or else people can't register anymore.
![]() What's in progress still is the shop for buying adoptables with the money. DigiAdopt |
|||
|
03-26-2009, 03:29 PM
Post: #9
|
|||
|
|||
|
RE: [In Development] Currency for leveling up
Could you edit the first post and add Brandon's extra part because I fail at this stuff...Thanks.
|
|||
|
03-27-2009, 03:10 AM
Post: #10
|
|||
|
|||
|
RE: [In Development] Currency for leveling up
Thanks
I'll try to add this to SE if the host decides to work ><
|
|||
|
« Next Oldest | Next Newest »
|

Search
Member List






![[Image: adFY.png]](http://p.gpxpl.us/adFY.png)