View Single Post
  #54  
Old 01-24-2010, 03:21 AM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 15,877
Seapyramid
Default RE: Giving pets a Gender

Quote:
Originally Posted by Roconza
@Seapyramid

I had started to use the abandoned script posted here but the download was lost in the move now I'm to scared to mess with it and I don't know how to make the abandoned adoptable open to claim by other members. So now I have a DB with abandoned pets and nothing to do with them.
Very simply.. set it up so when someone abandons it just updates to owned_adoptables... owner field to ""

Like this:

PHP Code:
mysql_query("UPDATE " $prefix "owned_adoptables SET owner='' WHERE aid='$id'"); 
Then when you have you page for them to take abandons... use something like..

PHP Code:
                $query2 "SELECT aid,name,currentlevel FROM " $prefix "owned_adoptables WHERE owner = ''"
to show them & someting like

PHP Code:
        $query0 "SELECT name,item FROM " $prefix "owned_adoptables WHERE aid='$id' LIMIT 1";
        
$result0 mysql_query($query0);
        
$num0 mysql_numrows($result0);
        switch (
true) {
            
//**************************************************
            // Adoptable Exists
            //**************************************************
            
case ($num0 0):
                
// <editor-fold defaultstate="collapsed" desc="Adoptable Exists">
                
$row0 mysql_fetch_assoc($result0);
                
$name $row0["name"];
                
$item $row0["item"];
                
$image "";
                if (
$item != "yes") {
                    
$image getcurrentimage($id);
                } else {
                    
$image getcurrentitemimage($id);
                }
                
$article_title "Signing New Contract with " $name "<br /><br />";
                
$article_content "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You are signing a contract with " $name ". Doing so will require a signing bonus of 200 Gold Pieces. When you're ready to sign a contract with this Companion, click on the <i>Sign Contract</i> button below.<br /><br />
                <center><a href='levelup.php=" 
$id "'><img src='" $image "' border='0'></a></center><br />
                <form name='form1' method='post' action='doabandon.php'>
                <p><input name='aid' type='hidden' id='aid' value='" 
$id "'>
                <input name='name' type='hidden' id='name' value='" 
$name "'></p>
                <p><input type='submit' name='submit' value='Sign Contract'></p></form>"
;
                
$_SESSION['abandon']=1;
                
// </editor-fold>
                
break; 
when they adopt

Now I will say once again.. my code is HIGHLY OPTIMIZED & WILL NO LONGER WORK with the basic script!!

What I offer is some insight & direction.. not a "fix".

Sea
Reply With Quote