Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #41  
Old 06-29-2014, 11:54 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,553
Hwona is on a distinguished road
Default

Ok, let's take this step by step.
Try this code on a non-frozen adopt(refresh the page after clicking):
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']);
        
$adoptablestatname $this->adopt->getAdoptstatname();

        if(
$this->settings->system != "enabled") throw new NoPermissionException("disabled");
        elseif(
$this->adopt->hasVoter($mysidia->user$date)){





            
$message "<div id='stats'>Statname: {$adoptablestatname}</div>";
$message $message .= (($mysidia->user instanceof Member)?$mysidia->lang->already_leveled_member:$mysidia->lang->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 Boost Me!";
            
$str4 "More Pets 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);
    }
}
?>
If that magically works, try this on a frozen adopt(refresh the page after clicking):
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']);
        
$adoptablestatname $this->adopt->getAdoptstatname();

        if(
$this->settings->system != "enabled") throw new NoPermissionException("disabled");
        elseif(
$this->adopt->hasVoter($mysidia->user$date)){





            
$message "<div id='stats'>Statname: {$adoptablestatname}</div>";
$message $message .= (($mysidia->user instanceof Member)?$mysidia->lang->already_leveled_member:$mysidia->lang->already_leveled_guest);  


            throw new 
LevelupException($message);        
        }
        




        
        
        elseif(
$this->adopt->isFrozen() == "yes"
        
$frozenmessage "<div id='stats'>
Statname: 
{$adoptablestatname}
</div><br>
We're sorry, but you cannot add clicks to this adoptable at this time because its owner has chosen to freeze it.  Frozen adoptables do not accept new clicks and do not level up.  Thanks anyway for the click though, but the owner of this adoptable wants to keep this adoptable young so it will not be counted."
;
        throw new 
LevelupException($frozenmessage);
        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 Boost Me!";
            
$str4 "More Pets 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);
    }
}
?>
And if that magically works, try this on all kinds of adopts:
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']);
        
$adoptablestatname $this->adopt->getAdoptstatname();
        
$adoptablename $this->adopt->getName();

        if(
$this->settings->system != "enabled") throw new NoPermissionException("disabled");
        elseif(
$this->adopt->hasVoter($mysidia->user$date)){





            
$message "<div id='stats'>Statname: {$adoptablestatname}</div>";
$message $message .= (($mysidia->user instanceof Member)?$mysidia->lang->already_leveled_member:$mysidia->lang->already_leveled_guest);  


            throw new 
LevelupException($message);        
        }
        




        
        
        elseif(
$this->adopt->isFrozen() == "yes"
        
$frozenmessage "<div id='stats'>
Statname: 
{$adoptablestatname}
</div><br>
We're sorry, but you cannot add clicks to this adoptable at this time because its owner has chosen to freeze it.  Frozen adoptables do not accept new clicks and do not level up.  Thanks anyway for the click though, but the owner of this adoptable wants to keep this adoptable young so it will not be counted."
;
        throw new 
LevelupException($frozenmessage);
        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{
          
$levelupmessage "<br><text align ='center'><div id='clickpagelink'><a href='{$mysidia->path->getAbsolute()}levelup/click/{$this->adopt->getAdoptID()}'>Click here to visit {$adoptablename}</a><br></div>";
          throw new 
LevelupException($levelupmessage);
            
$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 Boost Me!";
            
$str4 "More Pets 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);
    }
}
?>
If those don't work, I really don't know what to do from there. :L
__________________

Last edited by Hwona; 06-30-2014 at 12:09 AM.
Reply With Quote
  #42  
Old 06-30-2014, 08:48 AM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 54,888
Missy Master is an unknown quantity at this point
Default

Ok the first code on a non frozen --- I was able to level and did NOT get the white page of DOOOM.

I refreshed and got this:

An error has occurred.

Statname: 53
You already leveled this Pet today. You may only Boost a Pet once per day. Please come back tomorrow to Boost this Pet again

The *first* code works on frozen and non frozen.

The second and third codes, WHITE OUT ... so we are a lot closer :) At least one code works to some degree, not sure what the Statname 53 error is.

Was there a formatting supposed to show for this? ( the pretty layout like you have? )

.. I didn't see that, not sure if we have that coded in yet.
Reply With Quote
  #43  
Old 06-30-2014, 08:57 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,553
Hwona is on a distinguished road
Default

We won't be able to get to that until this levelup thing is fixed - is there a way to do this without the ERROR?! EEEEP!!!
Try 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']);
        
$adoptablestatname $this->adopt->getAdoptstatname();

        if(
$this->settings->system != "enabled") throw new NoPermissionException("disabled");
        elseif(
$this->adopt->hasVoter($mysidia->user$date)){





            
$message "<div id='stats'>Statname: {$adoptablestatname}</div>";
$message $message .= (($mysidia->user instanceof Member)?$mysidia->lang->already_leveled_member:$mysidia->lang->already_leveled_guest);  


            throw new 
comment($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 Boost Me!";
            
$str4 "More Pets 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);
    }
}
?>
__________________
Reply With Quote
  #44  
Old 06-30-2014, 09:18 AM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 54,888
Missy Master is an unknown quantity at this point
Default

Okay ...THAT code is working perfect now, no error but:

when you try to click again there is a white page. Possibly there is something we are missing in a lang file? I've noticed that often throws a white page, when that's missing or off ( something in lang )

I see what you mean and it might be the comment thing ...
Reply With Quote
  #45  
Old 06-30-2014, 09:23 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,553
Hwona is on a distinguished road
Default

Wait, it works but throws a white page at the same time?
__________________
Reply With Quote
  #46  
Old 06-30-2014, 09:30 AM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 54,888
Missy Master is an unknown quantity at this point
Default

You can go level once.

The fails before wouldn't even let you do that without white page.

If you go back to try to re level, it throws white page now with this latest code.

BUT --

The code you had JUST before that ... did work and give the 'already boosted' comment, but it gave that Statname 53 error mentioned too.
Reply With Quote
  #47  
Old 06-30-2014, 09:40 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,553
Hwona is on a distinguished road
Default

^Does html work in the lang files?
__________________
Reply With Quote
  #48  
Old 06-30-2014, 09:40 AM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 54,888
Missy Master is an unknown quantity at this point
Default

Ok the previous code where you posted three, and the first one works?

I just realized what that code is doing!

It's pulling the statname result and posting THAT, along with the already leveled message!



Let me see if I can fix it ...
Reply With Quote
  #49  
Old 06-30-2014, 09:42 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,553
Hwona is on a distinguished road
Default

^That's what I did for my site. ^.^ If html works for lang files, I may be able to fix it...
__________________
Reply With Quote
  #50  
Old 06-30-2014, 09:51 AM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 54,888
Missy Master is an unknown quantity at this point
Default

Okay I removed this:

$message = "<div id='stats'>Statname: {$adoptablestatname}</div>";


I've attached what I believe to be a working version of levelup for 1.3.4 and thank you so much for all your help and work !! :)
Attached Files
File Type: php levelup.php (6.7 KB, 2 views)
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trade System Kyttias Questions and Supports 4 05-29-2016 12:29 AM
Making v.1.3.3 Stat Mod Compatible with V.1.3.4 Hwona Questions and Supports 0 07-08-2014 01:37 PM
Stat Inheritance Mod * thanks to Wallie! * Missy Master Mys v1.3.x Mods 0 06-30-2014 02:23 PM
Anyone Want to Have a Stat System Hwona Feedback and Suggestions 12 06-30-2014 09:30 AM
Basic Stat System Hedgen Questions and Supports 3 03-10-2013 02:47 PM


All times are GMT -5. The time now is 03:23 PM.

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