$slug, 'title' => $title, 'created_at' => date('Y-m-d H:i:s'), 'password_hash' => $password !== '' ? password_hash($password, PASSWORD_DEFAULT) : null, 'expires_at' => trim((string)($_POST['expires_at'] ?? '')) ?: null, 'images' => [], ]; // A guest upload link is just a per-gallery secret in the URL; presence // of upload_key = guest uploads enabled (revocable from the edit page). if (!empty($_POST['allow_uploads'])) { $gallery['upload_key'] = random_token(24); } gallery_save($gallery); flash_set('Gallery created. Now add images.'); redirect('gallery-edit.php?g=' . rawurlencode($slug)); } if ($action === 'delete') { $gallery = gallery_load((string)($_POST['slug'] ?? '')); if ($gallery !== null) { s3_delete_gallery_objects($gallery); gallery_delete($gallery['slug']); flash_set('Gallery and its S3 images deleted.'); } redirect('galleries.php'); } } $galleries = galleries_all(); admin_header('Galleries', 'galleries'); flash_render(); ?>
No galleries yet.
| Title | Images | Protection | Expires | Created | Actions |
|---|---|---|---|---|---|
| = e($g['title']) ?> | = count($g['images'] ?? []) ?> | = !empty($g['password_hash']) ? 'password' : 'open' ?> = !empty($g['upload_key']) ? ' uploads' : '' ?> | = e($g['expires_at'] ?? '—') ?> = $expired ? ' expired' : '' ?> | = e(substr($g['created_at'] ?? '', 0, 10)) ?> | Edit · View ↗ |