Location: PHPKode > projects > PHPExplorer > index.php
<?

require_once("include/varsfuncs.php");
require_once("$instp/include/_sort.php");

if(isset($set_ordre)){ setCookie("ordre",$set_ordre); $ordre=$set_ordre; }
if(isset($set_sens)){ setCookie("sens",$set_sens); $sens=$set_sens; }
if(isset($set_dirs)){setCookie("incdirs",$set_dirs); $incdirs=$set_dirs;}

if(!$incdirs) $incdirs=0;
if(!$sens) $sens=0;
if(!$ordre) $ordre="Nom";
if($sens===0) $nonsens=1; else $nonsens=0;

/*  Partie principale : affichage de la liste  */
require_once("$instp/skins/$sk/_m/_head.php");

$z=opendir($dir);$dirs=Array(); $files=Array();
if($z){ $nid="0";
while($d=readdir($z)){$nid++;
if(is_dir($dir.$d)==true){
if($d!="."&&$d!=".."){ $dirs[]=str_replace("\\'","'",$d);}}else{
$files[]=$d;}}
if(count($files)==0&&count($dirs)==0){
 include("$instp/skins/$sk/_m/_list_empty.php");
}
if($ordre=="Nom"||($ordre=="Taille"&&$incdirs!=1)){
 $dirs=sortbyname($dirs,$sens);
}else{
 $dirs=sortdbysize($dirs,$dir);
}
for($i=0,$d=$dirs[0];$dirs[$i];$i++,$d=$dirs[$i]){
if($ordre=="Taille"&&$incdirs==1){ $tai=$d[1]; $total=$total+$ai; $d=$d[0]; $unit="Oct";
if($tai>1000){$tai=$tai/1000;$unit="Ko";}
if($tai>1000){$tai=$tai/1000;$unit="Mo";}
if($tai>1000){$tai=$tai/1000;$unit="Go";}
$tai=round($tai,2);
}else{$unit="";$tai="";}
include("$instp/skins/$sk/_m/_list_dirs.php"); }
if($ordre=="Nom"){
 $files=sortbyname($files,$sens);
}else{
 $files=sortbysize($files,$dir);
}
for($i=0,$d=$files[0];$files[$i];$i++,$d=$files[$i]){
$fs=filesize($dir.$d); $unit="Oct"; $total=$total+$fs;
if($fs>1000){$fs=$fs/1000;$unit="Ko";}
if($fs>1000){$fs=$fs/1000;$unit="Mo";}
if($fs>1000){$fs=$fs/1000;$unit="Go";}
$fs=round($fs,2);
if(substr($d,-4)==".zip")
 include("$instp/skins/$sk/_m/_list_zip.php");
else
 include("$instp/skins/$sk/_m/_list_files.php");
}}
if($total>1000){$total=$total/1000;$unit="Ko";}
if($total>1000){$total=$total/1000;$unit="Mo";}
if($total>1000){$total=$total/1000;$unit="Go";}
$total=round($total,2);
$dtf=disk_total_space($dir); $dfs=disk_free_space($dir);
$unn=Array(0=>"Bytes",1=>"Kb",2=>"Mb",3=>"Gb");
while($dtf>=1000){$dtf=$dtf/1000;$dtfu++;} $dtfu=$unn[$dtfu];
while($dfs>=1000){$dfs=$dfs/1000;$dfsu++;} $dfsu=$unn[$dfsu];
$dtf=round($dtf,2);$dfs=round($dfs,2);
if($total>0){
include("$instp/skins/$sk/_m/_dirsize.php"); }
include("$instp/skins/$sk/_m/_footers.php");
?>
Return current item: PHPExplorer