include('../includes/engine.php') ?>
|
- - //set the HTTP path to your directory $http_path = $_SERVER['PHP_SELF']."?do=show&set="; $http_path = ereg_replace ("sets/", "", $http_path); //set the server path to your directory, add trailing / $dir_path = $_SERVER['DOCUMENT_ROOT'].'/photo/sets/'; //open directory if($handle = @opendir("$dir_path")) { $count= 0; //read through each file while (false !== ($files = readdir($handle))) { //exclude file types if(($files != ".") && ($files != "..") && (!preg_match("/\b_/i", "$files")) && (!preg_match("/\bindex/i", "$files")) && (!preg_match("/\bsets/i", "$files")) && (!preg_match("/\bthe_modified/i", "$files"))) { //build array from resulting files $file_array["$count"]=$files; $count++; } } //sort the array alphabetically asort($file_array); //spit our each file foreach($file_array as $file) { $name = $file = ereg_replace (".php", "", $file); $name = ereg_replace ("_", " ", $file); //output file link ?> } } ?> |