Просмотр файла count.php

Размер файла: 1.17Kb
  1. <?
  2. $down = 'downl'; // папка с загрузом
  3. include BASEDIR.$down.'/inc/conf.inc';
  4.  
  5. global $new_f;
  6. global $cash;
  7. $tota = '';
  8. $tots = '';
  9. $tot_new = '';
  10. $ttime = time();
  11. $filtime = filemtime(BASEDIR.$down.'/files/count.dir');
  12. $filtime = $filtime + (3600 * $cash);
  13. $tot_new = 0;
  14. $totas = 0;
  15. if($ttime >= $filtime || !is_file(BASEDIR.$down.'/files/count.dir')){
  16. $new_v = (3600 * 24 * $new_f);
  17. $odir = opendir(BASEDIR.$down."/baze");
  18. while ($file = readdir($odir)){
  19. if ((($file!==".")&&($file!=="..")&&($file!==".htaccess")) and is_file(BASEDIR.$down."/baze/$file")){
  20. $ft = @file(BASEDIR.$down."/baze/$file");
  21. $totas = count($ft);
  22. foreach($ft as $i){
  23. $data = explode("|",$i);
  24. $ftime = $data[6] + $new_v;
  25. if($ftime >= $ttime){$tot_new ++;}
  26. }
  27. $tots += $totas;
  28. }
  29. }
  30. closedir($odir);
  31. $tota = $tots.'|'.$tot_new;
  32. $fp = fopen(BASEDIR.$down.'/files/count.dir','w');
  33. fputs($fp,$tota);
  34. fclose($fp);
  35. @chmod(BASEDIR.$down.'/files/count.dir',0666);
  36. echo ' ['.$tots.'/ <font color="red">+'.$tot_new.'</font>]<br/>';}
  37. else{$tota = file_get_contents(BASEDIR.$down.'/files/count.dir');
  38. $str = explode("|", $tota);
  39. echo ' ['.$str[0].'/ <font color="red">+'.$str[1].'</font>]<br/>';}
  40. ?>