View Single Post
  #17  
Old 04-25-2017, 08:30 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 152,462
Abronsyth is on a distinguished road
Default

I have the function in classes/class_siderbar as this;
PHP Code:
    public function getFavPetSB(){
        return 
$this->FavPetSB;
    }

    protected function 
setFavPetSB(){
        
$mysidia Registry::get("mysidia");
        
$profile $mysidia->user->getprofile();   
        
        
/* IF THE USER DOES *NOT* HAVE A FAVPET: */
        
if ($profile->getFavpetID() == "0"){
            
$this->FavPetSB = new Paragraph
            
$this->FavPetSB->add(new Comment("<a href='LINK TO CHOOSE PAGE'>Choose Companion</a>"));
        }

        
/* IF THE USER *DOES* HAVE A FAVPET: */
        
if ($profile->getFavpetID() != "0"){
            
$favpet = new OwnedAdoptable($profile->getFavpetID());
            
$this->FavPetSB = new Paragraph
            
$this->FavPetSB->add(new Comment("<center><b>Companion</b><br><a href='/myadopts/manage/{$profile->getFavpetID()}'><img src='{$favpet->getImage()}' style='max-width:80px;' rel='tooltip' title=\"{$favpet->name}\"></a><br></center>"));


        }        
        
$this->setDivision($this->FavPetSB);
    } 
That makes it so if a user doesn't have it set then they'll just get a link to set it. I don't know how much I changed it from Kyttias's version, but maybe it'll work for you?
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote