View Single Post
  #7  
Old 04-18-2009, 05:37 PM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 16,094
Seapyramid
Default RE: Freezing and limiting adoptables

Still ignoring.. no errors.. just ignoring... larger section of code offered...

Code:
//Defines what level is used for mature count and number of babies user may adopt
$query = "SELECT * FROM adopts_owned_adoptables WHERE currentlevel < '5' and owner='$loggedinname' and isfrozen='no'";
$result = mysql_query($query);
$num = mysql_numrows($result);

if($num >= 5){

$article_title = "Your companions have you busy!";
//$article_date = date('Y-m-d');
$article_content = "<b>You have too many young companions!  Please <a href='myadopts.php'>help your young companions reach age 5 or higher</a> before 
adopting new companions.</b>";

}
else{
// Begin the output of all the adoptables to the user...

$query = "SELECT * FROM ".$prefix."adoptables ORDER By RAND() LIMIT 6";
$result = mysql_query($query);
$num = mysql_numrows($result);
}
//Loop out code
$i=0;
while ($i < $num) {

$aid=@mysql_result($result,$i,"id"); //The adoptable's ID
//$type=@mysql_result($result,$i,"type");
//$description=@mysql_result($result,$i,"description");
$eggimage=@mysql_result($result,$i,"eggimage");

// Call a function to check if we have the proper privledge level to adopt this pet
// This function checks all of the little conditions and makes sure they are present
// If they are not present, the adoptable is not shown here, as that would be cruel.
// We call the function with the showing flag to not deny the showing if the user is a guest.


if($promocode == ""){
$promocode = "none";
}

$canadopt = canadopt($aid, "showing", $promocode); // 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...

$article_content = $article_content."
<a href='adopt.php?id=".$aid."'><img src='".$eggimage."' border='0'></a>&nbsp;&nbsp;";

	if($isloggedin == "yes"){
	$article_content = $article_content."&nbsp;";
	}
	else{
	$article_content = $article_content."<p><img src='templates/icons/no.gif' border=0> <b>".$guesterror."</b></p>";
	}


}

$i++;
} // End the looping out of all adoptables...
Sea
Reply With Quote