12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?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');
- }
- $mode = @$_GET['mode'];
- $dirinfo = get_dir_info($dir);
- if (!$dirinfo) {
- die('Nie ma katalogu');
- }
- $images = get_dir_images($dir, $mode);
- $content = '';
- foreach ($images as $image) {
- $path = urlencode($image['path']);
- $content .= '<a href="image.php?dir='.$dir.'&file='.$path;
- if ($mode) {
- $content .= '&mode=' . urlencode($mode);
- }
- $content .= '"><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']);
- if ($mode == 'viewcomments') {
- $dirname .= ' (tylko komentarze)';
- }
- $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>';
- }
- $mode = json_encode($mode);
- ?><!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']?>';
- const mode = '<?=$mode?>';
- </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>
|