Location: PHPKode > projects > PHPExplorer > modules/rechercher.php
<?
require_once("../include/varsfuncs.php");
if(!$find&&!$fdir){
 if(!$fdir) $fdir=$dir;
 include("$instp/skins/$sk/_pl_find/_.php");
 include("$instp/skins/$sk/_pl_find/_empty.php");
 include("$instp/skins/$sk/_pl_find/_foot.php");
}else{
 include("$instp/skins/$sk/_pl_find/_.php");
 $r=Array(); $v=Array();
 if(!@chdir($fdir)) die("<Script>alert('Le répertoire de recherche n\\'existe pas !');window.history.go(-1); </Script>");
 $find=str_replace("*","(.*)",$find);
 $nofind=str_replace("*","(.*)",$nofind);
 function find($fdir,$find,$nofind,$r,$subd){
  if(substr($fdir,-1,1)!="/") $fdir.="/";
  $z=opendir($fdir);
  while($d=strtolower(readdir($z))){
   if($d!="."&&$d!=".."){
    if(is_dir($fdir.$d)){
      if(eregi(str_replace(".",'\.',$find),$d)&&!@eregi(str_replace(".",'\.',$nofind),$d)){
       $r[]=$d."@/@".$fdir."@/@Dossier";
      }
      if($subd==1){$r=find($fdir.$d,$find,$nofind,$r,$subd);}
    }else{
      if(eregi(str_replace(".",'\.',$find),$d)&&!@eregi(str_replace('.','\.',$nofind),$d)){
       $r[]=$d."@/@".$fdir."@/@".filesize($fdir.$d);
     }
    }
   }
  }
  return $r;
 }
 set_time_limit(9999);
 $r=find($fdir,strtolower($find),@strtolower($nofind),$r,$subd);
if(count($r)>0){
 for($i=0;$r[$i];$i++){
   $k=explode("@/@",$r[$i]); $dossier=0;
   $name=$k[0]; $rmdir=$k[1]; $size=$k[2]; $unit="Oct";
  if($size=="Dossier"){ $unit="";}else{
   if($size>1000){$size=intval($size/1000); $unit="Ko";}
   if($size>1000){$size=intval($size/1000); $unit="Mo";}
   if($size>1000){$size=intval($size/1000); $unit="Go";}
  }
   include("$instp/skins/$sk/_pl_find/_list.php");
 }
}if(!count($r)){
  include("$instp/skins/$sk/_pl_find/_empty.php");  
}
 include("$instp/skins/$sk/_pl_find/_foot.php");
}
?>
Return current item: PHPExplorer