\n"; echo "\"\" http://".$_SERVER['SERVER_NAME']; echo "$prefix/"; echo "\"\"\n"; } else { echo "\n"; echo "\n"; } function get_extension($name) { $array = explode(".", $name); $retval = strtolower(array_pop($array)); return $retval; } // Recursion! And away we go... // Set some globals and clean up a bit... // What a messy person you are... function list_dir($chdir) { global $root, $prefix, $showsize, $display, $excludedir, $excludefile; unset($sdirs); unset($sfiles); chdir($chdir); $self = basename($_SERVER['PHP_SELF']); // Open the current directory $handle = opendir('.'); // Read the directory. If the item is a directory, place it in $sdirs. // If it's a filetype we want, put it in $sfiles. // If it is excluded, ignore it! while ($file = readdir($handle)) { if(is_dir($file) && $file != "." && $file != ".." && !in_array($file, $excludedir)) { $sdirs[] = $file; } elseif(is_file($file) && $file != "$self" && array_key_exists(get_extension($file), $display) && !in_array($file, $excludefile)) { $sfiles[] = $file; } } // Count the slashes to determine how deep we are in the directory. // Add lines to make it pretty. $dir = getcwd(); $dir1 = str_replace($root, "", $dir."/"); $count = substr_count($dir1, "/") + substr_count($dir1, "\\"); // Display directory names and recursively list them. if(is_array($sdirs)) { sort($sdirs); reset($sdirs); for($y=0; $y"; } list_dir($dir."/".$sdirs[$y]); } } chdir($chdir); // Run through the array of files and show them. if(is_array($sfiles)) { sort($sfiles); reset($sfiles); $sizeof = sizeof($sfiles); // What file types shall we display? // You set these in the first few lines of this script. for($y=0; $y<$sizeof; $y++) { if ($ezmapvalidate == 1) { echo ""; } else { echo ""; } } if ($ezmapvalidate == 1) { echo "\n"; } else { echo "\n"; } } } list_dir($root); if ($ezmapvalidate == 1) { echo "
\"\"\n"; echo " http://".$_SERVER['SERVER_NAME']; echo "$prefix/"; echo "
\"\"
"; } else { echo "
"; } for($z=1; $z<=$count; $z++) { if ($ezmapvalidate == 1) { echo "\"\"   "; } else { echo "\"\"   "; } } if(is_array($sfiles)) { if ($ezmapvalidate == 1) { echo "\"\""; } else { echo "\"\""; } } else { if ($ezmapvalidate == 1) { echo "\"\""; } else { echo "\"\""; } } if ($ezmapvalidate == 1) { echo "\"\" $sdirs[$y]"; } else { echo "\"\" $sdirs[$y]
"; } else { echo "
"; } for($z=1; $z<=$count; $z++) { if ($ezmapvalidate == 1) { echo "\"\"   "; } else { echo "\"\"   "; } } if($y == ($sizeof -1)) { if ($ezmapvalidate == 1) { echo "\"\""; } else { echo "\"\""; } } else { if ($ezmapvalidate == 1) { echo "\"\""; } else { echo "\"\""; } } if ($ezmapvalidate == 1) { echo "\"\" "; echo "$sfiles[$y]"; } else { echo "\"\" "; echo "$sfiles[$y]"; } if($showsize) { $fsize = @filesize($sfiles[$y])/1024; printf(" ( %.2f kB )", $fsize); } if ($ezmapvalidate == 1) { echo "
"; } else { echo "
"; } for($z=1; $z<=$count; $z++) { if ($ezmapvalidate == 1) { echo "\"\"   "; } else { echo "\"\"   "; } } if ($ezmapvalidate == 1) { echo "

\n"; } else { echo "
\n"; } // How long did that take? // WOW! That quick... Man am I good or what! $ftime = gettimeofday(); $time = round(($ftime[sec] + $ftime[usec] / 1000000) - ($stime[sec] + $stime[usec] / 1000000), 5); if ($ezmapvalidate == 1) { echo "
This page was generated in $time seconds.

\n"; if ($ezmap_valid_image == 1) { echo "\n"; echo "
\"Valid
\n"; } else { echo ""; } } else { echo "
This page was generated in $time seconds.

\n"; if ($ezmap_valid_image == 1) { echo "\n"; echo "
\"Valid
\n"; } else { echo ""; } } ?>