View file foto.php

File size: 1.07Kb
<?

include $_SERVER['DOCUMENT_ROOT']."/template/head.php";


if (!empty($id))
{

	if($_GET['id']!="")
	{$ank=$_GET['id'];}
	else
	{$ank=$id;}
	if($user = mysql_fetch_array(mysql_query("select * from `prof` where `id`='$ank'")))
	{

	$d = opendir("data/photo/".$user[id]);
	while($f = readdir($d))
	{
		if(($f !=".") && ($f !=".."))
		{$smil[]=$f;}
	}
	closedir($d);

	$tf=count($smil);
	$ts=$tf/9;
	$tb=ceil($ts);
	$tc=floor($ts);
				
	echo'<center>';		
	for($i=0; $i<$tc; $i++)
	{
		for($ii=$i*9; $ii<$i*9+9; $ii++)
		{
			echo'<a href="data/photo/'.$user[id].'/'.$smil[$ii].'"><img src="data/photo/'.$user[id].'/'.$smil[$ii].'" alt="" width="100"></a> ';
		}
		echo'<p>';
	}

	$tvc=($tc*9);
	for($iii=$tvc; $iii<$tf; $iii++)
	{
		echo'<a href="data/photo/'.$user[id].'/'.$smil[$iii].'"><img src="data/photo/'.$user[id].'/'.$smil[$iii].'" alt="" width="100"></a> ';
	}
	echo'<p></center>';
	
	}
	else
	{echo'<h2><b><center>Такой страницы нет!</center></b></h2>';}
}	
include $_SERVER['DOCUMENT_ROOT']."/template/foot.php";
?>