Is there a Limit adopted eggs for 1.3.2?

Forum
Last Post
Threads / Messages

Infernette

CODE CODE CODE CODE CODE
Member
Joined
Jan 29, 2013
Messages
164
Points
0
Location
Where I live? I live home.
Mysidian Dollar
15,625
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/forum/showthread.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...
 
Last edited:
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.
 
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.
 
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
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top