diff --git a/common/php/page_menu.php b/common/php/page_menu.php index 3960ead..dc116d2 100644 --- a/common/php/page_menu.php +++ b/common/php/page_menu.php @@ -18,11 +18,12 @@ function remove_sorting_number($link_title){ $dir = '.'; // Check if the directory exists if (file_exists($dir) && is_dir($dir) ) { - // Get the files of the directory as an array - $scan_arr = scandir($dir); - $files_arr = array_diff($scan_arr, array('.','..','index.php','common','.htaccess') ); - // echo "
"; print_r( $files_arr ); echo "
"; - // Get each files of our directory with line break + // Get the files of the directory as an array + $scan_arr = scandir($dir); + $files_arr = array_diff($scan_arr, array('.','..','index.php','common','.htaccess') ); + // echo "
"; print_r( $files_arr ); echo "
"; + // Get each files of our directory with line break + if (sizeof($files_arr) != 0 ) { foreach ($files_arr as $file) { //Get the file path $file_path = "./".$file; @@ -41,6 +42,7 @@ if (file_exists($dir) && is_dir($dir) ) { $link_title = remove_sorting_number($link_title);//Removes the number used to keep articles in post order from the displayed title. echo("\n");//Output the result. } + } } else { echo "Directory does not exists";