|
@@ -8,12 +8,13 @@ $file = @$_GET['file'];
|
|
|
if (empty($dir) || empty($file)) {
|
|
|
die('Niepoprawne żądanie');
|
|
|
}
|
|
|
+$mode = @$_GET['mode'];
|
|
|
|
|
|
$dirinfo = get_dir_info($dir);
|
|
|
if (!$dirinfo) {
|
|
|
die('Nie ma katalogu');
|
|
|
}
|
|
|
-$images = get_dir_images($dir);
|
|
|
+$images = get_dir_images($dir, $mode);
|
|
|
|
|
|
$found = false;
|
|
|
$prev = null;
|
|
@@ -40,11 +41,16 @@ if (!$fileinfo) {
|
|
|
|
|
|
$dirhtml = urlencode($dirinfo['path']);
|
|
|
$filehtml = urlencode($fileinfo['path']);
|
|
|
+if ($mode) {
|
|
|
+ $modehtml = '&mode=' . urlencode($mode);
|
|
|
+} else {
|
|
|
+ $modehtml = '';
|
|
|
+};
|
|
|
|
|
|
-$content = '<div class="full-image-div"><a class="gora" href="dir.php?dir='.$dirhtml.'"></a><a id="poprz" ';
|
|
|
+$content = '<div class="full-image-div"><a class="gora" href="dir.php?dir='.$dirhtml.$modehtml.'"></a><a id="poprz" ';
|
|
|
if ($prev) {
|
|
|
$prevhtml = urlencode($prev['path']);
|
|
|
- $content .= 'href="image.php?file='.$prevhtml.'&dir='.$dirhtml.'"';
|
|
|
+ $content .= 'href="image.php?file='.$prevhtml.'&dir='.$dirhtml.$modehtml.'"';
|
|
|
} else {
|
|
|
$content .= 'style="display:none;"';
|
|
|
}
|
|
@@ -52,17 +58,20 @@ if ($prev) {
|
|
|
$content .= '></a><div><a id="imagelink"';
|
|
|
if ($next) {
|
|
|
$nexthtml = urlencode($next['path']);
|
|
|
- $content .= ' href="image.php?file='.$nexthtml.'&dir='.$dirhtml.'"';
|
|
|
+ $content .= ' href="image.php?file='.$nexthtml.'&dir='.$dirhtml.$modehtml.'"';
|
|
|
}
|
|
|
$content .= '><img id="image" src="'.$config['imagepath'] . $dirhtml.'/'.$filehtml.'" class="pelny"/></a><a id="nast" ';
|
|
|
if ($next) {
|
|
|
- $content .= 'href="image.php?file='.$nexthtml.'&dir='.$dirhtml.'"';
|
|
|
+ $content .= 'href="image.php?file='.$nexthtml.'&dir='.$dirhtml.$modehtml.'"';
|
|
|
} else {
|
|
|
$content .= 'style="display:none;"';
|
|
|
}
|
|
|
$content .= '></a>';
|
|
|
|
|
|
$dirname = htmlspecialchars($dirinfo['name']);
|
|
|
+if ($mode == 'viewcomments') {
|
|
|
+ $dirname .= ' (tylko komentarze)';
|
|
|
+}
|
|
|
|
|
|
$comments_data = get_comments($fileinfo['id'], 'image');
|
|
|
$comments = generate_comment_field($comments_data, 'image', $fileinfo['id']);
|
|
@@ -74,8 +83,9 @@ $comments = generate_comment_field($comments_data, 'image', $fileinfo['id']);
|
|
|
<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 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="image.js?<?=$time?>"></script>
|