<?

function avatar($ID, $link = false){
$avatar = mysql_fetch_array(mysql_query("SELECT id,id_gallery,ras FROM `gallery_foto` WHERE `id_user` = '$ID' AND `avatar` = '1' LIMIT 1"));
if (is_file(H."/files/gallery/foto/$avatar[id].$avatar[ras]")){
return ($link == true ? '<a href="/modules/photo/' . $ID . '/' . $avatar['id_gallery'] . '/' . $avatar['id'] . '/">' : false) . '
<img class="avatar" src="/modules/photo/foto/' . $avatar['id'] . '.' . $avatar['ras'] . '">' . ($link == true ? '</a>' : false);
}else{
return '<img class="avatar" src="/img/no_avatar.png">';
}
}

function avatar_profil($ID, $link = false){
$avatar = mysql_fetch_array(mysql_query("SELECT id,id_gallery,ras FROM `gallery_foto` WHERE `id_user` = '$ID' AND `avatar` = '1' LIMIT 1"));
if (is_file(H."/files/gallery/foto/$avatar[id].$avatar[ras]")){
return ($link == true ? '<a href="/modules/photo/' . $ID . '/' . $avatar['id_gallery'] . '/' . $avatar['id'] . '/">' : false) . '
<img class="profil_avatar" src="/modules/photo/foto/' . $avatar['id'] . '.' . $avatar['ras'] . '">' . ($link == true ? '</a>' : false);
}else{
return '<img class="profil_avatar" src="/img/no_avatar.png">';
}
}

?>