<?
include '../config.php';
include '../func.php';
head();
aut();
ban();
if($error){ echo $error;
}else{
/////////////////////////////
mysql_query("UPDATE `profile` SET `online` = 'photo' WHERE `id` = '".$id_session."'");
echo "<div class=\"head\"><b>Фотоальбомы</b></div><div class=\"main\">"; 

$id = num($_GET['user']);
$all = mysql_result(mysql_query("SELECT count(*) FROM `photo_album` WHERE `user` = '".$id."'"), 0);
if($all==0)
echo 'У пользователя еще нет альбомов.';
else
$query = @mysql_query("SELECT * FROM `photo_album` WHERE `user` = '".$id."'");
while($result = @mysql_fetch_array($query))
{
    $all_photos = mysql_result(mysql_query("SELECT count(*) FROM `photo_photos` WHERE `album` = '".$result['id']."'"), 0);
echo "<div class=\"main\"><a href=\"photos.php?id=".$result['id']."\">".$result['name']."</a> [".$all_photos."] <br/>";

if($result['date'])
echo "<small>".strftime("Создан %d.%m.%y",$result['date'])."</small><br/>";
if($result['obnov'])
echo "<small>".strftime("Изменен %d.%m.%y",$result['obnov'])."</small><br/>";

if($result['prosm'])
echo "<small>Просмотров: ".$result['prosm']."</small><br/>";
echo '</div>';
}

}
pod_navig();
foot();
?>
