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 ( '

' ) ; if ( ( strpos( $theEntry, '.jpg' ) > 0 ) || ( strpos( $theEntry, '.png' ) > 0 ) ) { print ( '' ) ; } else { $tf = file_get_contents( $fullPath.$theEntry ) ; print( $tf ) ; print( '
·' ) ; } print ( '
' ) ; $ix ++ ; } } else { print( 'No files to show!' ) ; }