forked from 20xd6/simple_blog
Fix for issue #18
The page generation now checks for the size of $file_arr and only generates a menu if the size os greater than 0.
This commit is contained in:
parent
4958a76f9a
commit
015c5ef6db
@ -23,6 +23,7 @@ if (file_exists($dir) && is_dir($dir) ) {
|
||||
$files_arr = array_diff($scan_arr, array('.','..','index.php','common','.htaccess') );
|
||||
// echo "<pre>"; print_r( $files_arr ); echo "</pre>";
|
||||
// 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;
|
||||
@ -42,6 +43,7 @@ if (file_exists($dir) && is_dir($dir) ) {
|
||||
echo("<ul><li><a href='$file'> $link_title </a></li></ul>\n");//Output the result.
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "Directory does not exists";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user