4) ) $sort = substr($url_array[1], 5); $url_path_array_temp = explode("/", $url_path); $url_depth = sizeof($url_path_array_temp); $url_path_array = array(); for ($i = 0; $i < $url_depth; $i++) { if ($url_path_array_temp[$i] != "") { array_push ($url_path_array, $url_path_array_temp[$i]); } } $url_depth = sizeof($url_path_array); $folder_real_path = realpath('../'.$url_path); if ($folder_real_path !== true) { $folder_real_path = realpath('.'); } ////////////////////////////////////////////////////////// // Retrieve File/Folder Data ////////////////////////////////////////////////////////// // Create and populate arrays with filenames //$filenamelist = scandir($folder_real_path); $filenamelist = array(); if ($folder_handle = opendir($folder_real_path)) { while (false !== ($file = readdir($folder_handle))) { if (!in_array($file, $skip_files) and !search_string_using_array($file, $skip_files_containing)) { array_push ($filenamelist, $file); } } closedir($folder_handle); } $filenamelength = array(); $filetypelist = array(); $simpletypelist = array(); $filesizelist = array(); $filetimelist = array(); $max_filename_length = 0; if ($list_folders_first) { $folderlist = array(); $filelist = array(); for ($i = 0; $i < count($filenamelist); $i++) { $file_full_path = $folder_real_path.'/'.$filenamelist[$i]; if (is_dir($file_full_path)) { array_push ($folderlist, $filenamelist[$i]); } else { array_push ($filelist, $filenamelist[$i]); } } $filenamelist = array_merge($folderlist, $filelist); } // Retrieve date, size and type for the files/folders for ($i = 0; $i < count($filenamelist); $i++) { $file_full_path = $folder_real_path.'/'.$filenamelist[$i]; if (is_file($file_full_path)) { $filenamelength[$i] = strlen($filenamelist[$i]); $filetypelist[$i] = 'File'; $simpletypelist[$i] = 'file'; $filesizelist[$i] = filesize($file_full_path); $filetimelist[$i] = filemtime($file_full_path); } elseif (is_dir($file_full_path)) { $filenamelength[$i] = strlen($filenamelist[$i]); $filetypelist[$i] = 'Directory'; $simpletypelist[$i] = 'dir'; $filesizelist[$i] = 0; $filetimelist[$i] = filemtime($file_full_path); } else { $filenamelength[$i] = 0; $filetypelist[$i] = 'Unknown'; $simpletypelist[$i] = 'unk'; $filesizelist[$i] = -1; $filetimelist[$i] = -1; } } ////////////////////////////////////////////////////////// // Sort the arrays if requested (defaults lists the files by names) ////////////////////////////////////////////////////////// switch ($sort) { case "date": if ( $list_folders_first_always ) { array_multisort($simpletypelist, SORT_ASC, $filetimelist, SORT_NUMERIC, SORT_ASC, $filenamelist, $filenamelength, $filetypelist, $filesizelist); } else array_multisort($filetimelist, SORT_NUMERIC, SORT_ASC, $filenamelist, $filenamelength, $filetypelist, $simpletypelist, $filesizelist); break; case "date_desc": if ( $list_folders_first_always ) { array_multisort($simpletypelist, SORT_ASC, $filetimelist, SORT_NUMERIC, SORT_DESC, $filenamelist, $filenamelength, $filetypelist, $filesizelist); } else array_multisort($filetimelist, SORT_NUMERIC, SORT_DESC, $filenamelist, $filenamelength, $filetypelist, $simpletypelist, $filesizelist); $sorted_by_date_desc = 1; break; case "name": if ( $list_folders_first_always ) { array_multisort($simpletypelist, SORT_ASC, $filenamelist, SORT_ASC, $filetypelist, $filenamelength, $filesizelist, $filetimelist); } else array_multisort($filenamelist, SORT_ASC, $filetypelist, $filenamelength, $filesizelist, $simpletypelist, $filetimelist); break; case "name_desc": if ( $list_folders_first_always ) { array_multisort($simpletypelist, SORT_ASC, $filenamelist, SORT_DESC, $filetypelist, $filenamelength, $filesizelist, $filetimelist); } else array_multisort($filenamelist, SORT_DESC, $filetypelist, $simpletypelist, $filenamelength, $filesizelist, $filetimelist); $sorted_by_name_desc = 1; break; case "size": if ( $list_folders_first_always ) { array_multisort($simpletypelist, SORT_ASC, $filesizelist, SORT_NUMERIC, SORT_ASC, $filenamelist, $filenamelength, $filetypelist, $filetimelist); } else array_multisort($filesizelist, SORT_NUMERIC, SORT_ASC, $filenamelist, $filenamelength, $filetypelist, $simpletypelist, $filetimelist); break; case "size_desc": if ( $list_folders_first_always ) { array_multisort($simpletypelist, SORT_ASC, $filesizelist, SORT_NUMERIC, SORT_DESC, $filenamelist, $filenamelength, $filetypelist, $filetimelist); } else array_multisort($filesizelist, SORT_NUMERIC, SORT_DESC, $filenamelist, $filenamelength, $filetypelist, $simpletypelist, $filetimelist); $sorted_by_size_desc = 1; break; case "type": if ( $list_folders_first_always ) { array_multisort($simpletypelist, SORT_ASC, $filetypelist, SORT_ASC, $filenamelist, $filenamelength, $filesizelist, $filetimelist); } else array_multisort($filetypelist, SORT_ASC, $filenamelist, $simpletypelist, $filenamelength, $filesizelist, $filetimelist); break; case "type_desc": if ( $list_folders_first_always ) { array_multisort($simpletypelist, SORT_ASC, $filetypelist, SORT_DESC, $filenamelist, $filenamelength, $filesizelist, $filetimelist); } else array_multisort($filetypelist, SORT_DESC, $filenamelist, $simpletypelist, $filenamelength, $filesizelist, $filetimelist); $sorted_by_type_desc = 1; break; default: if ( $list_folders_first_always ) { array_multisort($simpletypelist, SORT_ASC, $filenamelist, SORT_ASC, $filetypelist, $filenamelength, $filesizelist, $filetimelist); } else { array_multisort($filenamelist, SORT_ASC, $filetypelist, $filenamelength, $filesizelist, $simpletypelist, $filetimelist); } break; } ////////////////////////////////////////////////////////// // Helper Functions ////////////////////////////////////////////////////////// ////////////////////////////////////////////////////// // Returns the prefixed byte size // Usage: size_to_prefixed_size(filesize($file)); ////////////////////////////////////////////////////// function size_to_prefixed_size($size) { $i=0; $unit = array(" B ", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"); while (($size / 1024) > 1) { $size = $size / 1024; $i++; } return substr($size, 0, strpos($size,'.')+2).$unit[$i]; //return sprintf("%.3F", $size).$unit[$i]; } ////////////////////////////////////////////////////// // Returns true if a key in the array matches agains the string // Usage: search_string_using_array($string, $string_array); ////////////////////////////////////////////////////// function search_string_using_array($string, $string_array) { for ($i = 0; $i < count($string_array); $i++) { if (strpos($string, $string_array[$i]) !== false) return true; } return false; } ////////////////////////////////////////////////////////// // Start Document Output ////////////////////////////////////////////////////////// ?>
,
,@@;
; `@@::@; ; .:#
.#@@# #@;::::#@ `#@#@ @::#, ;`
'@#::::@` ;@+:::::::@+ ;@#::::@. @::::+; .'#@
.#@':::::::@. @@:::::::::#@ `#@':::::::@, ':::::;+ .;:;@.
'@+::::::::::#@, ;@'::::::::::.,' ;@#::::::::::'@' +:::::::@ .::::#+
.#@;::::::::::::' +, `@@::::@@:::::;` @ `#@'::::::::::::;`+' ':'@@@@@#: .::::::@`
@::::::::::::::::, @; :@'::::;@@:::::' ,# @::::::::::::::::' #' '@@@@@@@@+# ':::::::+;
@::::::::::::::::+ @' #@#@::::::::::::# @; @::::::::::::::::@ #+ #@@@@@@@@@#+ #::::::;;:@`
@::::::::::::::::@ @' `@+@@@'::::#@@@:::@ @. @::::::::::::::::@ @+ '@@@@@@@@@@#@+ .'::::'@@@@@:+
#::::::::::::::::# @ ,@'@@@@@:::#@@@@@::@ ;# @::::::::::::::::' @ #@@@@@@@@@@@'#@#:::::@@@@@@@:',
'::::::::::::::::' @ ,@+@@@@@@:::@@@@@@::@ +; #::::::::::::::::;. +. '@@@@@@@@@@@#:::::::'@@@@@@@::,#.
.;:::::::::::::::::. +; .#@@@@@@@@:::@@@@@@::@ #. ':::::::::::::::::; ;+ #@@@@@@@@@@@:+@@@@@@@@@@@@@:::::#
'::::::::::::::::::' ;# @@@@@@@@@@;::#@@@@@::@ @ :::::::::::::::::::# .@ +@@@@@@@@@@@@@@@@@@@@@@@@@@:::::@@
@@:::+:::::::::::::@ `@ @@@@@@@@@@;:::#@@@:::@ @ @@:::+:::::::::::::@ @ +@@@@@@@@@@@@@@@@@@@@@@@@#:::::`,
,@'::#;::::::::::::# @ @@@@@@@@@@@@@#;::::::# @ `@#::+'::::::::::::+ @ +@@@@@@@@@@@@@@@@@@@@@@@#:::::@++@,
@:::@::::::::::::' @. @@@@@@@@@@@@@@@@:::::+ @ #;::@::::::::::::; +: '@@@@@@@@@@@@@@@@@@@@@':::::::::;@.
#::'#:::::::::::; :; @#@@@@@@@@@@@@@@@::::+ @ +::;@::::::::::::. .+ #@@@@@@@@@@@@@@@@@@@@@@:::::::::@`@
#::@::::::::::::, # @#@@@@@@@@@@@@@@@@::;; @ @::#;:::::::::::; @ `'@@@@@@@@@@@@@@@@@@@@@::@@@+::# +.
;;::@:::::::::::' @ @'@@@@@@@@@@@@@@@@':;; @ ,'::@:::::::::::# @ #@@@@@@@@@@@@@@@@@@@@@:'@@@@::` @
@::+'::::::::::@ @ @@@@@@@@@@@@@@@@@@@:;; @ #::'+::::::::::@ + `#@@@@@@@@@@@@@@@@@@@@:'@@@@:: .#
`@::@::::::::::# + @@@@@@@@@@@@@@@@@@@:;, .+ @::@::::::::::+ ;. #@@@@@@@@@@@@@@@@@@@@::+@@;+ #:
'':'+:::::::::' ;, .@@@@@@@@@@@@@@@@@@@:;. .' ,+:;#:::::::::; .' '@@@@@@@@@@@@@@@@@@@#:::::' '#
@::@:::::::::; .+ ;#@@@@@@@@@@@@@@@@@@:;. ;; #::@::::::::::` @ `#@+:+@@@@@@@@@@@@@@;:::::. .@
`#:'#:::::::::. @ @#@@@@@@@@@@@@@@@@@;:;; ;; @:;@:::::::::: @ #::::@@@@@@@@@@@@@#:::::# @`
;;:@:::::::':; @ @#@: @@@@@@@@@@@@@@::;; ;` .':@:::::::;:+ @ #::::#@@@@+;@@@@@@:::::' #:
`@:'#::::::,:+ @ `@:: #@@@@@@#@@@@@@;';; + `#:;#::::::.:@ @ ,:::# @@@#@#@@@@#::::::' .#
@@@::@::::::`:@ @ '+;,: @@@@@#@@@@@@@:@;; + @@@::@:::::: :+ @. #:+ @:+#`#@@@;::::::# @
+;::::+@::::: :+ @. @:;`:; .@@@@@#+@@@@;:@;; + ;'::::'@::::: :' +: :@ @::' @:::::::::,; +`
@::::::@':::: :; +, +@@@`:. `@@#'`#@@@: :#;+ + @::::::@+:::: :: ;' .@ @::# #:::::+:::# `;
+:::::::#@:::. :: ;; ':@@@ :: +@ @#;:; :''@` @ ;'::::::+@:::, ;: .+ @;@::#,;:::;`'::,' @
@::::::::@::: ;: .+ +:+@@ :; :@ ;;:: .:@@@ @ @::::::::@:::` ::. @ '@::+#:::' .:::+ ,`
#:::::::::@::: ::. `@ ,:::; ,:,:'; #:: .:@.`; @ ';::::::::@':: ,:; @ `@ @::@#:;` ':::+ #
+:::::;'+#@':: ::; @ @:; :; ;::@ @:; ::+@ :`@ #:::::;'+#@#:: .:' @ @,@'@::@;' ::''' ;
#@@@@@++:` `#:: ::' @ ,;:` :; ::@ ,@': ::::@# @@ '@@@@@++;` `@:; ::+ @ ,+::+@::@: ;;@,@. #
@;` #:. ;::# @ @:; :: :'; @+@:::; :@#;;@ @'` @:, ::;' @ @::::::@; ,':@ # @ ;
+@; #: ::;' @ ++:` :,;:@ @ @:;: ,+:@.@+ '@+ @:. ::'; @ `@@: .':::::#::::::' ;:' #
.@@, #: ;: ;' @ @:; ;::@ .@ +':, :@`@'@ `#@' @: ': :; @ @::+@` #::::;'` ;:# :`#;`
,@; .#@@@@:.:. ;'` @ `@: `:;+ ++ `@; :@`;' .@+ `+@@@@:`:, :;, @ ':;;;:+# @:::@: ::' @`@
#@@@; #:;; ;#` @ .; +'; :+. @. @: .;# @' #@@@; @:;: :', @ `' +:. ;;,#: ,@:@::';':@ @##
+ .':: :# @ @#@@` @: :@ @ ';, :@ `@ +` +::` ,+` @ @#@@. ':' ;;:'#@@@+' .;+::' :'
#::, ,:@ @ @:#+@+ @; .:@ `@ #; :'; #' '::; .:@ @ @:'#@# #: :';:::: ;:@ @
@:: ;::@ .+ @::#.'@' ;+, ::; :+ @: :@ @ @:: ;::@ @ @::+;;@+ ,:+ ;'' `@
+':`::,;;' ', @:::@`,@@ @: ;'` +, ';; :'` +' ;+:.,::;:# ,' @;::#..@@ @:: ':@ #:
`@:':; `:#` @ @::;:@ `@+ @: :# @ +: `:# @ @:;;; :+, + @;:;:#` @# +: :#, +. @
@;::` ;:@ @ @;: ;:@ @: `@; :@ @ @:. :+ +; @'::. ;:@ @ @': ;:@ @' `:' +:# .@+@@;
@+:, .:#' `; @': ::# @` ;': :@ @ +:' `:' @ ##:: :+# + @#: ;:@ @. ;:' `.;''';:@ #'::@;@
@#: ;:@ # @#: `::+ .@ +;, :@ @ ;:; :# @, #@: ;:@ '. @@: ::# `@`@:` `:::::::::'@@+;.::+@ @'
#+: .:@; @ @#: ,::' ,@ +;, ;:@+ @ ':; .:, `@ ##: `:#+ @ @@: .::+ `@@:` +#@++++++@@:+ ,:,# ',@
@': ;;@ +@@@@+` @@: '#@: ;+;;, ;:@@ @ #:; :@ @` #+: ;:@ '@@@@#` @@:. ;#@' .@:+ :@@` @:, ':@ `#,
`@;: ,:@'#:::;###@@#:. ;@@@@@, '+;, ,:##@+ @:, :@ '# @;: .:@;@::::###@@@:, ,@@@@@; :#:` ':@@, +:. ';@@;;'@;
.@:, :@@+:: `;:::#+:,#@@@@@@@. +': .:@@@@';'@@:. :': @ `@:: ;#@#:; `:;::##::+@@@@@@@, +:+ ;:@#+ ''; ::@ ,@`
;#:. ::@::. :;::#@@@@@@@@@` #: :@@:::::::. .;# @: ,@:, .:@;:, :;::+@@@@@@@@@. @: ;::+;@+@#' ;:' `@
++:` :::: :@@@@@@@@@@@ @: :@@::::::. :@ ;# ;#:. ;:::` .@@@@@@@@@@@`+;' ;::'`@,@: ::+ #`
#': ,@@ .;: @@@@@@@@@@@@@@:, :@': :@ @ ++:` .@@ .;: @@@@@@@@@@@@@ @:: ;::, #+:. ;:+ @
`@;: @@@ ;@@@@ @@@@@@@@@@@@@@#: ,:@:: ;@ @ @;: @@@. .@@@@` @@@@@@@@@@@@@@:': ;:'. @'' ::' '`
.@:: #@@ @@@@@@ :@@@@@+`.@@@@@@@@@@@@@@@:: ;:@:; :@ +:`@:: '@@ @@@@@@ ,#@@@@+` @@@@@@@@@@@@@@@#:' ;:# .#; ;:' #
;#:: ;` .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:` ::@:; :+` .#@:: ;` @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#:: ;:@ @: ::' '`
#+:: `@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+: :;#:: ,+. +#:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@;: ::@#:, ;:@@' #
@':, #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;:. .:+':: :'. @+:: +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@:+ `:;@;' :;; ,@@`
.@;:. ,+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;:: ::@;:. :',@':, ,+@@@@@#@@@@@@@@@@@@@@@@@@@@@@@@@#:, `:+'; ;:# .#
+@::` #@@@@##@@@@@@@@@@@@@@@@@@@@@@@@@#;:; ::@::` ;+@;:. +@@@@@+@@@@@@@@@@@@@@@@@@@@@@@':#;: .::+ :;` #`
@@:: @@@; ;@@@@@@@@@@@@@@@@@@@@@::@+#':; ::@:: @@::` @@@' ,@@@@@@@@@@@@@@@@@@@@@'.::@:+ ,, ;:;;;#@@#`
`@@:: ,:@# :@@@@@@@@@@@@@@@@@@@` #@.'#::. ::@:: @@:: .:@@` .@@@@@@@@@@@@@@@@@@@. ;:@+:. +;:::::::'@@
.#:: ` ,:@: .@@@@@@@@@@@,@@@@@@@' ,:@@ .@:::,:'@:: @:: ` .:@' `#@@@@@@@@@@.@@@@@@@' .:;,,:; .;'';::@@`
`+:;, ::;. ,:@. +@+`,@@@@@@@@ ::#@@ ##:;:@@:: #:;,` ,:;. .:@, '@#``@@@@@@@@ ;:@ #:+ ;@ #`
'@#'::::. ,:@':;::@` ;@' '@@@@@@@ .:+`.@# `@+;@#:; ,'@#';,::, .:@+::,:@, .@+ ,@@@@@@@ `:;. `+:. ;@ +`
@@@@@@+:::;,`.:@`#@::@. @' #@@@@@: ... ;:# :@# ,@@@#::: .::@@@@@@+'::;:.`:#,+@::@, @+ +@@@@@' `.. ;:@ +:' .:@ @`
`#@'`:@@@+;::'; `@#; '# @@@@@ @@@@@` `:+ '@# '@@@#::::` `::'@ +@+`,#@@+;::;+ `@#' ,@ #@@@@`@@@@@. :;` +; ':@ '.
#@` `;@@@@; `@@` @ @@@+#@@@@@@ ;:# :@# @+.+@@':::::::::#@ +@` ;@@@@' @@. @` @@@#'@@@@@@ ;:@ ' ,;';:@ @
.@; `'@+ ;@, #; .@@.@@@@@@@ :+ .@@` :;` :@@@+'''@@' `@' `'@# ,@; '+ `@@:@@@@@@@ :;` ;; :'';:::;'+@@+ .
#@#;, #@ ,@' @ +':@@@@@@@ ;:# ;@@; +@ `;;;;` @@@'; +@` `@+ @ ;+:#@@@@@@ ::@ @' ;;:::'#@+,. `@; .`
.;+@@@: ,@, @`@@'; @:'@@@@@; :+ @`#@@`;,; +`;+@@@; .@; #`@@;+ #:;@@@@@+ :;` :;. .+::;#@+, ,@``;
'@@@+,@#.# '@ `#:.@@@, ;:# ;# :@@+@@` @ ;@@@+,@@`@ ;@ @:,#@@; ::@ @: ;;:;@@, +'#
`+@@@@@` ;;: :+` @ #@@`@ ;# '@@@@@. .': :;. +:: .+:+@+: '@
`'@; @:: ::@ ;# ;@+. `@` '@+ #:; ,:@ `':: ;;;@' `,'@@@@@@@
#:` :+. @. '@@@#, `@@ @:. :;: #::::#, `;@@@@;:`
':; ::@ ;@ `'@@@@+, '@@ ,': .:@ ,::'' `;@@@'.
@:::::+; @' .'@@@@@@@@@@' @:::::;+ '@ ,##;
`@@@@@@@ ;@ ...;;;. @@@@@@@ .@@. '#.
`+@' #@` @; `'@+ +@` @+.#@@+;'+
`@#` .@@;;;'@ #@` `@@;;;;@ `;,
+@++@@@@@@` '@#+@@@@@@.
'++++;.. '++++;,.
'."\n";
}
?>
';
print $css_style;
echo "\n\t".''."\n";
}
?>
| Name | '."\n"; else echo "\t\t".'Name | '."\n"; if ($sorted_by_date_desc) echo "\t\t".'Date | '."\n"; else echo "\t\t".'Date | '."\n"; if ($sorted_by_size_desc) echo "\t\t".'Size | '."\n"; else echo "\t\t".'Size | '."\n"; echo "\t\n"; echo "\t
| ' .$filenamelist[$i] . ' | '."\n"; if ($filetypelist[$i] == 'File') { echo "\t\t".'' .strftime("%Y-%b-%d %H:%M", $filetimelist[$i]) .' | '."\n"; echo "\t\t".''.size_to_prefixed_size($filesizelist[$i]).' | '."\n"; } elseif ($filetypelist[$i] == 'Directory') { echo "\t\t".'' .strftime("%Y-%b-%d %H:%M", $filetimelist[$i]) .' | '."\n"; echo "\t\t".'- | '."\n"; } echo "\t