<?

//Обложка профиля
function cover($id){
global $set, $user;

$p = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='$id'  LIMIT 1"));
$a = mysql_fetch_array(mysql_query("SELECT * FROM `gallery_foto` WHERE `id_user`='$id' AND `cover`='1' LIMIT 1"));
if (is_file(H."/files/gallery/foto/$a[id].$a[ras]"))	{
echo "<img src='/modules/photo/foto/$a[id].$a[ras]'></a>";
}
elseif (isset($user) && $user['id'] == $p['id'])	{
echo '<img src="/img/no_cover.png">';
}else{
echo '<img src="/img/no_cover.png">';	}
}

?>