Add Favorite Adopt to sidebar?

Forum
Last Post
Threads / Messages
Final version of the module. As per aquapyrofan's suggestion, moved the OwnedAdoptable line below the else statement, and I have verified that it works.

PHP:
$profile = $mysidia->user->getprofile();


if($profile->getFavpetID() == 0){
$texta = new Paragraph;
$texta->add(new Comment(" 
<br>
Unfortunately, you don't seem to have a favourite pet set.
<br>
Would you like to <a href='{$mysidia->path->getAbsolute()}account/profile'> set one</a>? 
"));
}
else {
$owned = new OwnedAdoptable($profile->getFavpetID());
$Name = $owned->getName();
$Type = $owned->getType();
$texta = new Paragraph;
$texta->add(new Comment(" 

<br> 
<img src='{$owned->getImage()}'> 
<br> 
{$Name} the {$Type} 
<br> 
<a href='{$mysidia->path->getAbsolute()}myadopts/manage/{$owned->getAdoptID()}'>View</a> | <a href='{$mysidia->path->getAbsolute()}account/profile'>Change</a> 
")); 
}
$moduleContainer->add($texta);
 
This works wonderfully for me, but im just wondering if there is a way to resize the favpet image in the sidebar?
 
This works wonderfully for me, but im just wondering if there is a way to resize the favpet image in the sidebar?
You could adjust the following line from
HTML:
<img src='{$owned->getImage()}'>
to
HTML:
<img src='{$owned->getImage()}' width="100" height="100">
Replace the 100 with the size in pixels of image you'd like.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,267
Messages
33,049
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top