dir.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. require_once('include/config.php');
  3. require_once('include/db.php');
  4. require_once('include/comment.php');
  5. $dir = @$_GET['dir'];
  6. if (empty($dir)) {
  7. die('Niepoprawne żądanie');
  8. }
  9. $dirinfo = get_dir_info($dir);
  10. if (!$dirinfo) {
  11. die('Nie ma katalogu');
  12. }
  13. $images = get_dir_images($dir);
  14. $content = '';
  15. foreach ($images as $image) {
  16. $path = urlencode($image['path']);
  17. $content .= '<a href="image.php?dir='.$dir.'&amp;file='.$path.'"><img src="' . $config['thumbnailpath'] . urlencode($dir) . '/' . $config['thumbnailsize'] . '-' . $path . '" alt="Obrazek"/></a>';
  18. }
  19. if (!$images || count($images) == 0) {
  20. $content = 'Katalog jest pusty!';
  21. }
  22. $dirname = htmlspecialchars($dirinfo['name']);
  23. $comments_data = get_comments($dirinfo['id'], 'dir');
  24. $comments = generate_comment_field($comments_data, 'dir', $dirinfo['id']);
  25. ?><!DOCTYPE html>
  26. <html>
  27. <head>
  28. <title>Obrazki: <?=$dirname?></title>
  29. <link rel="stylesheet" href="style.css?<?=$time?>" type="text/css">
  30. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  31. <script type="text/javascript">
  32. const imageUrlPrefix = <?=$config['imagepath']?>;
  33. const scriptUrlPrefix = <?=$config['basepath']?>;
  34. </script>
  35. <script type="text/javascript" src="https://k4be.pl/jquery/jquery-3.6.3.min.js"></script>
  36. <script type="text/javascript" src="comment.js?<?=$time?>"></script>
  37. </head>
  38. <body>
  39. <h1>Obrazki: <?=$dirname?></h1>
  40. <div id="image-list">
  41. <a class="gora" href="."></a><h2>... wybierz dowolny obrazek, najlepiej pierwszy.</h2>
  42. <?=$content?>
  43. </div>
  44. <div id="comments">
  45. <?=$comments?>
  46. </div>
  47. <a class="k4" href="http://k4be.pl/"></a>
  48. </body>
  49. </html>