Jump to content

[Any Revision] Auto Donation Tutorial

Recommended Posts

[CENTER][FONT=arial black][B]RuneUnited's Autodonation Tutorial

Alright, so I had these auto donation files on my hand and decided to release it to everyone so they could make some use of it. You can either follow the tutorial listed below or if you can't figure it out, I can set it up for you for some money (Really helps towards my school tuition). [/B][/FONT]

[B]Notes: [/B]
[COLOR=#ff0000][B]- I'm tired, it's almost 12 pm, so there is probably spelling errors and possibly 1 or 2 things left out. Let me know.[/B][/COLOR]

[Spoiler=Website Side Tutorial]

[B]1.) [/B]
-Download the following zip file (Contains all of the website files and a sample server file).
[URL="http://up.ht/1hTwlDb"]Download Here[/URL]

[B]2.)[/B] Go into your webhost control panel, then navigate to "MySQL Databases".
[B]3.)[/B] Once there, create a new database.
[B]4.)[/B] Create a new user + password for that database.
[B]5.)[/B] Add the user to the database (Bind the user to the database).
[B]6.)[/B] Note: Don't forget the DATABASE NAME, DATABASE PASSWORD AND DATABASE USERNAME. Write it down somewhere.

[B]7.)[/B] Navigate back to your control panel, then select "phpMyAdmin".
[B]8.)[/B] Once done, select the database you've just created.

[SIZE=5][B]9.)[/B] Select "Import" near the top.[/SIZE]

[B]10.)[/B] Browse your computer for the donation.sql file that's in the files I just gave you.
[B]11.)[/B] Upload it, then press go.
Note: It should have created a "donation" table in your database.

[B]12.) [/B]Go to the folder I had you download, then select the website files folder. Edit the file "db.php".
[B]13.)[/B] Fill in the necessary information. (Database name, password, username). Leave localhost as is.
[B]14.) [/B]Edit paypal.php, then search for "edit to your", which you'll find a space to put in your paypal e-mail. Save all of the files.

[B]15.)[/B] Upload all of the "Website Files" into your webhost. Make sure they are all in the same directory.

[B]16.)[/B] Go to your control panel once more and select "Remote Mysql".
[B]17.)[/B] Add the ip to that list that [U][B]Your Server is hosted on[/B][/U].


[Spoiler=Server Side Tutorial]

[B]Note: You'll need to be an adequate coder in order to complete this.[/B]

1.) In the files that I have supplied you with, take the "DonationManager.java" file and edit it.
Here is the part where the term "adequate" comes in.
-You'll need to change all the imports to your server imports (Excluding the default java ones).
-You'll also need to change every method in the file so it fits the methods in your server. (Example: player.getUsername()) - It might be different in your server so you'll need to change anything else you see.
2.) Insert the file you've changed around into your server files and compile it. (If you get errors, Fix them of course -.-)
3.) You'll need a command so the users can receive their donation.
- Go to where you handle your commands and add the import for the donation manager.
- Once done, then add the following command:
if (cmd[0].equals("::recieve")) {

[B]Your done! Refer to the "How to change donation items" spoiler on how to set up your items.[/B]


[Spoiler=How to change your donation items]
1.)[/B] Start off by selecting index.php in your website files.
[B]2.)[/B] Scroll down until you see value options similar to these:
<option value="1">10 Donator Points - $5</option>
<option value="2">20 Donator Points - $10</option>
<option value="3">30 Donator Points - $15</option>
<option value="4">50 Donator Points - $20</option>
3.)[/B] These are the options (In order) that show up on your "Select Donation Item" page.
4.) Simply change around whichever ones you want and put the price so they know how much it is.
Note: Make sure the numbers are in order and none are listed twice.
[B]5.)[/B] Save your file, then open paypal.php
[B]6.)[/B] Scroll down until you see some things similar to this:
$price = '3.00';
if($_GET['prod'] == 1)
$price = '5';
if($_GET['prod'] == 2)
$price = '10';
if($_GET['prod'] == 3)
$price = '15';
if($_GET['prod'] == 4)
$price = '20';
if($_GET['prod'] == 5)
$price = '30';

[B]7.)[/B] To change the price of each of your items, simply look at the value id that is listed in your index.php (The number next to your item name)
[B]8.)[/B] So let's look at this example above: if ($_GET['prod'] == 1) which means if the value id is == 1 then the price will be $5. Simply change the values or add more to satisfy your needs.

[B]Make it so that it adds the items into your server:[/B]

[B]1.)[/B] Open up your DonationManager.java file
[B]2.)[/B] Scroll down until you see this or something similar:
if(checkDonationItem(player.getUsername()) == 1) { //Productid 1
[B]3.)[/B] This is saying that if the product id (Or value id, Note: remember you used the value id to set the price, it's the same thing).
[B]4.)[/B] Simply edit the coder under the first product id to give the items for that value.

[/Spoiler] Edited by Hope

Share this post

Link to post
Share on other sites
Thanks guys, very much appreciated.

Share this post

Link to post
Share on other sites
[quote name='Krooked']This can easily be exploited. Nonetheless good job on the tutorial.[/QUOTE]

Of course it can, thus why I released it. -.-

Share this post

Link to post
Share on other sites
Thanks bro! :D I saved this page on my desktop (source files and all) so that I can use this once I get paid webhosting :P

Share this post

Link to post
Share on other sites
[quote name='hellman2741']Good job man![/QUOTE]

Thanks, worked for about an hour on it.

[quote name='titandino']Thanks bro! :D I saved this page on my desktop (source files and all) so that I can use this once I get paid webhosting :P[/QUOTE]

Thanks titan.

Share this post

Link to post
Share on other sites