Log in

View Full Version : Adopt only one of each species


Niku
08-13-2011, 12:45 AM
I don't believe its working. I've tried doing a clean install and everything, but no matter what you can adopt unlimited adopts of XX species, even though i set it to 0 or 1. OTL
can anyone help me?

Chibi_Chicken
08-13-2011, 02:51 AM
Here is the problem, in the inc/functions.php look for:

This starts on line 429.

$query = "SELECT * FROM ".$GLOBALS['prefix']."owned_adoptables WHERE owner='$loggedinname' and type='$type'";
$result = runquery($query);
$num = mysql_numrows($result);

if($num > $row['morelessnum']) {


and replace it with:


$query = "SELECT * FROM ".$GLOBALS['prefix']."owned_adoptables WHERE owner='$loggedinname' and type='".$row['type']."'";
$result = runquery($query);
$num = mysql_numrows($result);

if($num >= $row['morelessnum']) {


That should allow you to now limit your users to the right number of adopts
The errors were $query was trying to get the type of pet from the wrong place and the if statement was only checking if you went over, not over and equal too.