Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Is there a Limit adopted eggs for 1.3.2? (http://www.mysidiaadoptables.com/forum/showthread.php?t=3986)

Infernette 01-31-2013 10:26 AM

Is there a Limit adopted eggs for 1.3.2?
 
I've been looking around, and was wondering if there was a mod for 1.3.2 that limited the amount of adoptable eggs a user could have, much like this older one, http://www.mysidiaadoptables.com/for...ead.php?t=1854 that did so..
If there is, could anyone possibly point me in the direction of it? -figured it out :pleased:

I need to know the files for the shop and pound though, could anyone point me in that direction?

Edit : I also am trying to install the random adopts but, alas, I get the error, Parse error: syntax error, unexpected T_ELSE on line 45.. here the code...
  Spoiler: Code 
Code:

<?php

require("inc/init.php");

//***************//
//  START SCRIPT //
//***************//

$mysidia->session->assign("adopt", 1, TRUE);
if(!$mysidia->user->isloggedin){
  // The user is not logged in, show generic login error message
  $mysidia->displayerror("guest");
  $mysidia->session->terminate("adopt");

elseif(!is_numeric($mysidia->input->post("id"))){
  // We did not enter an id, or it is not a number
  $showingcontent = (!$mysidia->user->isloggedin)?$lang->guest:$lang->member;
  $mysidia->page->settitle($lang->title);
  $mysidia->page->addcontent($showingcontent);
 
  $stmt = $mysidia->db->join("adoptables_conditions", "adoptables_conditions.id = adoptables.id")
                                      ->select("adoptables", array(), constant("PREFIX")."adoptables.shop='none'ORDER BY RAND() LIMIT 3");
  $adoptform = "<form name='form1' method='post' action='doadopt.php'><h3>Available Adoptables</h3><table>";
  while($row = $stmt->fetchObject()){
          // Call a function to check if we have the proper privledge level to adopt this pet
          $canadopt = canadopt($aid, "showing", "none", $row); // Feed an adoptable ID and showing, to show the adopt to guests...

          if($canadopt == "yes"){
                        //If we can adopt the adoptable, show the image and adoption link...
                        $adoptform .= "<tr><td style='text-align: center'><img src='{$row->eggimage}' /></td></tr>";
}
 else{
            $eresult = runquery("SELECT * FROM ".$prefix."adoptables WHERE whenisavail='always' ORDER BY RAND() LIMIT 1");
            while($erow = mysql_fetch_array($eresult)){
                $aid=$erow['id']; //The adoptable's ID
                $type=$erow['type'];
                $description=$erow['description'];
                $eggimage=$erow['eggimage'];
                $article_content .= "<tr>

                <td style='text-align: center'><img src='".$eggimage."' /></td>";
            }

        } 
else{
  $row = $mysidia->db->join("adoptables_conditions", "adoptables_conditions.id = adoptables.id")
                                      ->select("adoptables", array(), constant("PREFIX")."adoptables.id='{$mysidia->input->post("id")}' ")->fetchObject() ORDER BY RAND() LIMIT 3"; 
 
  if(is_object($row)){
      $canadopt = canadopt($aid, "adopting", "none", $row);
          if($canadopt == "yes"){
            $mysidia->page->settitle("Adopting {$row->type}");
                $mysidia->page->addcontent($lang->adopt.$row->type.$lang->adopt2);
              $adoptform = "<br><img src='{$row->eggimage}' border='0'><br><form name='form1' method='post' action='doadopt.php'>
                                  <p>Adoptable Name: <input name='name' type='text' id='name'>
                                      <input name='id' type='hidden' id='id' value='{$row->id}'></p>
                                  <p><input type='submit' name='Submit' value='Adopt Me'></p></form>";
        $mysidia->page->addcontent($adoptform);                                         
          }
          else{
            $mysidia->page->settitle($lang->global_guest_title);
                $mysidia->page->addcontent($lang->adopt_failed);
      }         
  }
  else $mysidia->displayerror("id"); 
}

//***************//
//  OUTPUT PAGE  //
//***************//

$mysidia->output();

?>



Sorry, again...

Hall of Famer 01-31-2013 06:38 PM

Well its not really difficult to convert Mys v1.2.x script into Mys v1.3.x compatible versions. You just need to find the appropriate location to add the if statement, which will get the number of adopts a user has and prevent adoption if the user has too many eggs.

Infernette 01-31-2013 07:51 PM

Okay, I that makes sense. :)

Should I make edits to the code to make it work? (I am a noob at this, sorry...(I honestly don't even have a clue where to put it...))

Hall of Famer 02-02-2013 03:12 PM

Of course you need to edit the code, but if it does not work for ya, post your problem here and I may take a look and tell you what you should do.

Infernette 02-03-2013 07:47 PM

Okay, I have figured out how to do it with the regular adopt page, but is there a doadopt part for the pound and the adopts shop, and where is it located so I can edit it as well?

Still need help finding the pound and adoptshop instances to edit and some help with the random adopts code :)

Still need some helpz :d

kristhasirah 02-07-2013 04:22 PM

i think you can find the pound instances in Classes/class_pound.php
and the adoptshop in classes/class_stockadopt.php or class_adoptshop.php

i think, not sure

Infernette 02-08-2013 01:20 PM

Okay, I checked there, it seems to be those locations :)

I don't need anymore help, also, with this :)


All times are GMT -5. The time now is 07:15 AM.

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