View file index.php

File size: 3.63Kb
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Content-Type" CONTENT="text/html; charset=UTF-8">
<title>Загрузи мобилу</title>
<link rel="stylesheet" type="text/css" href="/style/style.css">
</head>
<body>
<?
include 'style/menu.php';
echo '<div class="verh">';
print $rekl_v;
echo '</div>';
@$folder=$_GET['dir'];
@$n=$_GET['n'];
if($n=='') $n=0;
$tsize=0;
$cnt=0;
$ns=0;
if($folder){$k='5';}else{$k='50';} // Количество файлов
if($folder)
  {
if(strstr($folder,'..'))
die('No dir');
$dir=opendir($folder);
}
else
$dir=opendir('.');
while($file=readdir($dir))
{
if($file!='.' and $file!='..' and $file!='index.php' and $file!='style' and $file!='img.php' and $file!='vid.php' and $file!='down.php' and $file!='160.php' and $file!='220.php' and $file!='320.php' and $file!='.htaccess' and $file!='kol.php' and $file!='jar.php' and $file!='readme.txt')
{
if($cnt<$n)
{
$cnt++;
continue;
}
if($ns<$k)
{
if($folder and strpos($file,'-'))
$fname=strstr($file,'-');
else
$fname=$file;
$fname=strtr($fname,array('_'=>' ','A'=>'А','B'=>'Б','C'=>'Ц','D'=>'Д','E'=>'Е','F'=>'Ф','G'=>'Г','H'=>'Х','I'=>'И','J'=>'Ж','K'=>'К','L'=>'Л','M'=>'М','N'=>'Н','O'=>'О','P'=>'П','Q'=>'КЮ','R'=>'Р','S'=>'С','T'=>'Т','U'=>'У','V'=>'В','W'=>'В','X'=>'КС','Y'=>'Й','Z'=>'З','a'=>'а','b'=>'б','c'=>'ц','d'=>'д','e'=>'е','f'=>'ф','g'=>'г','h'=>'х','i'=>'и','j'=>'ж','k'=>'к','l'=>'л','m'=>'м','n'=>'н','o'=>'о','p'=>'п','q'=>'кю','r'=>'р','s'=>'с','t'=>'т','u'=>'у','v'=>'в','w'=>'в','x'=>'кс','y'=>'й','z'=>'з'));
if($folder)
{
$str=filesize($folder.'/'.$file);
$file=$folder.'/'.$file;
}
else
$str=filesize($file);
$size=round($str/1024,1);
if(strpos($file,'.'))
{
$fname=strtok($fname,'.');
echo '<div class="content">';
if(strpos($file,'.jpg')){print '<img src="img.php?f='.$file.'"><a href="down.php?f='.$file.'">Размер</a>';}
if(strpos($file,'.gif')){print '<img src="img.php?f='.$file.'">';}
if(strpos($file,'.png')){print '<img src="img.php?f='.$file.'">';}
if(strpos($file,'.3gp')){print '<img src="vid.php?f='.$file.'">';}
if(strpos($file,'.mp4')){print '<img src="vid.php?f='.$file.'">';}
if(strpos($file,'.avi')){print '<img src="vid.php?f='.$file.'">';}
if(strpos($file,'.jar')){print '<img src="jar.php?f='.$file.'">';}
print '<img src="style/file.png" alt=""><a href="'.$file.'">'.$fname.'['.$size.'кб]</a><br>';
echo '</div>';
$ns++;
$tsize=$tsize+$str;
}
else
{
echo '<div class="content">';
print '<img src="style/dir.png" alt=""><a href="?dir='.$file.'">'.$fname.'</a> ';
include 'kol.php';
echo '<br></div>';
$ns++;
}
}
$cnt++;
}
}
closedir($dir);
if(!$ns<$k and $ns+$n!=$cnt){
echo '<div class="menu">';
print '<a href="index.php?dir='.$folder.'&amp;n='.($ns+$n).'">Дальше</a><br>';
echo '</div>'; }
if($n!=0){
echo '<div class="menu">';
print '<a href="index.php?dir='.$folder.'&amp;n='.($n-$k).'">Назад</a><br>';
echo '</div>'; }
$tsize=round($tsize/1024,1);
$stran=round($cnt/$k);
if(($cnt-$stran*$k)>0) $stran++;
if($stran==0) die('Папка пуста');
if($folder){
/*echo '<form><input name="to" type="hidden" value="index.php?dir='.$folder.'&amp;n="/>Введи номер файла:<input name="go" type="text"/><input type="button" value="Вперёд" onClick="window.location=to.value+go.value"></form>';*/
echo '<div class="menu">';
print 'Cтp. '.(($n+$k)/$k).' из '.$stran.'<br/>';
echo '</div>';
echo '<div class="niz">';
echo '<a href="index.php">На главную</a><br>';
print $top_dr;
echo '</div>';
}else{
echo '<div class="niz">';
print $top_gl;
echo '</div>';
}
?>
</body>
</html>