View Single Post
  #18  
Old 03-20-2016, 02:03 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 126,994
Kyttias is on a distinguished road
Default

Actually the above won't work because if the user doesn't own pet 30 it might cause errors.

Send me the code we put in classes/class_sidebar.php - I'd like to make some changes to it.

PHP Code:
protected function setFavPetSB(){
    
$mysidia Registry::get("mysidia");
    
$profile $mysidia->user->getprofile();
    
    if (
$this->userfavpet == "0"){
        
$this->FavPetSB = new Paragraph
        
$this->FavPetSB->add(new Comment("<b>No Favorite Pet Set</b>"));
    }

    if (
$profile->getFavpetID() != "0"){
        
$favpet = new OwnedAdoptable($profile->getFavpetID());
        
$this->FavPetSB = new Paragraph
        
$this->FavPetSB->add(new Comment("<b>Favorite Pet!</b> <br/>
            <a href='/myadopts/manage/
{$favpet}'><img src='{$favpet->getImage()}'></a>
            "
));
    }

    
$this->setDivision($this->FavPetSB);

I'm changing where we get information from, basically. And then we're more closely checking only if its zero or not zero. If it's empty, at least it won't error.

If you're afraid of editting the code, I can do it.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote