Mysidia Adoptables Support Forum  

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

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-29-2015, 11:31 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 150,064
Abronsyth is on a distinguished road
Default Adopt Conditions Not Working

Resolved

Apparently the moreless condition is not working for adoptables on my website. For several adoptables I have the limit set to 1 or 2, and yet users are able to adopt 10+ with no issue (and looking through old threads I see this has been an issue for a while now).

Note; this is only happening for Promo and shop adoptables, the condition is working just fine for free adoptables not sold in shops. Looking through the files I believe this is because only adopt.php has the code that tells it to check the conditions before making the adoptable available. Shops and promocodes do not have this code, so they don't bother checking, which results in users being able to get as many of pets sold in shops and through promocodes as they like.

Does anyone know how to fix this? It's kind of really messed up the values of pets on my website. I'm going to be playing with it a bit and see if I can get it to work, so if I find it before someone else does then I will post it.

---

Here are the two snippets I found in adopt.php;
PHP Code:
            $adopt = new Adoptable($id);                
            
$conditions $adopt->getConditions();
            if(!
$conditions->checkConditions()) throw new NoPermissionException("condition"); 
and
PHP Code:
        if($total == 0$adopts = new Null;
        else{        
            
$adopts = new Arrays($total);
            
$available 0;
            
            foreach(
$ids as $id){
                
$adopt = new Adoptable($id);
                
$conditions $adopt->getConditions();    
                  if(
$conditions->checkConditions()) $adopts[$available++] = $adopt;    
            }
            
            if(
$available == 0$adopts = new Null;
            else 
$adopts->setSize($available);            
        }        
        if(
$adopts instanceof Null) throw new InvalidActionException("adopt_none");
        
$this->setField("adopts"$adopts);
    } 
So now I just need to figure out what to do with these, and where to put something like them in files that deal with promocode adopts and shop adopts.

----

Now looking at the file .../classes/class_adoptshop.php I think that the conditions snippet should be included in the display function (which I've snipped to show below), so that the code can check conditions, and if the user HAS met the moreless limit, then the adoptable is no longer displayed in the shop at all. I'm still not sure about this (as you all likely know I'm very uneducated with PHP), but I'm hoping that my speculations aren't too off.
PHP Code:
    public function display(){
        
$mysidia Registry::get("mysidia");      
        
$document $mysidia->frame->getDocument();              
        
$document->addLangvar($mysidia->lang->select_adopt);
        if(
$this->gettotal() == 0){
            
$document->addLangvar($mysidia->lang->empty);
            return;
        }     
      
        
$adoptList = new TableBuilder("shop");
        
$adoptList->setAlign(new Align("center""middle"));
        
$adoptList->buildHeaders("Image""Breed""Price""Buy");    
        
$adoptList->setHelper(new ShopTableHelper);      
        
$this->adopts $this->getadopttypes();
      
        foreach(
$this->adopts as $stockadopt){
            
$adopt $this->getadopt($stockadopt->type);
            
$cells = new LinkedList;
            
$cells->add(new TCell($this->getadoptimage($adopt->eggimage)));
            
#$cells->add(new TCell($adopt->class));
            #$cells->add(new TCell($adopt->type));
            
$cells->add(new TCell($adopt->description));
            
$cells->add(new TCell($adopt->cost));
            
$cells->add(new TCell($adoptList->getHelper()->getAdoptPurchaseForm($this$adopt)));
            
$adoptList->buildRow($cells);
        }      
        
$document->add($adoptList);        
    } 
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 02-18-2016 at 02:49 PM.
Reply With Quote
 


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 06:11 AM.

Currently Active Users: 9000 (0 members and 9000 guests)
Threads: 4,081, Posts: 32,032, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636