Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.3.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=42)
-   -   Mys v1.3.x Stat/SKill System (http://www.mysidiaadoptables.com/forum/showthread.php?t=4563)

Missy Master 06-29-2014 10:26 AM

using 1.3.4 ! And it should, but yes using the latest :)

I will see if your levelup works okay on my live site ... and if it does that parts a go!

Hwona 06-29-2014 10:54 AM

^In that case, that MIGHT be the problem since this was made to work with v.1.3.3.

Hwona 06-29-2014 11:37 AM

^Nevermind! It was probably a mistake on my part- I caught a lot of miswording and issues. But, the first post works right? COuld you check your database for me?

Hwona 06-29-2014 11:51 AM

Great! I have the level up page ready for download. :3

Missy Master 06-29-2014 12:12 PM

Okay altering adopt and breeding both in the first section cause the dreaded white! page ... I did everything very slowly and carefully and then backtracked. As soon as I inserted '$statname = rand(minimum value,maximum value);' I lost adopt and breeding both!

Even with the table inserted correctly something isn't jibing for the code changes for the first random stats stuff.

Hwona 06-29-2014 12:32 PM

^Does it work for shop? Let me try and work this with my own files...

Hwona 06-29-2014 12:44 PM

Umm, would you mind showing me your files... there may be another way to do this... anyways, how does the database look?

Missy Master 06-29-2014 12:52 PM

2 Attachment(s)
here's my two files, if you can get this all worked out that will be wonderful ! :)

The Database is fine, it just has the added table --



15 statname int(4) No 0 Change Change Drop Drop

Hwona 06-29-2014 01:01 PM

^I don't know why, but your file popped up with no changes? Try this for adopt.php:
PHP Code:

<?php

use Resource\Native\Integer;
use 
Resource\Native\String;
use 
Resource\Native\Arrays;
use 
Resource\Native\Null;

class 
AdoptController extends AppController{

    public function 
__construct(){
        
parent::__construct("member");
        
$mysidia Registry::get("mysidia");
        if(
$mysidia->usergroup->getpermission("canadopt") != "yes"){
            throw new 
NoPermissionException("permission");
        }    
    }
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");        
        if(
$mysidia->input->post("submit")){
            
$this->access "member";
            
$this->handleAccess();
            
$id $mysidia->input->post("id");
            if(
$mysidia->session->fetch("adopt") != or !$id) throw new InvalidIDException("global_id");            
            
            
$adopt = new Adoptable($id);                
            
$conditions $adopt->getConditions();
            if(!
$conditions->checkConditions()) throw new NoPermissionException("condition");
            
            
$name = (!$mysidia->input->post("name"))?$adopt->getType():$mysidia->input->post("name");
            
$alts $adopt->getAltStatus();
            
$code $adopt->getCode();
            
$gender $adopt->getGender();
            
$statname rand(0,100);
            
            
            
            
            
$mysidia->db->insert("owned_adoptables", array("aid" => NULL"type" => $adopt->getType(), "name" => $name"owner" => $mysidia->user->username"statname" => $statname"currentlevel" => 0"totalclicks" => 0"code" => $code
                                                           
"imageurl" => NULL"usealternates" => $alts"tradestatus" => 'notfortrade'"isfrozen" => 'no'"gender" => $gender"offsprings" => 0"lastbred" => 0));
                        
            
$aid $mysidia->db->select("owned_adoptables", array("aid"), "code='{$code}' and owner='{$mysidia->user->username}'")->fetchColumn();
            
$this->setField("aid", new Integer($aid));
            
$this->setField("name", new String($name));            
            
$this->setField("eggImage", new String($adopt->getEggImage()));
            return;
        }
        
        
$mysidia->session->assign("adopt"1TRUE);
        
$ids $mysidia->db->select("adoptables", array("id"), "shop='none'")->fetchAll(PDO::FETCH_COLUMN);
        
$total = ($ids)?count($ids):0;
        
        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);
    }
}
?>


Missy Master 06-29-2014 01:20 PM

I wanted to mention that the new levelup code is giving me a white page :(

the adopt code IS working, though!


All times are GMT -5. The time now is 04:16 PM.

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