File size: 2.55Kb
<?
include "../ini.php";
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>'.$title.'</title>
<link href="../css.css" rel="stylesheet" type="text/css">
</head>
<body><div class="ablockin"><div class="bblockin">'.$kat.'</div>';
$conf["items_per_page"] = 5;
if (!isset($page)) {$page = 0;}
$total = 0;
if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array();
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php" and $file != "down.php" and $file != "add.php" and $file != "say.php" and $file != "komm.php" and $file != "data" and $file != "down2.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];
while (list($fileIndexValue, $file_name) = each ($file_array))
{
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
echo "<a href=\"down.php?file=$file_name&papka=$papka&kat=$kat\">$file_name</a> (". round(filesize($file_name)/1024,1) . "kb)<br/>
Скачиваний: ";include "data/$file_name.dat";
print '<br/>';
$f=file("data/$file_name.komm");
$c=count($f);
print '<a href="komm.php?papka='.$papka.'&kat='.$kat.'&file2='.$file_name.'">Коментарии ('.$c.')</a><br/>';
$total = $total + filesize($file_name);
}
}
if (($file_count > 0) AND ($page != 0))
{
// previous button
$prev_page = $page -1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page&papka=$papka&kat=$kat\">Назад</a><br/>";
}
if (($file_count > 0) AND ($last_record < $file_count))
{
// next button
$next_page = $page + 1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page&papka=$papka&kat=$kat\">Вперед</a><br/>";
}
echo "<hr/>
Файлов: $file_count<br/>";
echo "Общий вес: " . round($total/1024,1) . "kb<br/>";
}
if($file_count < 1)
{
print 'Файлов в этой папке, пока что нету!<br/>';}
print '<a href="../index.php">К категориям</a><br/>
<div class="bblock"><div class="bblockin">
<a href="http://'.$sait.'/?random='.$rand.'">На главную</a><br/>
© '.$sait.'<br/>
</div></div></body>
</html>';
closedir($dp);
?>