upgraded to file manager

This commit is contained in:
bogale 2026-10-01 16:47:43 +09:00
commit 4a71f92328
9 changed files with 134 additions and 103 deletions

View file

@ -0,0 +1,16 @@
<?php
$_shared = $_SERVER["DOCUMENT_ROOT"]."/templates";
require "$_shared/lib.php";
$_title = "Media viewer";
require "$_shared/header.php";
$urlsBase = __DIR__."/files/media/urls";
if (isset($_GET["list"])) {
$file = "$urlsBase/".$_GET["list"];
$urls = json_decode(file_get_contents($file));
header("Location: ".$urls[array_rand($urls)]);
} else foreach (scandir($urlsBase) as $list) {
if ($list[0] === '.') continue;
echo "<a href='?list=$list'>Hub $list</a><br>\n";
}
require "$_shared/footer.php";
?>