From 9dbd07551b0e575bcb3ba37bc3b7ff9a96a3e1b2 Mon Sep 17 00:00:00 2001 From: alopexc0de Date: Tue, 9 Oct 2012 02:48:18 -0400 Subject: [PATCH] Revamped upload dir listing - easier to work with --- upload/Audio/index.php | 77 +++++++++++++++++++++----------------- upload/Documents/index.php | 75 +++++++++++++++++++++---------------- upload/Pictures/index.php | 77 +++++++++++++++++++++----------------- upload/Video/index.php | 77 +++++++++++++++++++++----------------- upload/index.php | 75 +++++++++++++++++++++---------------- 5 files changed, 213 insertions(+), 168 deletions(-) diff --git a/upload/Audio/index.php b/upload/Audio/index.php index 4b95ce6..a219723 100755 --- a/upload/Audio/index.php +++ b/upload/Audio/index.php @@ -6,37 +6,37 @@ index of UnPS-GAMA uploads - +


- +
- + @@ -59,33 +59,42 @@ function size($file) { $trbg = "1"; // which - background +echo "
+
+ + "; + // reading the content and... $mydir = dir("./"); while ($file=$mydir->read()){ $kind = filetype($file); - // if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query - // if ($kind != '.' && $kind != '..' && $kind != 'index.php'){ - //... showing the content: - // - backgroundcolor - echo ""; - if ($trbg=="1"){ - echo ""; - $trbg = "2"; - } - else if ($trbg=="2"){ - echo ""; - $trbg = "1"; - } - - //"; - //...filesize... - echo ""; - //... last change... - $change = filemtime($file); - echo ""; - } -//} + if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query + if ($file != '.' && $file != '..' && $file != 'index.php' && $file != '.htaccess'){ + //... showing the content: + // - backgroundcolor + echo ""; + if ($trbg=="1"){ + echo ""; + $trbg = "2"; + } + else if ($trbg=="2"){ + echo ""; + $trbg = "1"; + } + //"; + //...filesize... + if(is_dir($file)){ + echo ""; + }else{ + echo ""; + } + //... last change... + $change = filemtime($file); + echo ""; + } + } +} $mydir->close(); ?> diff --git a/upload/Documents/index.php b/upload/Documents/index.php index 65e0cf7..a219723 100755 --- a/upload/Documents/index.php +++ b/upload/Documents/index.php @@ -6,37 +6,37 @@ index of UnPS-GAMA uploads - +


- +
file
size
last modified
DIR
and filename... - echo "".$file."".size($file)." ".date("j. - M. - Y; H:i:s",$change)."
and filename... + echo "
DIR
".size($file)."
".date("H:i:s - j M, Y",$change)."
- + @@ -59,32 +59,41 @@ function size($file) { $trbg = "1"; // which - background +echo "
+
+ + "; + // reading the content and... $mydir = dir("./"); while ($file=$mydir->read()){ $kind = filetype($file); - // if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query - if ($kind != '.' && $kind != '..' && $kind != 'index.php'){ - //... showing the content: - // - backgroundcolor - echo ""; - if ($trbg=="1"){ - echo ""; - $trbg = "2"; - } - else if ($trbg=="2"){ - echo ""; - $trbg = "1"; - } - - //"; - //...filesize... - echo ""; - //... last change... - $change = filemtime($file); - echo ""; - } + if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query + if ($file != '.' && $file != '..' && $file != 'index.php' && $file != '.htaccess'){ + //... showing the content: + // - backgroundcolor + echo ""; + if ($trbg=="1"){ + echo ""; + $trbg = "2"; + } + else if ($trbg=="2"){ + echo ""; + $trbg = "1"; + } + //"; + //...filesize... + if(is_dir($file)){ + echo ""; + }else{ + echo ""; + } + //... last change... + $change = filemtime($file); + echo ""; + } + } } $mydir->close(); ?> diff --git a/upload/Pictures/index.php b/upload/Pictures/index.php index 4b95ce6..a219723 100755 --- a/upload/Pictures/index.php +++ b/upload/Pictures/index.php @@ -6,37 +6,37 @@ index of UnPS-GAMA uploads - +


- +
file
size
last modified
DIR
and filename... - echo "".$file."".size($file)." ".date("j. - M. - Y; H:i:s",$change)."
and filename... + echo "
DIR
".size($file)."
".date("H:i:s - j M, Y",$change)."
- + @@ -59,33 +59,42 @@ function size($file) { $trbg = "1"; // which - background +echo "
+
+ + "; + // reading the content and... $mydir = dir("./"); while ($file=$mydir->read()){ $kind = filetype($file); - // if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query - // if ($kind != '.' && $kind != '..' && $kind != 'index.php'){ - //... showing the content: - // - backgroundcolor - echo ""; - if ($trbg=="1"){ - echo ""; - $trbg = "2"; - } - else if ($trbg=="2"){ - echo ""; - $trbg = "1"; - } - - //"; - //...filesize... - echo ""; - //... last change... - $change = filemtime($file); - echo ""; - } -//} + if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query + if ($file != '.' && $file != '..' && $file != 'index.php' && $file != '.htaccess'){ + //... showing the content: + // - backgroundcolor + echo ""; + if ($trbg=="1"){ + echo ""; + $trbg = "2"; + } + else if ($trbg=="2"){ + echo ""; + $trbg = "1"; + } + //"; + //...filesize... + if(is_dir($file)){ + echo ""; + }else{ + echo ""; + } + //... last change... + $change = filemtime($file); + echo ""; + } + } +} $mydir->close(); ?> diff --git a/upload/Video/index.php b/upload/Video/index.php index 4b95ce6..a219723 100755 --- a/upload/Video/index.php +++ b/upload/Video/index.php @@ -6,37 +6,37 @@ index of UnPS-GAMA uploads - +


- +
file
size
last modified
DIR
and filename... - echo "".$file."".size($file)." ".date("j. - M. - Y; H:i:s",$change)."
and filename... + echo "
DIR
".size($file)."
".date("H:i:s - j M, Y",$change)."
- + @@ -59,33 +59,42 @@ function size($file) { $trbg = "1"; // which - background +echo "
+
+ + "; + // reading the content and... $mydir = dir("./"); while ($file=$mydir->read()){ $kind = filetype($file); - // if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query - // if ($kind != '.' && $kind != '..' && $kind != 'index.php'){ - //... showing the content: - // - backgroundcolor - echo ""; - if ($trbg=="1"){ - echo ""; - $trbg = "2"; - } - else if ($trbg=="2"){ - echo ""; - $trbg = "1"; - } - - //"; - //...filesize... - echo ""; - //... last change... - $change = filemtime($file); - echo ""; - } -//} + if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query + if ($file != '.' && $file != '..' && $file != 'index.php' && $file != '.htaccess'){ + //... showing the content: + // - backgroundcolor + echo ""; + if ($trbg=="1"){ + echo ""; + $trbg = "2"; + } + else if ($trbg=="2"){ + echo ""; + $trbg = "1"; + } + //"; + //...filesize... + if(is_dir($file)){ + echo ""; + }else{ + echo ""; + } + //... last change... + $change = filemtime($file); + echo ""; + } + } +} $mydir->close(); ?> diff --git a/upload/index.php b/upload/index.php index 65e0cf7..a219723 100755 --- a/upload/index.php +++ b/upload/index.php @@ -6,37 +6,37 @@ index of UnPS-GAMA uploads - +


- +
file
size
last modified
DIR
and filename... - echo "".$file."".size($file)." ".date("j. - M. - Y; H:i:s",$change)."
and filename... + echo "
DIR
".size($file)."
".date("H:i:s - j M, Y",$change)."
- + @@ -59,32 +59,41 @@ function size($file) { $trbg = "1"; // which - background +echo "
+
+ + "; + // reading the content and... $mydir = dir("./"); while ($file=$mydir->read()){ $kind = filetype($file); - // if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query - if ($kind != '.' && $kind != '..' && $kind != 'index.php'){ - //... showing the content: - // - backgroundcolor - echo ""; - if ($trbg=="1"){ - echo ""; - $trbg = "2"; - } - else if ($trbg=="2"){ - echo ""; - $trbg = "1"; - } - - //"; - //...filesize... - echo ""; - //... last change... - $change = filemtime($file); - echo ""; - } + if ($kind != "php"){ // ATTENTION! if you want this file to show subdirectories, remove this query + if ($file != '.' && $file != '..' && $file != 'index.php' && $file != '.htaccess'){ + //... showing the content: + // - backgroundcolor + echo ""; + if ($trbg=="1"){ + echo ""; + $trbg = "2"; + } + else if ($trbg=="2"){ + echo ""; + $trbg = "1"; + } + //"; + //...filesize... + if(is_dir($file)){ + echo ""; + }else{ + echo ""; + } + //... last change... + $change = filemtime($file); + echo ""; + } + } } $mydir->close(); ?>
file
size
last modified
DIR
and filename... - echo "".$file."".size($file)." ".date("j. - M. - Y; H:i:s",$change)."
and filename... + echo "
DIR
".size($file)."
".date("H:i:s - j M, Y",$change)."