<?php $accept = getenv ('HTTP_ACCEPT'); if (strpos($accept, "text/html") !== false or $accept == '*/*') {include ("xml.php"); } else {include ("wml.php");}
$d=str_replace("..","",$d); if($d=="")$d=".";
function allfiles($path){
return count(glob($path."/*")); }
function trans($t){
$a=array("Zh","zh","Ch","ch","Ye","ye","Yu","yu","Ya","ya","A","a","B","b","V","v","G","g","D","d","E","e","Z","z","I","i","J","j","K","k","L","l","M","m","N","n","O","o","P","p","R","r","S","s","T","t","U","u","F","f","H","h","C","c","W","w","Y","y","_");
$b=array("Ж","ж","Ч","ч","Э","э","Ю","ю","Я","я","А","а","Б","б","В","в","Г","г","Д","д","Е","е","З","з","И","и","Й","й","К","к","Л","л","М","м","Н","н","О","о","П","п","Р","р","С","с","Т","т","У","у","Ф","ф","Х","х","Ц","ц","Ш","ш","Ы","ы"," "); return str_replace($a,$b,$t);}
$ex=explode("/",$d);
$ph.=".";foreach($ex as $v){ if($v!="" and $v!="."){$ph.="/$v"; $put.="<a href='index.php?d=$ph'>".trans($v)."</a>>";}}
$path="files/";
$o=opendir($path."".$d) or die("Запрещено! ".$path.$d.$px);
while($f=readdir($o)){
if($f!="." and $f!=".."){
if(is_dir($path.$d."/".$f))$link[]=$folder."<a href='index.php?d=$d/$f'>".trans($f)."</a>(".allfiles($path.$d."/".$f).")<br/>";
else {if(strpos($f,"jpg") or strpos($f,"gif"))$sk="<img src='im.php?pic=".$path."".$d."/".$f."' alt='..'/>";$link[]=$sk."<a href='f.php?f=$d/$f'>".trans(substr($f,0,-4))."</a>[".round(filesize($path.$d."/".$f)/1024)."kb]<br/>";$sk="";}}}
echo $put."<br/>::::::<br/>Обьектов: ".count($link)."<br/>:::::::<br/>";if($n=="")$n=0;
for($i=1; $i<=10; $i++){
if(isset($link[$n]))echo $link[$n]; $n++;}$off=$n-20; echo"[<a href='index.php?d=$d&n=$off'>Назад</a>][<a href='index.php?d=$d&n=$n'>Далее</a>]<br/>"; include("online.php"); echo $px; ?>