if ( ( $directoryHandle = opendir( $jw.$directoryPath ) ) != false ) {
$fileInDirectory = array() ;
while ( ( $filename = readdir( $directoryHandle ) ) != false ) {
if ( ( $filename == '.' ) | ( $filename == '..' ) | ( $filename == 'smallImages' ) | ( $filename == 'robots.txt' ) ) { ; }
elseif ( ( strpos( $filename, '.txt' ) > 0 ) | ( strpos( $filename, '.pdf' ) > 0 ) | ( strpos( $filename, '.doc' ) > 0 ) | ( strpos( $filename, '.jpg' ) > 0 ) | ( strpos( $filename, '.tif' ) > 0 ) | ( strpos( $filename, '.png' ) > 0 ) ) { $fileInDirectory[] = $filename ; }
}
$numberOfFiles = count( $fileInDirectory ) ;
$ix = 0 ;
}
else { print ( 'Directory "'.$directoryPath.'" failed to open.
' ) ; }
$numberOfFiles = count( $fileInDirectory ) ;
if ( $numberOfFiles > 0 ) {
$mp = $numberOfFiles - 1 ;
while( $mp > 0 ) {
$ix = 0 ;
while( $ix < $mp ) {
if ( $fileInDirectory[ $ix ] > $fileInDirectory[ $ix + 1 ] ) {
$fTemp = $fileInDirectory[ $ix ] ;
$fileInDirectory[ $ix ] = $fileInDirectory[ $ix + 1 ] ;
$fileInDirectory[ $ix + 1 ] = $fTemp ;
}
$ix ++ ;
}
$mp = $mp - 1 ;
}
$ix = 0 ;
while ( $ix < $numberOfFiles ) {
$theEntry = '/'.$fileInDirectory[ $ix ] ;
print ( '