Use in-dir and out-dir directories

This commit is contained in:
hbrain 2026-05-25 18:09:06 +02:00
parent 0e5efcd87e
commit 6ff3e3c369
3 changed files with 7 additions and 7 deletions

4
.gitignore vendored
View file

@ -1,5 +1,5 @@
AGENTS.md AGENTS.md
uploads/ in-dir/
videos/ out-dir/
thumbs/ thumbs/
*.log *.log

View file

@ -1,10 +1,10 @@
<?php <?php
return [ return [
"site_name" => "Movmaker WebUI", "site_name" => "Movmaker WebUI",
"videos_dir" => __DIR__ . "/videos", "videos_dir" => __DIR__ . "/out-dir",
"thumbs_dir" => __DIR__ . "/thumbs", "thumbs_dir" => __DIR__ . "/thumbs",
"uploads_dir" => __DIR__ . "/uploads", "uploads_dir" => __DIR__ . "/in-dir",
"public_videos" => "videos", "public_videos" => "out-dir",
"public_thumbs" => "thumbs", "public_thumbs" => "thumbs",
"items_per_page" => 12, "items_per_page" => 12,
]; ];

View file

@ -36,7 +36,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$v = trim($_POST[$k] ?? ''); if ($v !== '') $lines[] = "$label: $v"; $v = trim($_POST[$k] ?? ''); if ($v !== '') $lines[] = "$label: $v";
} }
file_put_contents($dir . '/data.txt', implode("\n", $lines) . "\n"); file_put_contents($dir . '/data.txt', implode("\n", $lines) . "\n");
$msg = "Created movmaker input directory: uploads/$slug"; $msg = "Created movmaker input directory: in-dir/$slug";
} catch (Throwable $e) { $err = $e->getMessage(); } } catch (Throwable $e) { $err = $e->getMessage(); }
} }
?> ?>
@ -44,4 +44,4 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<header><h1>MVLog Admin</h1><nav><a href="index.php">Videos</a></nav></header><main> <header><h1>MVLog Admin</h1><nav><a href="index.php">Videos</a></nav></header><main>
<?php if($msg): ?><div class="ok"><?=h($msg)?></div><?php endif; ?><?php if($err): ?><div class="err"><?=h($err)?></div><?php endif; ?> <?php if($msg): ?><div class="ok"><?=h($msg)?></div><?php endif; ?><?php if($err): ?><div class="err"><?=h($err)?></div><?php endif; ?>
<section><h2>Add new movie input</h2><form method="post" enctype="multipart/form-data"><label>Title*<input name="title" required></label><label>Date<input name="date" placeholder="2026-05-25"></label><label>Place<input name="place"></label><label>Description<textarea name="description"></textarea></label><label>Images / videos*<input type="file" name="media[]" multiple required accept="image/*,video/*"></label><label>Audio (optional)<input type="file" name="audio[]" multiple accept="audio/*"></label><button type="submit">Create input-dir</button></form></section> <section><h2>Add new movie input</h2><form method="post" enctype="multipart/form-data"><label>Title*<input name="title" required></label><label>Date<input name="date" placeholder="2026-05-25"></label><label>Place<input name="place"></label><label>Description<textarea name="description"></textarea></label><label>Images / videos*<input type="file" name="media[]" multiple required accept="image/*,video/*"></label><label>Audio (optional)<input type="file" name="audio[]" multiple accept="audio/*"></label><button type="submit">Create input-dir</button></form></section>
</main><footer>Input dirs are saved under <code>uploads/</code>.</footer></body></html> </main><footer>Input dirs are saved under <code>in-dir/</code>.</footer></body></html>