Css and code cleaning

This commit is contained in:
Dusk 2021-08-29 21:09:13 +02:00
parent 5d6086de98
commit 61793bdb5f
2 changed files with 34 additions and 14 deletions

View File

@ -22,6 +22,8 @@
die();
}
//Check if home and back buttons are needed
if($currentdir != $basedir) {
echo("<div id=\"navigation\">");
@ -39,32 +41,48 @@
echo("<hr style=\"border:2px dashed #e87d3e; margin-bottom: 65px\"/>");
$is_there_files = false;
//Show folder links
$directories = [];
$files = [];
$dirs = scandir($currentdir);
echo("<h2>Carpetes</h2>");
foreach($dirs as $file) {
if ($file[0] != '.' && is_dir("$currentdir/$file")) {
echo("<a href=\"?q=" . ($_GET["q"] ? $_GET["q"] . "/" : "") . "$file\"><b>/$file/</b></a><br/>\n");
if ($file[0] != '.') {
if (is_dir("$currentdir/$file")) {
array_push($directories, $file);
}
else {
array_push($files, $file);
}
}
if(!is_dir("$currentdir/$file")) $is_there_files = true;
}
if($is_there_files){
echo("<hr/>");
//Show folder links
if(count($directories) > 0) {
echo("<h2>Carpetes</h2>");
foreach($directories as $file) {
printf('<a href="?q=%s%s"><b>/%s/</b></a><br/>' . "\n" ,
$_GET["q"] ? $_GET["q"] . "/" : "", $file, $file);
}
}
//Show Files
if(count($files) > 0) {
if (count($directories) > 0) echo("<hr/>");
//Show file links
echo("<h2>Fitxers</h2>");
echo("<div id=\"files\">");
foreach($dirs as $file) {
if ($file[0] != '.' && !is_dir("$currentdir/$file")) {
echo("<a href=\"$currentdir/$file\"><b>$file</b></a><br/>\n");
}
foreach($files as $file) {
printf('<a href="%s/%s"><b>%s</b></a><br/>' ,
$currentdir, $file, $file);
printf("\n");
}
echo("</div>");
}
printf('<p class="path">/%s</p>', $_GET["q"]);
?>
</body>

View File

@ -40,7 +40,7 @@ a:hover {
position: fixed;
bottom: 25px;
left: 25px;
background-color: #2e2e2e;
background-color: #101010;
}
#files {
@ -48,6 +48,8 @@ a:hover {
text-align: left;
display: inline-block;
border: 2px dashed #d6d6d6;
min-width: 400px;
background-color: #101010;
}
.path {