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)
-   -   Limiting adopt amount not working correctly (http://www.mysidiaadoptables.com/forum/showthread.php?t=5384)

Dinocanid 02-27-2017 06:35 PM

Limiting adopt amount not working correctly
 
Another issue I've run into recently. I have a very basic system on my site where users can only adopt/breed a certain amount of adoptables before they need more space. The problem is that users can't seem to buy more than 35 spaces, even if the currency comes out of their account. There also seems to be a problem with users still being able to get adoptables from the adoption center, even though I use the exact same code on the other pages to stop users from going over. I can't seem to do it myself if at full capacity, but other users on the site say that they still can.

PHP Code:

$shelfSpace $mysidia->db->select("users", array("shelfspace"), "username = '{$mysidia->user->username}'")->fetchColumn(); 
        
$adoptAmount $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}'")->rowCount();
        if(
$userStatus->canbreed == "no") throw new NoPermissionException("permission");
        elseif(
$adoptAmount >= $shelfSpace){
        throw new 
NoPermissionException("Your pantry is full. Try clearing some space or buy an expansion!");


(An example of it in breeding.php)

PHP Code:

             if($mysidia->input->post("buyspace")){
$mysidia->user->changecash(-100);
$mysidia->db->update("users", array("shelfspace" => ($mysidia->user->shelfspace 10)), "username = '{$mysidia->user->username}'"); 

(Part of the code where the users can buy space)

The really strange part is that it seems to be linked to the amount of spaces I have, which is 35. In phpMyAdmin, space is not shared and is stored with the individual user. The system will acknowledge that the user has bought space, but they still won't be able to keep more than 35 pets.


All times are GMT -5. The time now is 06:00 PM.

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