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)
-   -   Adopt only one of each species (http://www.mysidiaadoptables.com/forum/showthread.php?t=2294)

Niku 08-13-2011 12:45 AM

Adopt only one of each species
 
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.
PHP Code:

$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 Code:

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


All times are GMT -5. The time now is 01:21 AM.

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