Размер файла: 1.17Kb
- <?
- $down = 'downl'; // папка с загрузом
- include BASEDIR.$down.'/inc/conf.inc';
-
- global $new_f;
- global $cash;
- $tota = '';
- $tots = '';
- $tot_new = '';
- $ttime = time();
- $filtime = filemtime(BASEDIR.$down.'/files/count.dir');
- $filtime = $filtime + (3600 * $cash);
- $tot_new = 0;
- $totas = 0;
- if($ttime >= $filtime || !is_file(BASEDIR.$down.'/files/count.dir')){
- $new_v = (3600 * 24 * $new_f);
- $odir = opendir(BASEDIR.$down."/baze");
- while ($file = readdir($odir)){
- if ((($file!==".")&&($file!=="..")&&($file!==".htaccess")) and is_file(BASEDIR.$down."/baze/$file")){
- $ft = @file(BASEDIR.$down."/baze/$file");
- $totas = count($ft);
- foreach($ft as $i){
- $data = explode("|",$i);
- $ftime = $data[6] + $new_v;
- if($ftime >= $ttime){$tot_new ++;}
- }
- $tots += $totas;
- }
- }
- closedir($odir);
- $tota = $tots.'|'.$tot_new;
- $fp = fopen(BASEDIR.$down.'/files/count.dir','w');
- fputs($fp,$tota);
- fclose($fp);
- @chmod(BASEDIR.$down.'/files/count.dir',0666);
- echo ' ['.$tots.'/ <font color="red">+'.$tot_new.'</font>]<br/>';}
- else{$tota = file_get_contents(BASEDIR.$down.'/files/count.dir');
- $str = explode("|", $tota);
- echo ' ['.$str[0].'/ <font color="red">+'.$str[1].'</font>]<br/>';}
- ?>