index.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. require dirname(__DIR__) . '/app/bootstrap.php';
  3. auth_require();
  4. $site = site_get();
  5. $galleries = galleries_all();
  6. $active = count(array_filter($galleries, fn($g) => !gallery_is_expired($g)));
  7. $stats = array_map(fn($g) => gallery_stats($g['slug']), $galleries);
  8. $views = array_sum(array_column($stats, 'views'));
  9. $downloads = array_sum(array_column($stats, 'downloads'));
  10. admin_header('Dashboard');
  11. flash_render();
  12. ?>
  13. <h1>Dashboard</h1>
  14. <div class="card">
  15. <table>
  16. <tr><td>Showreel images</td><td><?= count($site['showreel'] ?? []) ?></td>
  17. <td><a href="showreel.php">Manage →</a></td></tr>
  18. <tr><td>Galleries</td><td><?= count($galleries) ?> (<?= $active ?> active)</td>
  19. <td><a href="galleries.php">Manage →</a></td></tr>
  20. <tr><td>Gallery views</td><td><?= $views ?></td>
  21. <td><a href="galleries.php">Per gallery →</a></td></tr>
  22. <tr><td>Archive downloads</td><td><?= $downloads ?></td>
  23. <td><a href="galleries.php">Per gallery →</a></td></tr>
  24. <tr><td>Front page</td><td><?= e($site['intro_title']) ?></td>
  25. <td><a href="frontpage.php">Edit →</a></td></tr>
  26. </table>
  27. </div>
  28. <p class="help">
  29. Tip: create a gallery under <em>Galleries</em>, then share its link with your client.
  30. Password and expiry date are optional per gallery.
  31. </p>
  32. <?php admin_footer(); ?>