0.9*$imgl[1]||$y>0.9*$imgl[2]){$img=$imgl;$imgl= wp_get_attachment_image_src( $img_id,'large' );}
if ($x>0.9*$imgl[1]||$y>0.9*$imgl[2]){$img=$imgl;$imgl= wp_get_attachment_image_src( $img_id,'full' );}
if ($x>0.9*$imgl[1]||$y>0.9*$imgl[2]){$img=$imgl;}
}
}
if ($img){
$src=$img[0];
$width=$img[1];
$height=$img[2];
$yy=@($x*$height/$width);
$xx=@($y*$width/$height);
$ml=$mt='';
if ($x<$xx){$ml='margin-left: -'.(($xx-$x)/2).'px';}
elseif ($y<$yy){$mt='margin-top: -'.(($yy-$y)/2).'px';}
$style=($ml||$mt)?"style='$mt$ml'":'';
}
}elseif (!empty($imgurl)){
$image=@getimagesize($imgurl);
if ($image){
$xx=$image[1]*$x/$y;
$yy=$image[0]*$y/$x;
if ($x/$y>$image[0]/$image[1]){$height=$yy;$width=$image[0];}
else {$width=$xx;$height=$image[1];}
} else {$width=$x;$height=$y;}
$src=get_bloginfo('template_directory').'/includes/timthumb.php?src='.$imgurl.'&w='.floor($width).'&h='.floor($height).'&zc=1';
}
if (!empty($src)){
$size=($x/$y < @($width/$height))?"height='$y'":"width='$x'";
$src= "";
//set image replacement
} elseif($not==2){
if ($featured&&$fnotimg) $src= "
";
elseif(!$featured&&$notimg) $src= "
";
} elseif($not==1){
$src= '
';
} else {return;}
return '