<?

header("Cache-Control: no-cache");
if ($ver=="wml")header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");

require("inc.php");
$link = connect_db();
list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require("version.php");

settype($usid, 'integer');
$select = @mysql_query ("Select img,user from users where id='".$usid."'"); 
$inf = mysql_fetch_array ($select);
$img = $inf["img"];
$user = $inf["user"];
$ras=explode(".", $img);
$type=$ras[1];

if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>\n";
echo "<card id=\"cabinet\" title=\"Фото ".$user."\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css.css\"/>";
echo "<title>Фото ".$user."</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
if(@$inf["img"]!=""){
$inf["img"] = UrlEncode($inf["img"]);
echo "<img align=\"center\" src=\"fr.php?usid=$usid\" alt=\"".$user."\"/><br/>\n";
}
if ($id!=$usid){
print $fsize1;
if (isset ($rm))echo "<a href=\"galery.php?mod=votes&amp;$ses&amp;nk=$usid&amp;rm=$rm&amp;ref=$ref\">Голосовать за фото</a><br/>";
else echo "<a href=\"galery.php?mod=votes&amp;$ses&amp;nk=$usid&amp;ref=$ref\">Голосовать за фото</a><br/>";
print $fsize2; 
print "<br/>"; 
}
echo $fsize1;
echo "<a href=\"photos/".$usid.".".$type."\">Скачать фото</a><br/>\n"; 
echo $divide;
if (isset ($rm)){
echo "<a href=\"chat.php?$ses&amp;rm=$rm&amp;ref=$ref\">&#8592; В чат</a><br/>\n";
echo $divide;
}
echo "<a href=\"enter.php?$ses&amp;ref=$ref\">&#8592; Прихожая</a><br/>\n"; 
echo $fsize2; 
if ($ver=="wml")echo "</p></card></wml>";
else echo "</div></body></html>";
mysql_close($link); 
?>