View Single Post
  #3  
Old 08-04-2010, 12:40 AM
MikiHeart's Avatar
MikiHeart MikiHeart is offline
Premium Member
 
Join Date: Apr 2009
Posts: 187
Gender: Female
Credits: 27,607
MikiHeart
Default RE: Sea's trade script?

Line 497 add a }

Also, don't just copy and paste the whole code. Her myadopts.php will be different from yours because hers is modded to suit her sight.
You need to take out the trade sections and add it to your own :)

edit:

Search for
Code:
else if($act == "freeze"){
Above it, add
Code:
//******************************************************
  
  //Start Gift Section
  
  //******************************************************
   elseif ($act == "gift") {
      // We are renaming an adoptable
    
      if (is_numeric($id)) {
          // Now we see if the adoptable actually exists...
          
          $query = "SELECT * FROM " . $prefix . "owned_adoptables WHERE owner='$loggedinname' and aid='$id'";
          $result = mysql_query($query);
          $num = mysql_numrows($result);
          
          //Loop out code
          $i = 0;
          while ($i < 1) {
              //The adoptable's ID
              $aid = @mysql_result($result, $i, "aid");
              $currentlevel = @mysql_result($result, $i, "currentlevel");
              $newowner = @mysql_result($result, $i, "owner");
              $name = @mysql_result($result, $i, "name");
              $totalclicks = @mysql_result($result, $i, "totalclicks");
              $status = @mysql_result($result, $i, "tradestatus");
              
              $i++;
          }
          
          if ($aid == $id) {
              $image = getcurrentimage($id);
              
              if ($status != "notfortrade") {
                  if ($more == "") {
                      $article_title = "Sending " . $name . " to new Owner<br /><br />";
                      $article_content = $found . "<center><img src='" . $image . "'></center><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You are about to send this Pet to another Owner and add it to their Account.  Doing so will <b>permantally remove</b> the Pet from your Account.<br /><br />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To complete your gift or trade type in the name of the Username you are sending this Pet to and then click the <b>Send Pet</b>button below.<br /><br />

                    <form name='form1' method='get' action='myadopts.php'>
                      <p>Caretaker's Name:
                        <input name='more' type='text' id='more'>
                    <input name='id' type='hidden' id='id' value='" . $id . "'>
                    <input name='act' type='hidden' id='act' value='gift'>
                    </p>
                      <p>
                    <input type='submit' name='Submit' value='Send Pet'>
                    </p>
                    </form>";
                    
                  } else {
                      $uchquery = "SELECT username FROM " . $prefix . "users WHERE username='$more'";
                      $uchresult = mysql_query($uchquery);
                      $uchnum = mysql_num_rows($uchresult);
                      if ($uchnum == "0") {
                          $article_title = "Pet Not Sent<br /><br />";
                          $article_content = $found . 'There is no user by the name of ' . $more . ' at the this site .<br /><br /><a href="myadopts.php?act=gift&id=' . $id . '">Enter Another user</a>';
                      } else {
                          
                          
                          $query = "UPDATE " . $prefix . "owned_adoptables SET owner='" . $more . "' WHERE aid='" . $id . "' and owner='" . $loggedinname . "'";
                          mysql_query($query);
                          
                          
                          $article_title = "Pet Sent<br /><br />";
                          $article_content = $found . "Pet is now with " . $more . " and can be seen on their account!";
                      }
                  }
              } else {
                  
                  
                  $article_title = "Action Forbidden!<br /><br />";
                  $article_content = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This Pet CAN NOT be abandoned! You may not do this, sorry. Return to your <a href='myadopts.php'> adoptables</a>.";
              }
          } else {
              $article_title = $err_idnoexist . "<br /><br />";
              $article_content = $err_idnoexist_text;
          }
      } else {
          $article_title = $err_idnoexist . "<br /><br />";
          $article_content = $err_idnoexist_text;
      }
  }
And it should work in your own myadopts.php
But this is just a theory, I haven't tested this.
I'm glad to have had a look at it though. So I know what it will take when I go to make my own trade system in which users can trade pets and items :)
Reply With Quote