Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2017, 06:35 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 67,762
Dinocanid is on a distinguished road
Default 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.
__________________

Last edited by Dinocanid; 02-27-2017 at 06:38 PM.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:28 PM.

Currently Active Users: 842 (0 members and 842 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636