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?