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 11-08-2016, 09:02 PM
ToshibaThecat ToshibaThecat is offline
Member
 
Join Date: Nov 2016
Posts: 2
Gender: Female
Credits: 1,423
ToshibaThecat is on a distinguished road
Default Level up and daycare not working

On my site http://lilkatz.mysidiahost.com/index the Level up and daycare isn't working anymore, It says "Fatal Error: Class LevelupController either does not exist, or has its include path misconfigured!"

The code thats in levelup.php is

<?php

use Resource\Collection\ArrayList;
use Resource\Utility\Curl;

class LevelupView extends View{

public function click(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$adopt = $this->getField("adopt");
$reward = $this->getField("reward")->getValue();
$document->setTitle("{$this->lang->gave} {$adopt->getName()} one {$this->lang->unit}");

$image = $adopt->getImage("gui");
$image->setLineBreak(TRUE);
$summary = new Division;
$summary->setAlign(new Align("center"));
$summary->add($image);
$summary->add(new Comment("{$this->lang->gave}{$adopt->getName()} one {$this->lang->unit}."));
$summary->add(new Comment($this->lang->encourage));
$summary->add(new Comment("<br> You have earned {$reward} {$mysidia->settings->cost} for leveling up this adoptable. "));
$summary->add(new Comment("You now have {$mysidia->user->getcash()} {$mysidia->settings->cost}"));
$document->add($summary);
}

public function siggy(){

}

public function daycare(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$document->setTitle($this->lang->daycare_title);
$document->addLangvar($this->lang->daycare, TRUE);

$daycare = $this->getField("daycare");
$adopts = $daycare->getAdopts();
$daycareTable = new Table("daycare", "", FALSE);
$daycareTable->setBordered(FALSE);
$total = $daycare->getTotalAdopts();
$index = 0;

for($row = 0; $row < $daycare->getTotalRows(); $row++){
$daycareRow = new TRow("row{$row}");
for($column = 0; $column < $daycare->getTotalColumns(); $column++){
$adopt = new OwnedAdoptable($adopts[$index]);
$cell = new ArrayList;
$cell->add(new Link("levelup/click/{$adopt->getAdoptID()}", $adopt->getImage("gui"), TRUE));
$cell->add(new Comment($daycare->getStats($adopt)));
$daycareCell = new TCell($cell, "cell{$index}");
$daycareCell->setAlign(new Align("center", "center"));
$daycareRow->add($daycareCell);
$index++;
if($index == $total) break;
}
$daycareTable->add($daycareRow);
}

$document->add($daycareTable);
if($pagination = $daycare->getPagination()) $document->addLangvar($pagination->showPage());
}
}
?>
Reply With Quote
  #2  
Old 11-09-2016, 02:25 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 68,542
Dinocanid is on a distinguished road
Default

If this was in your levelup.php file, then it has the wrong code in it. It should have this:
PHP Code:
<?php

use Resource\Native\Integer;
use 
Resource\Collection\ArrayList;
use 
Resource\Utility\Curl;

class 
LevelupController extends AppController{

    const 
PARAM "aid";
    private 
$adopt;
    private 
$settings;

    public function 
__construct(){
        
parent::__construct();
        
$this->settings = new LevelSetting;
        
$mysidia Registry::get("mysidia");

        if(
$mysidia->input->action() == "click" or $mysidia->input->action() == "siggy"$this->adopt = new OwnedAdoptable($mysidia->input->get("aid"));
        if(
$mysidia->user instanceof Member){
            
$status $mysidia->user->getstatus();   
            if(
$status->canlevel == "no") throw new InvalidActionException("banned");
        }    
    }
    
    public function 
index(){
        throw new 
InvalidActionException("global_action");
    }
    
    public function 
click(){
        
$mysidia Registry::get("mysidia");
        
$date = new DateTime;
        
$ip secure($_SERVER['REMOTE_ADDR']);

        if(
$this->settings->system != "enabled") throw new NoPermissionException("disabled");
        elseif(
$this->adopt->hasVoter($mysidia->user$date)){
            
$message = ($mysidia->user instanceof Member)?"already_leveled_member":"already_leveled_guest";
            throw new 
LevelupException($message);        
        }
        elseif(
$this->adopt->isFrozen() == "yes") throw new LevelupException("frozen");
        elseif(
$mysidia->user->getVotes() > $this->settings->number) throw new LevelupException("number");
        elseif(
$this->settings->owner == "disabled" and $this->adopt->getOwner() == $mysidia->user->username){
             throw new 
LevelupException("owner");               
        }
        else{
            
$newClicks $this->adopt->getTotalClicks() + 1;
            
$this->adopt->setTotalClicks($newClicks"update");
            
$mysidia->db->insert("vote_voters", array("void" => NULL"date" => $date->format('Y-m-d'), "username" => $mysidia->user->username"ip" => $ip"adoptableid" => $mysidia->input->get("aid")));         
            
            if(
$this->adopt->hasNextLevel()){
                
$nextLevel $this->adopt->getNextLevel();
                
$requiredClicks $nextLevel->getRequiredClicks();
                if(
$requiredClicks and $newClicks >= $requiredClicks$this->adopt->setCurrentLevel($nextLevel->getLevel(), "update");
            }
            
            
$reward $mysidia->user->clickreward($this->settings->reward);
            
$mysidia->user->changecash($reward);            
            
$this->setField("adopt"$this->adopt);
            
$this->setField("reward", new Integer($reward));            
        }
    }

    public function 
siggy(){
        
$mysidia Registry::get("mysidia");
        
// The adoptable is available, let's collect its info
        
$usingimage "no";
        
$image $this->adopt->getImage(); 
      
        
$usegd $mysidia->settings->gdimages;
        
$imageinfo = @getimagesize($image);
        
$imagemime $imageinfo["mime"]; // Mime type of the image file, should be a .gif file...

        
if(function_exists('imagegif') and $usegd == "yes" and $imagemime == "image/gif"){
            
$usingimage "yes"//Turn the template system off
            
$type $this->adopt->getType();
            list(
$width$height$type$attr) = getimagesize($image); // The size of the original adoptable image

            // Lets create the new target image, with a size big enough for the text for the adoptable
            
$newheight $height 72;
            
$newwidth = ($newwidth 250)?250:$width;
            
$img_temp imagecreatetruecolor($newwidth$newheight); 
            
$alphablending true;  
         
            
// Lets create the image and save its transparency  
            
$img_old = @imagecreatefromgif($image);  
            
imagealphablending($img_oldtrue);  
            
imagesavealpha($img_oldtrue);
   
            
// Lets copy the old image into the new image with  
            
ImageCopyResampled($img_temp$img_old0000$width$height$width$height);    
            
$textheight $width 2;
            
$image $img_temp;
            
$bgi imagecreatetruecolor($newwidth$newheight);
            
$color imagecolorallocate($bgi515151);
         
            
// Build text for siggy
            
$str1 "Name: ".$this->adopt->getName();
            
$str2 "Owner: ".$this->adopt->getOwner();
            
$str3 "Click Here to Feed Me!";
            
$str4 "More Adopts at:";
            
$str5 "www.".constant("DOMAIN");

            
// Renger Image
            
imagestring ($image120$textheight,  $str1$color);
            
imagestring ($image120$textheight 13,  $str2$color);
            
imagestring ($image120$textheight 26,  $str3$color);
            
imagestring ($image120$textheight 42,  $str4$color);
            
imagestring ($image120$textheight 55,  $str5$color);
            
$background imagecolorallocate($image000);  
            
ImageColorTransparent($image$background);  
 
            
// At the very last, let's clean up temporary files
            
header("Content-Type: image/GIF");
            
ImageGif ($image);
            
imagedestroy($image);
            
imagedestroy($img_temp);
            
imagedestroy($img_old);
            
imagedestroy($bgi);

        }
        else{      
                
// We are going to try and get this image the old fashioned way...
            
$extList = array();
            
$extList['gif'] = 'image/gif';
            
$extList['jpg'] = 'image/jpeg';
            
$extList['jpeg'] = 'image/jpeg';
            
$extList['png'] = 'image/png';

            
//Define the output file type
            
$contentType 'Content-type: '.$extList$imageinfo['extension'] ];

            if(
$imageinfo['extension'] =! "image/gif" and $imageinfo['extension'] =! "image/jpeg" and $imageinfo['extension'] =! "image/png"){             
                throw new 
InvalidIDException("The file Extension is not allowed!");
            }
            else{
                
// File type is allowed, so proceed
                
$status "";
                
header($contentType);
                
$curl = new Curl($image);
                
$curl->setHeader();
                
$curl->exec();
                
$curl->close();
            } 
        }
    }
    
    public function 
daycare(){        
        
$daycare = new Daycare;
        
$adopts $daycare->getAdopts();
        
$this->setField("daycare"$daycare);
    }
}
?>
What you posted seems to be the levelupview.php file. Do you add any mods or anything?
__________________
Reply With Quote
  #3  
Old 11-11-2016, 11:43 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 397,813
Hall of Famer is on a distinguished road
Default

Try reuploading levelup.php and view/levelupview.php and see if it fixes your problem.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
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 04:48 PM.

Currently Active Users: 288 (0 members and 288 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