Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Addons/Mods Graveyard (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=41)
-   -   Choosing Adoptables Type [EASY ADOPTABLES SCRIPT ONLY] (http://www.mysidiaadoptables.com/forum/showthread.php?t=859)

Ashje 05-23-2009 05:12 PM

Choosing Adoptables Type [EASY ADOPTABLES SCRIPT ONLY]
 
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.

http://i172.photobucket.com/albums/w..._photo/1-1.jpg

Step 2
-------------
To make one, click the following:
http://i172.photobucket.com/albums/w..._photo/2-1.jpg
http://i172.photobucket.com/albums/w..._photo/3-1.jpg
Now fill it in like this one:
http://i172.photobucket.com/albums/w..._photo/4-1.jpg

Step 3
-------------
Now that you have a Kind column, open your FTP Server and open up "adopt.php" in your editor. Find:
PHP Code:

$query "SELECT * FROM adoptables"

and change it to:
PHP Code:

$query "SELECT * FROM adoptables WHERE kind = 'normal'"

Save it.

Step 4
-------------
If you use the shop mod, open up "shop.php" in the editor. Find:
PHP Code:

$query "SELECT * FROM adoptables WHERE memberlevel = 'shop'"

Change to:
PHP Code:

$query "SELECT * FROM adoptables WHERE kind = 'shop'"

Save it.

Step 5
-------------
Now go into your adm directory and open up "newadoptable.php"
Find:
PHP Code:

    <p>Adoptable Description
      <
input name='description' type='text' id='description'
    </
p

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:
PHP Code:

$description $_POST["description"]; 

Underneath that, place:
PHP Code:

$kind $_POST["kind"]; 

Then Find:
PHP Code:

$description mysql_real_escape_string($description); 

Underneath that, place:
PHP Code:

$kind mysql_real_escape_string($kind); 

Then find:
PHP Code:

if($level0 == ""){
echo 
"You did not choose a default image for your adoptable.  Please go back and correct this.";
die(
"");


Underneath, place:
PHP Code:

if($kind == ""){
echo 
"You did not choose a kind for your adoptable.  Please go back and correct this.";
die(
"");


Finally find:
PHP Code:

mysql_query("INSERT INTO adoptables VALUES ('', '$name','$level0','free','$description')"); 

Replace with:
PHP Code:

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.

Bloodrun 05-23-2009 10:02 PM

RE: Choosing Adoptables Type [EASY ADOPTABLES SCRIPT ONLY]
 
Very nice, when I get my laptop back, ill take a better look at it.

And, well, Ill say nothing more till I get my laptop back =D

Ashje 05-24-2009 03:17 AM

RE: Choosing Adoptables Type [EASY ADOPTABLES SCRIPT ONLY]
 
Thanks =D


All times are GMT -5. The time now is 01:06 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.