Okay. So I think I've got it. After fiddling and being impatient for a reply.
But I would like a second pair of eyes to look at my code. (Instead of adding the php in the module area, I prefer to add it to the class_sidebar.php file. It's easier for coding and checking backwards and forwards.
The main code:
Code:
protected function setFavPetSB(){
$mysidia = Registry::get("mysidia");
$userfavpet = $mysidia->db->select("users_profile", array("favpet"), "username = '{$mysidia->user->username}'")->fetchColumn();
if ($this->userfavpet == "0"){
$this->FavPetSB = new Paragraph;
$this->FavPetSB->add(new Comment("<b>No Favorite Pet Set</b>"));
}
else{
$this->FavPetSB = new Paragraph;
$this->FavPetSB->add(new Comment("<b>Favorite Pet!</b>"));
$this->FavPetSB->add(new Link("levelup/click/{$userfavpet}", new Image("levelup/siggy/{$userfavpet}"), TRUE));
}
$this->setDivision($this->FavPetSB);
}