I have this code to display users avatars..
<?php
include("../core/config.php");
if(isset($_GET['uid'])){
if(is_numeric($_GET['uid'])){
$uid = $_GET['uid'];
}
else{
exit();
}
$sql="SELECT avatar FROM users_avatar WHERE user_id = '$uid'";
$row= getRow($sql);
if(!$row){
$url = "../usravatars/_default/usravatar_default_m.png";
}
else{
$avatar = $row['avatar'];
$url = "../usravatars/$uid/$avatar";
}
header("Content-Type: image/jpg");
readfile($url);
}
?>
Is possible to set a custom size for the image being displayed?
Following is a sample function to resize the image on the fly. You can use your own specific width/height or fetch from the get variables.