Ok, so I don't think I've made a mod before, only tuts. But anyway if you noticed the tag "EASY ADOPTABLES SCRIPT ONLY", this mod is only for the old script. This is for the people with current sites using the old script, just while we're waiting for the upgrade script. Now, onto what it does... If you've ever used the currency & shop mod or tried to make an event, you'll know that you have to run a MySQL query to change it's type so it doesn't appear on the normal adopt.php page and only in the shop/event. With this mod, you'll be able to do it easily from the "Create New Adoptable" page in the ACP. This makes it easy to make new shop adoptables or event adoptables. Before we start, I suggest you make backups of the following:
adopt.php
shop.php
newadoptable.php (found in your adm directory)
makeadoptable.php (found in your adm directory)
Ready?
Step 1
-------------
First, open your phpMyAdmin and go to the adoptables table. Notice how I have a "Kind" column? You need to make one.
Step 2
-------------
To make one, click the following:
Now fill it in like this one:
Step 3
-------------
Now that you have a Kind column, open your FTP Server and open up "adopt.php" in your editor. Find:
and change it to:
Save it.
Step 4
-------------
If you use the shop mod, open up "shop.php" in the editor. Find:
Change to:
Save it.
Step 5
-------------
Now go into your adm directory and open up "newadoptable.php"
Find:
Underneath that, place:
<p>Adoptable Kind:
<input name='kind' type='text' id='kind'>
</p>
Save it.
Step 6
-------------
Go back to the adm directory and open "makeadoptable.php". Find:
Underneath that, place:
Then Find:
Underneath that, place:
Then find:
Underneath, place:
Finally find:
Replace with:
Now, you should get something like this when you go to make a new adoptable. Type "shop" in the Adoptable kind box for it to be a shop adoptable, and type "normal" for it to be a normal one.
NOTE: For the anti-theft, you still have to change the memberlevel to shop, although you can make a memberlevel type field as well by replacing every "kind" in this tut with "memberlevel" with the exception of "adopt.php". Also, there is already a memberlevel column so don't make another one.
I know this mod is probably very confusing so if you have any questions, ask.
adopt.php
shop.php
newadoptable.php (found in your adm directory)
makeadoptable.php (found in your adm directory)
Ready?
Step 1
-------------
First, open your phpMyAdmin and go to the adoptables table. Notice how I have a "Kind" column? You need to make one.
Step 2
-------------
To make one, click the following:
Now fill it in like this one:
Step 3
-------------
Now that you have a Kind column, open your FTP Server and open up "adopt.php" in your editor. Find:
PHP:
$query = "SELECT * FROM adoptables";
PHP:
$query = "SELECT * FROM adoptables WHERE kind = 'normal'";
Step 4
-------------
If you use the shop mod, open up "shop.php" in the editor. Find:
PHP:
$query = "SELECT * FROM adoptables WHERE memberlevel = 'shop'";
PHP:
$query = "SELECT * FROM adoptables WHERE kind = 'shop'";
Save it.
Step 5
-------------
Now go into your adm directory and open up "newadoptable.php"
Find:
PHP:
<p>Adoptable Description:
<input name='description' type='text' id='description'>
</p>
<p>Adoptable Kind:
<input name='kind' type='text' id='kind'>
</p>
PHP:
Save it.
Step 6
-------------
Go back to the adm directory and open "makeadoptable.php". Find:
PHP:
$description = $_POST["description"];
PHP:
$kind = $_POST["kind"];
Then Find:
PHP:
$description = mysql_real_escape_string($description);
PHP:
$kind = mysql_real_escape_string($kind);
Then find:
PHP:
if($level0 == ""){
echo "You did not choose a default image for your adoptable. Please go back and correct this.";
die("");
}
PHP:
if($kind == ""){
echo "You did not choose a kind for your adoptable. Please go back and correct this.";
die("");
}
PHP:
mysql_query("INSERT INTO adoptables VALUES ('', '$name','$level0','free','$description')");
PHP:
mysql_query("INSERT INTO adoptables VALUES ('', '$name','$level0','free','$description','$kind')");
Now, you should get something like this when you go to make a new adoptable. Type "shop" in the Adoptable kind box for it to be a shop adoptable, and type "normal" for it to be a normal one.
NOTE: For the anti-theft, you still have to change the memberlevel to shop, although you can make a memberlevel type field as well by replacing every "kind" in this tut with "memberlevel" with the exception of "adopt.php". Also, there is already a memberlevel column so don't make another one.
I know this mod is probably very confusing so if you have any questions, ask.