View file public_html/template/down.php

File size: 2.03Kb
<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  VANTUZ                     #
#               E-mail  :  [email protected]         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#
$filtime=filemtime(BASEDIR."local/datatmp/down.dat");
$down_count=file_get_contents(BASEDIR."local/datatmp/down.dat");
$down_count=strtok($down_count,'/');

$filtime=$filtime+(3600*$config_downloadcache);

if($sitetime>$filtime || $down_count<50){
	
$dir = opendir (BASEDIR."download"); 
while ($file = readdir ($dir)) {
if (is_dir(BASEDIR."download/$file")) {
if($file=="."||$file=="..") continue;
$downdir_array[]=$file;
}}  
closedir ($dir);  

$totaldir = count($downdir_array); 
$downtime_array=array();

for ($i = 0; $i < $totaldir; $i++){ 
$dir = opendir (BASEDIR."download/$downdir_array[$i]"); 
while ($file = readdir ($dir)) {
if (( $file != ".")&&($file != "..")&&($file != ".htaccess")&&($file != "index.php")&&($file != "name.dat")&& !ereg (".txt$", "$file")&& !ereg (".JPG$", "$file")&& !ereg (".GIF$", "$file")) {
	
$downfile_array[]=$file;

$filetime=filemtime(BASEDIR."download/$downdir_array[$i]/$file")+(3600*24*5);
if($filetime>$sitetime){	
$downtime_array[]=$file;

}}} 
closedir ($dir);
}


$totalfile = count($downfile_array); 
$totalnewfile = count($downtime_array); 

if($totalnewfile>0){	
$dtext=(int)$totalfile.'/+'.(int)$totalnewfile; 
}else{
$dtext =(int)$totalfile;
}


$fp = fopen(BASEDIR."local/datatmp/down.dat","a+");
flock ($fp,LOCK_EX);
ftruncate($fp,0);
fputs($fp,$dtext);
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);
@chmod ($fp, 0777); 
@chmod (BASEDIR."local/datatmp/down.dat", 0777); 

}


$dinput = file_get_contents(BASEDIR."local/datatmp/down.dat"); 
echo ' ('.$dinput.')<br>';

?>