Просмотр файла wps_1.0/zagruzka/kol.php

Размер файла: 1.87Kb
<?php

function dir_kol($kat_kol)
 {  
  $dir_kol = opendir("$kat_kol"); 
 
  while($files_kol = readdir($dir_kol))
   { 
    if(is_file($kat_kol."/".$files_kol) && $files_kol != "Thumbs.db" && $files_kol != "index.php" && $files_kol != "img.php" && $files_kol != "kol.php" && $files_kol != "kom.php" && $files_kol != "adminkom.php")
     { 
      $kol++;
     }
      elseif(is_dir($kat_kol."/".$files_kol) && $files_kol != "." && $files_kol != ".." && $files_kol != "op")
     {
      $es = dir_kol($kat_kol."/".$files_kol);
      $kol = $kol + $es;
     }
   } 
  closedir($dir_kol);
  
  if(empty($kol))
   {
    $kol = 0;
   }
    else
   {
    $kol = $kol;
   }

  return"$kol";
 }

function dir_kol_new($kat_kol_new)
 {  
  $dir_kol_new = opendir("$kat_kol_new"); 
 
  while($files_kol_new = readdir($dir_kol_new))
   { 
    if(is_file($kat_kol_new."/".$files_kol_new) && $files_kol_new != "Thumbs.db" && $files_kol_new != "index.php" && $files_kol_new != "img.php" && $files_kol_new != "kol.php" && $files_kol_new != "kom.php" && $files_kol_new != "adminkom.php")
     { 
      $datanew = date ("YmdHis", filemtime("$kat_kol_new/$files_kol_new")) + 5000000;
      $datenow = date ("YmdHis");
      if($datanew > $datenow)
       {
        $kol_new++;
       } 
     }
      elseif(is_dir($kat_kol_new."/".$files_kol_new) && $files_kol_new != "." && $files_kol_new != ".."  && $files_kol_new != "op")
     {
      $es_new = dir_kol_new($kat_kol_new."/".$files_kol_new);
      $kol_new = $kol_new + $es_new;
     }
   } 
  closedir($dir_kol_new);
  
  if(empty($kol_new))
   {
    $kol_new = 0;
   }
    else
   {
    $kol_new = $kol_new;
   }
  return"$kol_new";
 }
    
echo "[";  
echo dir_kol("modules/zagruz/");
if(($kolvo = dir_kol_new("modules/zagruz/")) > 0)
 {
  echo "/<font color=\"red\">$kolvo</font>";
 }
echo "]";
?>