Guest User

Untitled

a guest
Jan 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.23 KB | None | 0 0
  1. $thumbWidth = 100 .'px'; $thumbHeight = 100 .'px';
  2. $foto = mfa("select status, id, principale from gs9.profilo_foto where status < '4' and nickname = '".$user['nickname']."' order by principale desc, id desc limit 1");
  3. switch($foto['status']){case "": $img_th = 'immagini/thumb/no_foto_100.png'; break;
  4. case "0":if ($foto['principale'] == '0') {$img_th = 'immagini/thumb/no_princ_100.png';}
  5. elseif ($foto['principale'] == 1) {
  6. $img_th = "../../foto_profilo/".ucf($user['nickname'][0])."/".str_replace(' ','',stl($user['nickname']))."/principale.png";
  7. $dimensioni = getimagesize($img_th);
  8. $pre_thumbWidth = $dimensioni[0]; $pre_thumbHeight = $dimensioni[1];
  9. if ($pre_thumbWidth > $pre_thumbHeight)  {$thumbHeight = 100 .'px'; $thumbWidth = 'auto';}
  10. elseif ($pre_thumbWidth < $pre_thumbHeight)  {$thumbWidth = 100 .'px'; $thumbHeight = 'auto';}
  11. elseif ($pre_thumbWidth == $pre_thumbHeight) {$thumbWidth = 100 .'px'; $thumbHeight = 100 .'px';}
  12. }
  13. break;
  14. case "1": $img_th = 'immagini/thumb/hot_100.png'; break;
  15. case "2": $img_th = 'immagini/thumb/pvt_100.png'; break;
  16. case "3": $img_th = 'immagini/thumb/hot_100.png'; break;
  17. case "4": $img_th = '<immagini/thumb/conv_100.png'; break;
  18. case "5": $img_th = 'immagini/thumb/conv_100.png"'; break;
  19. }
Add Comment
Please, Sign In to add comment