aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/Views/gallery
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-03-21 22:36:11 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-03-21 22:36:11 +0100
commitd63e3c91a97d77b202e280ab0fa007dfbe1baa46 (patch)
treecd3533bfb947ea753d91f71a75406644a73d678d /src/app/Views/gallery
parentf60a390f5c51039fd1efc1df9a6a7f3864ce0062 (diff)
downloadcamagru-d63e3c91a97d77b202e280ab0fa007dfbe1baa46.tar.gz
camagru-d63e3c91a97d77b202e280ab0fa007dfbe1baa46.zip
Add editor with webcam/upload capture, overlay compositing, and gallery feed
Diffstat (limited to 'src/app/Views/gallery')
-rw-r--r--src/app/Views/gallery/index.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/app/Views/gallery/index.php b/src/app/Views/gallery/index.php
new file mode 100644
index 0000000..62fd7f3
--- /dev/null
+++ b/src/app/Views/gallery/index.php
@@ -0,0 +1,40 @@
+<?php // Gallery: public feed of all posts with pagination.?>
+<div class="gallery-page">
+ <h1>Gallery</h1>
+
+ <?php if (empty($posts)): ?>
+ <p class="hint">No posts yet. Be the first!</p>
+ <?php endif; ?>
+
+ <div class="gallery-feed">
+ <?php foreach ($posts as $post): ?>
+ <article class="gallery-post">
+ <div class="post-header">
+ <strong><?= htmlspecialchars($post['username']) ?></strong>
+ <time><?= date('M j, Y', strtotime($post['created_at'])) ?></time>
+ </div>
+ <img src="/<?= htmlspecialchars($post['image_path']) ?>" alt="Post by <?= htmlspecialchars($post['username']) ?>">
+ </article>
+ <?php endforeach; ?>
+ </div>
+
+ <?php if ($totalPages > 1): ?>
+ <nav class="pagination">
+ <?php if ($page > 1): ?>
+ <a href="/gallery?page=<?= $page - 1 ?>">&laquo; Previous</a>
+ <?php endif; ?>
+
+ <?php for ($i = 1; $i <= $totalPages; $i++): ?>
+ <?php if ($i === $page): ?>
+ <span class="current-page"><?= $i ?></span>
+ <?php else: ?>
+ <a href="/gallery?page=<?= $i ?>"><?= $i ?></a>
+ <?php endif; ?>
+ <?php endfor; ?>
+
+ <?php if ($page < $totalPages): ?>
+ <a href="/gallery?page=<?= $page + 1 ?>">Next &raquo;</a>
+ <?php endif; ?>
+ </nav>
+ <?php endif; ?>
+</div>