1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- require_once('include/config.php');
- require_once('include/db.php');
- require_once('include/comment.php');
- $dir = @$_GET['dir'];
- if (empty($dir)) {
- die('Niepoprawne żądanie');
- }
- $dirinfo = get_dir_info($dir);
- if (!$dirinfo) {
- die('Nie ma katalogu');
- }
- $images = get_dir_images($dir);
- $content = '';
- foreach ($images as $image) {
- $path = urlencode($image['path']);
- $content .= '<a href="image.php?dir='.$dir.'&file='.$path.'"><img src="' . $config['thumbnailpath'] . urlencode($dir) . '/' . $config['thumbnailsize'] . '-' . $path . '" alt="Obrazek"/></a>';
- }
- if (!$images || count($images) == 0) {
- $content = 'Katalog jest pusty!';
- }
- $dirname = htmlspecialchars($dirinfo['name']);
- $comments_data = get_comments($dirinfo['id'], 'dir');
- $comments = generate_comment_field($comments_data, 'dir', $dirinfo['id']);
- $topcomment = '';
- if ($dirinfo['comment']) {
- $topcomment = '<h3>' . htmlspecialchars($dirinfo['comment']) . '</h3>';
- }
- ?><!DOCTYPE html>
- <html>
- <head>
- <title>Obrazki: <?=$dirname?></title>
- <link rel="stylesheet" href="style.css?<?=$time?>" type="text/css">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <script type="text/javascript">
- const imageUrlPrefix = <?=$config['imagepath']?>;
- const scriptUrlPrefix = <?=$config['basepath']?>;
- </script>
- <script type="text/javascript" src="https://k4be.pl/jquery/jquery-3.6.3.min.js"></script>
- <script type="text/javascript" src="comment.js?<?=$time?>"></script>
- </head>
- <body>
- <h1>Obrazki: <?=$dirname?></h1>
- <div id="image-list">
- <a class="gora" href="."></a><h2>... wybierz dowolny obrazek, najlepiej pierwszy.</h2>
- <?=$topcomment?>
- <?=$content?>
- </div>
- <div id="comments">
- <?=$comments?>
- </div>
- <a class="k4" href="http://k4be.pl/"></a>
- </body>
- </html>
|