Adopt only one of each species

Forum
Last Post
Threads / Messages

Niku

Member
Member
Joined
Aug 11, 2011
Messages
26
Points
0
Mysidian Dollar
2,631
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?
 
Here is the problem, in the inc/functions.php look for:

This starts on line 429.
PHP:
$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:

PHP:
$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.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,130
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top