View Single Post
  #6  
Old 12-20-2014, 11:25 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 127,252
Kyttias is on a distinguished road
Default

My site's similar -- and basically? I take the largest image and save everything it's size with a lot of extra space around it. That's my easiest solution, though it requires resaving everything. I planned ahead in this.

However, theoretically it should be possible to get the adoptable's level and resize accordingly:
PHP Code:
 $lvl $adopt->getCurrentLevel();
 
# if level 0 (egg) resize to 50px
 
if ($lvl == 0) { $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '50px'></a>")); }
 
# if level 1 (baby) resize to 100px
 
if ($lvl == 1) { $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '100px'></a>")); }
 
# if level is 2 or greater (adult) resize to 200px
 
if ($lvl >= 2) { $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '200px'></a>")); } 
Although if the egg images do not need resizing, just remove the width attribute from theirs entirely. ovo

(I think most browsers only take issue if you resize with percents, rather than exact pixel widths? There's also "sort of" a difference between style="width: 200px", width="200", and width="200px" but mostly just not.)
__________________
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.

Last edited by Kyttias; 12-20-2014 at 11:36 PM.
Reply With Quote