|
|
@ -4,7 +4,7 @@ Nice Dirlist
|
|
|
|
|
|
|
|
|
|
|
|
https://source.netsyms.com/Netsyms/NiceDirlist
|
|
|
|
https://source.netsyms.com/Netsyms/NiceDirlist
|
|
|
|
|
|
|
|
|
|
|
|
Copyright 2018 Netsyms Technologies
|
|
|
|
Copyright 2018-2019 Netsyms Technologies
|
|
|
|
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
@ -58,15 +58,10 @@ $MIRRORBASE = [
|
|
|
|
];
|
|
|
|
];
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// Bootstrap and optional CSS
|
|
|
|
// Bootstrap, FontAwesome, and optional CSS
|
|
|
|
$STYLESHEETS = [
|
|
|
|
$STYLESHEETS = [
|
|
|
|
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
|
|
|
|
"https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css",
|
|
|
|
];
|
|
|
|
"https://use.fontawesome.com/releases/v5.6.3/css/all.css"
|
|
|
|
// FontAwesome 5 locations
|
|
|
|
|
|
|
|
$FONTAWESOME = [
|
|
|
|
|
|
|
|
"https://use.fontawesome.com/releases/v5.0.9/js/solid.js",
|
|
|
|
|
|
|
|
"https://use.fontawesome.com/releases/v5.0.9/js/brands.js",
|
|
|
|
|
|
|
|
"https://use.fontawesome.com/releases/v5.0.9/js/fontawesome.js"
|
|
|
|
|
|
|
|
];
|
|
|
|
];
|
|
|
|
// Mimetype to FontAwesome conversion table
|
|
|
|
// Mimetype to FontAwesome conversion table
|
|
|
|
$MIMEICONS = [
|
|
|
|
$MIMEICONS = [
|
|
|
@ -76,7 +71,7 @@ $MIMEICONS = [
|
|
|
|
// Text/Code
|
|
|
|
// Text/Code
|
|
|
|
"text/html" => "fab fa-html5",
|
|
|
|
"text/html" => "fab fa-html5",
|
|
|
|
"text/css" => "fab fa-css3",
|
|
|
|
"text/css" => "fab fa-css3",
|
|
|
|
"text/csv" => "fas fa-table",
|
|
|
|
"text/csv" => "fas fa-file-csv",
|
|
|
|
"application/ecmascript" => "fas fa-code",
|
|
|
|
"application/ecmascript" => "fas fa-code",
|
|
|
|
"text/calendar" => "fas fa-calendar",
|
|
|
|
"text/calendar" => "fas fa-calendar",
|
|
|
|
"application/javascript" => "fab fa-js",
|
|
|
|
"application/javascript" => "fab fa-js",
|
|
|
@ -91,7 +86,12 @@ $MIMEICONS = [
|
|
|
|
"text/checksum" => "fas fa-file-medical-alt",
|
|
|
|
"text/checksum" => "fas fa-file-medical-alt",
|
|
|
|
"text/config" => "fas fa-list",
|
|
|
|
"text/config" => "fas fa-list",
|
|
|
|
"text/other" => "fas fa-file-alt",
|
|
|
|
"text/other" => "fas fa-file-alt",
|
|
|
|
// Archives and disk images
|
|
|
|
"text/x-java-source" => "fab fa-java",
|
|
|
|
|
|
|
|
"application/x-python-code" => "fab fa-python",
|
|
|
|
|
|
|
|
"text/x-vcard" => "fas fa-address-card",
|
|
|
|
|
|
|
|
"text/x-c" => "fas fa-code",
|
|
|
|
|
|
|
|
"text/x-asm" => "fas fa-microchip",
|
|
|
|
|
|
|
|
// Archives, disk images, and executables
|
|
|
|
"application/x-iso9660-image" => "fas fa-hdd",
|
|
|
|
"application/x-iso9660-image" => "fas fa-hdd",
|
|
|
|
"application/x-gzip" => "fas fa-file-archive",
|
|
|
|
"application/x-gzip" => "fas fa-file-archive",
|
|
|
|
"application/zip" => "fas fa-file-archive",
|
|
|
|
"application/zip" => "fas fa-file-archive",
|
|
|
@ -100,11 +100,15 @@ $MIMEICONS = [
|
|
|
|
"application/x-7z-compressed" => "fas fa-file-archive",
|
|
|
|
"application/x-7z-compressed" => "fas fa-file-archive",
|
|
|
|
"application/x-msi" => "fab fa-windows",
|
|
|
|
"application/x-msi" => "fab fa-windows",
|
|
|
|
"application/x-msdownload" => "fab fa-windows",
|
|
|
|
"application/x-msdownload" => "fab fa-windows",
|
|
|
|
"application/java-archive" => "fas fa-coffee",
|
|
|
|
"application/java-archive" => "fab fa-java",
|
|
|
|
|
|
|
|
"application/x-java-jnlp-file" => "fab fa-java",
|
|
|
|
"application/x-rar-compressed" => "fas fa-file-archive",
|
|
|
|
"application/x-rar-compressed" => "fas fa-file-archive",
|
|
|
|
"application/x-tar" => "fas fa-file-archive",
|
|
|
|
"application/x-tar" => "fas fa-file-archive",
|
|
|
|
"application/x-apple-diskimage" => "fab fa-apple",
|
|
|
|
"application/x-apple-diskimage" => "fab fa-apple",
|
|
|
|
"application/imgfile" => "fas fa-hdd",
|
|
|
|
"application/imgfile" => "fas fa-hdd",
|
|
|
|
|
|
|
|
"application/x-debian-package" => "fab fa-linux",
|
|
|
|
|
|
|
|
"application/x-appimage" => "fab fa-linux",
|
|
|
|
|
|
|
|
"application/x-msdownload" => "fab fa-windows",
|
|
|
|
// Fonts
|
|
|
|
// Fonts
|
|
|
|
"application/vnd.ms-fontobject" => "fas fa-font",
|
|
|
|
"application/vnd.ms-fontobject" => "fas fa-font",
|
|
|
|
"application/x-font-ttf" => "fas fa-font",
|
|
|
|
"application/x-font-ttf" => "fas fa-font",
|
|
|
@ -124,6 +128,7 @@ $MIMEICONS = [
|
|
|
|
"image/tiff" => "fas fa-image",
|
|
|
|
"image/tiff" => "fas fa-image",
|
|
|
|
"image/webp" => "fas fa-image",
|
|
|
|
"image/webp" => "fas fa-image",
|
|
|
|
"image/other" => "fas fa-image",
|
|
|
|
"image/other" => "fas fa-image",
|
|
|
|
|
|
|
|
"application/postscript" => "fas fa-file-image",
|
|
|
|
// Audio
|
|
|
|
// Audio
|
|
|
|
"audio/acc" => "fas fa-file-audio",
|
|
|
|
"audio/acc" => "fas fa-file-audio",
|
|
|
|
"audio/ogg" => "fas fa-file-audio",
|
|
|
|
"audio/ogg" => "fas fa-file-audio",
|
|
|
@ -133,6 +138,8 @@ $MIMEICONS = [
|
|
|
|
"audio/3gpp" => "fas fa-file-audio",
|
|
|
|
"audio/3gpp" => "fas fa-file-audio",
|
|
|
|
"audio/3gpp2" => "fas fa-file-audio",
|
|
|
|
"audio/3gpp2" => "fas fa-file-audio",
|
|
|
|
"audio/other" => "fas fa-file-audio",
|
|
|
|
"audio/other" => "fas fa-file-audio",
|
|
|
|
|
|
|
|
"audio/mpeg" => "fas fa-file-audio",
|
|
|
|
|
|
|
|
"application/vnd.apple.mpegurl" => "fas fa-podcast",
|
|
|
|
// Video
|
|
|
|
// Video
|
|
|
|
"application/x-shockwave-flash" => "fas fa-video-slash",
|
|
|
|
"application/x-shockwave-flash" => "fas fa-video-slash",
|
|
|
|
"video/mpeg" => "fas fa-file-video",
|
|
|
|
"video/mpeg" => "fas fa-file-video",
|
|
|
@ -141,6 +148,7 @@ $MIMEICONS = [
|
|
|
|
"video/3gpp" => "fas fa-file-video",
|
|
|
|
"video/3gpp" => "fas fa-file-video",
|
|
|
|
"video/3gpp2" => "fas fa-file-video",
|
|
|
|
"video/3gpp2" => "fas fa-file-video",
|
|
|
|
"video/other" => "fas fa-file-video",
|
|
|
|
"video/other" => "fas fa-file-video",
|
|
|
|
|
|
|
|
"video/x-matroska" => "fas fa-file-video",
|
|
|
|
// Office files
|
|
|
|
// Office files
|
|
|
|
"application/x-abiword" => "fas fa-file-word",
|
|
|
|
"application/x-abiword" => "fas fa-file-word",
|
|
|
|
"application/msword" => "fas fa-file-word",
|
|
|
|
"application/msword" => "fas fa-file-word",
|
|
|
@ -152,12 +160,24 @@ $MIMEICONS = [
|
|
|
|
"application/vnd.oasis.opendocument.text" => "fas fa-file-word",
|
|
|
|
"application/vnd.oasis.opendocument.text" => "fas fa-file-word",
|
|
|
|
"application/pdf" => "fas fa-file-pdf",
|
|
|
|
"application/pdf" => "fas fa-file-pdf",
|
|
|
|
"application/rtf" => "fas fa-file",
|
|
|
|
"application/rtf" => "fas fa-file",
|
|
|
|
|
|
|
|
"application/x-gnumeric" => "fas fa-file-excel",
|
|
|
|
// Other
|
|
|
|
// Other
|
|
|
|
"application/vnd.amazon.ebook" => "fas fa-book",
|
|
|
|
"application/vnd.amazon.ebook" => "fas fa-book",
|
|
|
|
"application/epub+zip" => "fas fa-book",
|
|
|
|
"application/epub+zip" => "fas fa-book",
|
|
|
|
|
|
|
|
"application/x-mobipocket-ebook" => "fas fa-book",
|
|
|
|
"application/ogg" => "fas fa-play",
|
|
|
|
"application/ogg" => "fas fa-play",
|
|
|
|
"application/x-sql" => "fas fa-database",
|
|
|
|
"application/x-sql" => "fas fa-database",
|
|
|
|
"application/odb" => "fas fa-database",
|
|
|
|
"application/odb" => "fas fa-database",
|
|
|
|
|
|
|
|
"application/gpx+xml" => "fas fa-compass",
|
|
|
|
|
|
|
|
"application/java-serialized-object" => "fab fa-java",
|
|
|
|
|
|
|
|
"application/java-vm" => "fab fa-java",
|
|
|
|
|
|
|
|
"application/x-ms-shortcut" => "fas fa-external-link-alt",
|
|
|
|
|
|
|
|
"application/x-bittorrent" => "fas fa-share-alt",
|
|
|
|
|
|
|
|
"application/x-pkcs12" => "fas fa-certificate",
|
|
|
|
|
|
|
|
"application/pgp-encrypted" => "fas fa-lock",
|
|
|
|
|
|
|
|
"application/pgp-signature" => "fas fa-file-signature",
|
|
|
|
|
|
|
|
"model/mesh" => "fas fa-cube",
|
|
|
|
|
|
|
|
"model/vnd.dwf" => "fas fa-cube",
|
|
|
|
];
|
|
|
|
];
|
|
|
|
// File extension to mimetype conversion
|
|
|
|
// File extension to mimetype conversion
|
|
|
|
$EXT2MIME = [
|
|
|
|
$EXT2MIME = [
|
|
|
@ -180,6 +200,8 @@ $EXT2MIME = [
|
|
|
|
"img" => "application/imgfile",
|
|
|
|
"img" => "application/imgfile",
|
|
|
|
"ini" => "text/config",
|
|
|
|
"ini" => "text/config",
|
|
|
|
"yml" => "text/config",
|
|
|
|
"yml" => "text/config",
|
|
|
|
|
|
|
|
"py" => "application/x-python-code",
|
|
|
|
|
|
|
|
"appimage" => "application/x-appimage",
|
|
|
|
// From Apache: http://svn.apache.org/viewvc?view=revision&revision=1810122
|
|
|
|
// From Apache: http://svn.apache.org/viewvc?view=revision&revision=1810122
|
|
|
|
"ez" => "application/andrew-inset",
|
|
|
|
"ez" => "application/andrew-inset",
|
|
|
|
"aw" => "application/applixware",
|
|
|
|
"aw" => "application/applixware",
|
|
|
@ -1223,40 +1245,36 @@ word-break: break-all;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
foreach ($FONTAWESOME as $fa) {
|
|
|
|
|
|
|
|
echo "<script src=\"$fa\"></script>\n";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
<div class="container">
|
|
|
|
<div class="card">
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-12 col-md-4 col-lg-2" style="text-align: center;">
|
|
|
|
|
|
|
|
<img src="<?php echo $SITEICON; ?>" class="site-icon" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-12 col-md-8 col-lg-10">
|
|
|
|
|
|
|
|
<div class="d-flex flex-column justify-content-center" style="height: 100%;">
|
|
|
|
|
|
|
|
<h1 class="display-4"><?php echo $H1; ?></h1>
|
|
|
|
|
|
|
|
<h2 class="display-5"><?php echo $H2; ?></h2>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row mt-4">
|
|
|
|
<div class="card">
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-12 col-md-4 col-lg-2" style="text-align: center;">
|
|
|
|
|
|
|
|
<img src="<?php echo $SITEICON; ?>" class="site-icon" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-12 col-md-8 col-lg-10">
|
|
|
|
|
|
|
|
<div class="d-flex flex-column justify-content-center" style="height: 100%;">
|
|
|
|
|
|
|
|
<h1 class="display-4"><?php echo $H1; ?></h1>
|
|
|
|
|
|
|
|
<h2 class="display-5"><?php echo $H2; ?></h2>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
<div class="row mt-4">
|
|
|
|
<div class="card">
|
|
|
|
<div class="col-12">
|
|
|
|
<div class="card-header d-flex">
|
|
|
|
<div class="card">
|
|
|
|
<span class="mr-auto">
|
|
|
|
|
|
|
|
<nav aria-label="breadcrumb">
|
|
|
|
<div class="card-header d-flex">
|
|
|
|
<ol class="breadcrumb m-0">
|
|
|
|
<span class="mr-auto">
|
|
|
|
<?php
|
|
|
|
<nav aria-label="breadcrumb">
|
|
|
|
$pathparts = explode("/", $path);
|
|
|
|
<ol class="breadcrumb m-0">
|
|
|
|
$pstr = "";
|
|
|
|
<?php
|
|
|
|
for ($i = 0; $i < count($pathparts)-1; $i++) {
|
|
|
|
$pathparts = explode("/", $path);
|
|
|
|
|
|
|
|
$pstr = "";
|
|
|
|
|
|
|
|
for ($i = 0; $i < count($pathparts)-1; $i++) {
|
|
|
|
$p = $pathparts[$i];
|
|
|
|
$p = $pathparts[$i];
|
|
|
|
$pstr .= $p . "/";
|
|
|
|
$pstr .= $p . "/";
|
|
|
|
if ($i == 0) {
|
|
|
|
if ($i == 0) {
|
|
|
@ -1268,17 +1286,18 @@ for ($i = 0; $i < count($pathparts)-1; $i++) {
|
|
|
|
echo "\t<li class=\"breadcrumb-item\"><a href=\"$pstr\">$p</a></li>";
|
|
|
|
echo "\t<li class=\"breadcrumb-item\"><a href=\"$pstr\">$p</a></li>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "\n";
|
|
|
|
echo "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
</ol>
|
|
|
|
</ol>
|
|
|
|
</nav>
|
|
|
|
</nav>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
<ul class="list-group">
|
|
|
|
<div class="card-body">
|
|
|
|
<?php
|
|
|
|
<ul class="list-group">
|
|
|
|
$files = scandir($dir);
|
|
|
|
<?php
|
|
|
|
foreach ($files as $f) {
|
|
|
|
$files = scandir($dir);
|
|
|
|
|
|
|
|
foreach ($files as $f) {
|
|
|
|
if (strpos($f, '.') !== 0 && !in_array($f, $IGNORE)) {
|
|
|
|
if (strpos($f, '.') !== 0 && !in_array($f, $IGNORE)) {
|
|
|
|
echo "<li class=\"list-group-item d-flex\">\n";
|
|
|
|
echo "<li class=\"list-group-item d-flex\">\n";
|
|
|
|
echo "\t<a href=\"$path$f\">";
|
|
|
|
echo "\t<a href=\"$path$f\">";
|
|
|
@ -1286,7 +1305,7 @@ foreach ($files as $f) {
|
|
|
|
echo "<span class=\"fas fa-folder fa-fw\"></span> ";
|
|
|
|
echo "<span class=\"fas fa-folder fa-fw\"></span> ";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$icon = "fas fa-file";
|
|
|
|
$icon = "fas fa-file";
|
|
|
|
$extension = pathinfo("$dir/$f")['extension'];
|
|
|
|
$extension = strtolower(pathinfo("$dir/$f")['extension']);
|
|
|
|
// If we don't have an extension, try using the whole filename
|
|
|
|
// If we don't have an extension, try using the whole filename
|
|
|
|
if ($extension == "") {
|
|
|
|
if ($extension == "") {
|
|
|
|
$extension = $f;
|
|
|
|
$extension = $f;
|
|
|
@ -1326,13 +1345,13 @@ foreach ($files as $f) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</li>\n\n";
|
|
|
|
echo "</li>\n\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|