Page Title


inode == $b->inode ) return 0; switch( $sort ) { case "size": return ($a->size > $b->size) ? -1 : 1; case "type": return strcmp($a->type, $b->type); case "view": return strcmp($a->view, $b->view); case "atime": return ($a->atime > $b->atime) ? -1 : 1; case "ctime": return ($a->ctime > $b->ctime) ? -1 : 1; case "mtime": return ($a->mtime > $b->mtime) ? -1 : 1; case "group": return strcmp($a->group, $b->group); case "inode": return ($a->inode > $b->inode) ? -1 : 1; case "owner": return strcmp($a->owner, $b->owner); case "perms": return ($a->perms > $b->perms) ? -1 : 1; case "ext": return strcmp($a->ext, $b->ext); case "name": default: return 1; } } function getIcons( $ext ) { switch( $ext ) { case "dir": $file = "dir"; break; case "link": $file = "link"; break; case "zip": case "tgz": case "gz": case "Z": $file = "compressed"; break; case "gif": case "jpg": $file = "image2"; break; case "dvi": $file = "dvi"; break; case "": case "exe": $file = "binary"; break; case "sh": case "php": case "php3": case "sql": case "inc": case "js": $file = "script"; break; case "txt": $file = "text"; break; case "html": case "shtml": case "phtml": $file = "world1"; break; default: $file = "generic"; break; } return $IMG=""; } class MyFile { var $name; var $path; var $type; var $ext; var $stype; var $sfile; var $size; var $file; var $atime; var $ctime; var $mtime; var $group; var $inode; var $owner; var $perms; function set( $filename, $path ) { GLOBAL $cd; $this->name = $filename; $this->path = $path ; $this->file = $this->path."/".$this->name; $this->type = filetype( $this->file ); $this->size = filesize( $this->file ); $this->atime = fileatime( $this->file ); $this->ctime = filectime( $this->file ); $this->mtime = filemtime( $this->file ); $this->group = filegroup( $this->file ); $this->inode = fileinode( $this->file ); $this->owner = fileowner( $this->file ); $this->perms = fileperms( $this->file ); switch( $this->type ) { case "link": $this->sfile = readlink( $this->file ); $this->stype = filetype( $this->sfile ); $this->ext = "link"; break; case "file": $list = explode( ".", $this->name ); $nb = sizeof( $list ); if( $nb > 0 ) $this->stype = $list[$nb-1]; else $this->stype = "???"; $this->ext = $this->stype; switch( $this->stype ) { case "gif": case "GIF": case "jpg": case "JPG": if( isset( $cd ) ) $pwd = $cd."/"; else $pwd = ""; $this->sfile = ""; break; default: $this->sfile = $this->stype; break; } break; default: $this->stype = ""; $this->sfile = ""; $this->ext = $this->type; break; } } function formatSize() { return number_format( $this->size, 0, ".", " "); } } function genUrl( $ref, $args, $key = "", $val = "" ) { $valist = ""; reset( $args ); if( $key != "" ) $args[ "$key" ] = $val; if( !is_array( $args ) ) return $ref; while( list( $key, $val ) = each( $args ) ) { if( $val == "" ) continue; if( $valist == "" ) $valist .= "?"; else $valist .= "&"; $valist .= $key."=".$val; } return $ref.$valist; } function updir( $path ) { $last = strrchr( $path, "/" ); $n1 = strlen( $last ); $n2 = strlen( $path ); return substr( $path, 0, $n2-$n1 ); } $ref = "index.php"; if( isset( $cd ) ) { $path = $cd; //$lcd = "?cd=$cd'"; $args[ "cd" ] = $cd; } else { $path = "."; //$lcd = ""; $args[ "cd" ] = ""; } if( isset( $nb ) ) { for( $i = 0; $i < $nb; $i++ ) { $var = "id_$i"; if( isset( $$var ) ) { $file = $path."/".$$var; if( is_file( $file ) || is_link( $file ) ) { if( unlink( $file ) ) echo "
$file deleted\n"; else echo "
unable to delete $file\n"; } elseif( is_dir( $file ) ) { if( rmdir( $file ) ) echo "
$file deleted\n"; else echo "
unable to delete $file\n"; } } } } $step = 100; if( !isset( $sort ) ) $sort = "name"; else $args[ "sort" ] = $sort; if( !isset( $from ) ) $from = 0; else $args[ "from" ] = $from; if( !isset( $to ) ) $to = $from + $step; $d = dir($path); /* echo "\n"; */ /* echo "
Home\n"; */ /* $updir = updir($d->path); */ /* if( $updir != "." ) */ /* echo "
Up dir; $updir\n"; */ /* echo "
cd: path."/..>..\n"; */ /* echo "
Chemin: ".$d->path."\n"; */ $n = 0; while( $entry=$d->read() ) { $lFiles[ $n ] = new MyFile; $lFiles[ $n ]->set( $entry, $path ); $n++; } $d->close(); echo "
\n"; echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @usort( $lFiles, cmp ); for( $i = 0; $i < $n; $i++ ) { if( ( $i < $from ) || ( $i >= $to ) ) continue; $k = $i; echo "\n"; echo "\n"; $IMG=getIcons( $lFiles[ $k ]->ext ); $dform = "M j y H:i"; // echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; switch( $lFiles[ $k ]->type ) { case "link": if( $lFiles[ $k ]->stype == "dir" ) { $tcd = $lFiles[ $k ]->path."/".$lFiles[ $k ]->name; echo "\n"; } else echo "\n"; break; case "dir": $tcd = $lFiles[ $k ]->path."/".$lFiles[ $k ]->name; /* echo "\n"; */ break; case "file": echo "\n"; break; default: echo "\n"; break; } echo "\n"; } echo "
CustomTypeNameFile-SizeExtensionFile-Access-TimeFile-Created-timeFile-Modified-timePermissionsGroupOwnerINodePreview

".$lFiles[ $k ]->type."$IMG ".$lFiles[ $k ]->name."".$lFiles[ $k ]->formatSize()."".$lFiles[ $k ]->ext ."".date( $dform, $lFiles[ $k ]->atime )."".date( $dform, $lFiles[ $k ]->ctime )."".date( $dform, $lFiles[ $k ]->mtime )."".$lFiles[ $k ]->perms."".$lFiles[ $k ]->group."".$lFiles[ $k ]->owner."".$lFiles[ $k ]->inode."". $lFiles[ $k ]->sfile."".$lFiles[ $k ]->sfile."". $lFiles[ $k ]->name."".$lFiles[ $k ]->sfile."NO
\n"; $from = $from - $step; if( isset( $cd ) ) { echo "\n"; } echo "\n"; //echo "
from=$from;to=$to;n=$n\n"; echo "
\n"; if( $from >= 0 ) { echo "Prev/\n"; } if( $to <= $n ) { echo "Next \n"; } echo "
\n"; /* echo "\n"; */ echo "
\n"; ?>
Your footer