View file servis/index.php

File size: 2.46Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting(waring & error);
include $DOCUMENT_ROOT."/config.php";

echo"<html><head><title>$title</title><LINK REL=STYLESHEET TYPE=text/css HREF=../skin/$wthemes></head><body>";
echo"<div class=a>загрузки для вшего мобильника</div>";


@$folder=$_GET['dir'];
@$n=$_GET['n'];
if($n=='') $n=0;

if($folder) $zag=strtr($folder,'_',' ');
else
 $zag='Загрузки!';


$tsize=0;
$cnt=0;
$ns=0;
if($folder)
{
if(strstr($folder,'..')) die('Доступ запрещён!');
$dir=opendir($folder);
}
else
$dir=opendir('.');
while($file=readdir($dir))
{
if($file!='.' and $file!='..' and $file!='.htaccess' and $file!='index.php' and $file!='img' and $file!='00' and $file!='img.php')
{
if($cnt<$n)
{
$cnt++; continue;
}
if($ns<10)
{
if($folder and strpos($file,'-')) $fname=strstr($file,'-');
else

 $fname=$file;
$fname=strtr($fname,array('_'=>' ','-'=>' '));
if($folder)
{
$str=filesize($folder.'/'.$file);
$file=$folder.'/'.$file;
}
else
$str=filesize($file);
$size=round($str/1024,1);
if(strpos($file,'.'))
{
$tt=stristr($fname,'.');


$fname=strtok($fname,'.');
print '       <div class=a> 
              <img src="../img/download.gif" alt=""/>
              <a href="'.$file.'">'.$fname.'</a>('.$size.'kB)<br>';
                           readfile("00/".$file.".txt");
if ($tt == ".jpg")
{
     echo"<img src=img.php?img=$file>";
}
if ($tt == ".gif")
{
     echo"<img src=img.php?img=$file>";
}
echo '<br>скачай F-Getom <br><input type=text value=http://'.$url.'/zc/'.$file.'> </div>';

$ns++;
$tsize=$tsize+$str;
}
else
{

echo '
            <div class=b> 
            <img src="../img/opendir.gif" alt=""/>
            <a href="?dir='.$file.'">'.$fname.'</a><br>';
readfile("00/".$file.".txt");
echo '</div>';

$ns++;
}
}
$cnt++;
}
}
closedir($dir);
if(!$ns<10 and $ns+$n!=$cnt) 
print '

           &nbsp;<a href="index.php?dir='.$folder.'&amp;n='.($ns+$n).'">След.&#187;</a><br />';

if($n!=0) 

print '

          &nbsp;<a href="index.php?dir='.$folder.'&amp;n='.($n-10).'">&#171;Пред.</a>';

$tsize=round($tsize/1024,1);
$stran=round($cnt/10);
if(($cnt-$stran*10)>0) $stran++;

echo '

                      <hr /><font color="#7D0000">Cтpaницa '.(($n+10)/10).' из '.$stran.'<br/></font><hr/>';


if($folder) 
print '<a href="index.php">Начало</a>'; else print '<a href="index.php">Начало</a>';

?>