Просмотр файла demon_load/downloads/files.php

Размер файла: 1.62Kb
<?
if (isset($_GET['page'])){$page=$_GET['page'];}
else{$page="1";}
if (isset($_GET['jpg'])){$jp=$_GET['jpg'];





$dir = opendir ("downloads/jpg/$jpg[$jp]/");
$k=0;
$num=0;
while ($file = readdir ($dir)) 
{
$files["$k"]=$file;
$k=$k+1;
}
closedir ($dir);

for ($k=2;$k<sizeof($files);$k++)
{
if ($files[$k]=="index.php"||
$files[$k]=="tmp"||
$files[$k]=="128128"||
$files[$k]=="128160"||
$files[$k]=="132176"){}
else {
if ($files[$k]=="index.gif"){}
else {
$num=$num+1;
$size = filesize ("downloads/jpg/$jpg[$jp]/$files[$k]");
$form="b";
If ($size>1024)
{
If ($size>1024*1024)
{
$form="MB";
$size =(($size/1024/1024*10)%100)/10 ;
}
else 
{
$form="KB";
$size = $size/102.4%10000/10;

}
}
if ($num>$page*$fnp-$fnp&&$num<$page*$fnp+1){
include "prew.php";
}
}
}
}
if ($num=="0"){echo "$not_files";}







}
else {
$dir = opendir ("downloads/$folder[$f]/");
$k=0;
$num=0;
while ($file = readdir ($dir)) 
{
$files["$k"]=$file;
$k=$k+1;
}
closedir ($dir);

for ($k=2;$k<sizeof($files);$k++)
{
if ($files[$k]=="index.php"){}
else {
if ($files[$k]=="index.gif"){}
else {
$num=$num+1;
$size = filesize ("downloads/$folder[$f]/$files[$k]");
$form="b";
If ($size>1024)
{
If ($size>1024*1024)
{
$form="MB";
$size =(($size/1024/1024*10)%100)/10 ;
}
else 
{
$form="KB";
$size = $size/102.4%10000/10;

}
}
if ($num>$page*$fnp-$fnp&&$num<$page*$fnp+1){
echo "<img src=\"downloads/img/download.gif\" height=\"16\" width=\"16\">
      <a href=\"downloads/$folder[$f]/$files[$k]\">$files[$k] ($size $form)</a><br>";
      }
}
}
}
if ($num=="0"){echo "$not_files";}
}

?>