|
|
|
@ -158,7 +158,7 @@ function linkorselect($link, $img, $filename) { |
|
|
|
|
echo '<input type="checkbox" id="'.htmlentities($filename).'" name="elements[]" value="'.htmlentities($filename).'" />'; |
|
|
|
|
echo '<label for="'.htmlentities($filename).'"><img src="'.$img.'" alt="'.htmlentities($filename).'"/></label>'; |
|
|
|
|
} else { |
|
|
|
|
makelink($link, $img, $filename); |
|
|
|
|
makelink($link, $img, $filename, 'class="thumbnail"'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!isset($_REQUEST['secret'])) { |
|
|
|
@ -234,6 +234,8 @@ if (!isset($_REQUEST['secret'])) { |
|
|
|
|
<html> |
|
|
|
|
<header> |
|
|
|
|
<meta charset="utf-8"> |
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
|
|
<link rel="stylesheet" href="style.css"> |
|
|
|
|
</header> |
|
|
|
|
<body> |
|
|
|
|
<?php
|
|
|
|
@ -269,7 +271,7 @@ if (!isset($_REQUEST['secret'])) { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
?> |
|
|
|
|
<h1>Gallery: <?php echo htmlentities($username).' @ '.htmlentities($subpath) ?></h1>
|
|
|
|
|
<h1>Gallery: <?php echo htmlentities($username).($subpath?'@'.htmlentities($subpath):'') ?></h1>
|
|
|
|
|
<?php |
|
|
|
|
if (isset($_REQUEST['share'])) { |
|
|
|
|
echo '<a href="?path='.urlencode($subpath).'"><img src="?folder=←" alt="←"/></a><br/>'; |
|
|
|
@ -327,22 +329,22 @@ if (!isset($_REQUEST['secret'])) { |
|
|
|
|
</form> |
|
|
|
|
<?php |
|
|
|
|
foreach ($key['elements'] as $f) |
|
|
|
|
makelink('?path='.urlencode($subpath).'&file='.urlencode($f).'&view', '?path='.urlencode($subpath).'&file='.urlencode($f).'&thumb', $f); |
|
|
|
|
makelink('?path='.urlencode($subpath).'&file='.urlencode($f).'&view', '?path='.urlencode($subpath).'&file='.urlencode($f).'&thumb', $f, 'class="thumbnail"'); |
|
|
|
|
} else { |
|
|
|
|
if (isset($_REQUEST['view'])) { // view single image |
|
|
|
|
$objects = extractDir($imagepath); |
|
|
|
|
$pos = array_search($imgfile, $objects['files']); |
|
|
|
|
if ($pos>0) |
|
|
|
|
echo '<a href="?path='.urlencode($subpath).'&file='.urlencode($objects['files'][$pos-1]).'&view"><img src="?folder=←" alt="previous"/></a>'; |
|
|
|
|
echo '<a href="?path='.urlencode($subpath).'"><img src="?folder=↑" alt="↑"/></a>'; |
|
|
|
|
echo '<a href="?path='.urlencode($subpath).'"><img src="?folder=↑" alt="up"/></a>'; |
|
|
|
|
if ($pos<count($objects['files'])-1) |
|
|
|
|
echo '<a href="?path='.urlencode($subpath).'&file='.urlencode($objects['files'][$pos+1]).'&view"><img src="?folder=→" alt="next"/></a>'; |
|
|
|
|
echo '<div class="image"><img style="width: 100%" src="?path='.urlencode($subpath).'&file='.urlencode($imgfile).'" alt="'.urlencode($imgfile).'"/></div>'; |
|
|
|
|
echo '<img class="image" src="?path='.urlencode($subpath).'&file='.urlencode($imgfile).'" alt="'.urlencode($imgfile).'"/>'; |
|
|
|
|
if ($pos!==NULL) { |
|
|
|
|
$lower = max(0, $pos-floor(((int)$preview_num)/2)); |
|
|
|
|
$higher = min(count($objects['files']), $lower+((int)$preview_num)); |
|
|
|
|
for ($i=$lower; $i<$higher; ++$i) |
|
|
|
|
makelink('?path='.urlencode($subpath).'&file='.urlencode($objects['files'][$i]).'&view', '?path='.urlencode($subpath).'&file='.urlencode($objects['files'][$i]).'&thumb', $objects['files'][$i], 'style="width: '.round(100/($higher-$lower), 3).'%"'); |
|
|
|
|
makelink('?path='.urlencode($subpath).'&file='.urlencode($objects['files'][$i]).'&view', '?path='.urlencode($subpath).'&file='.urlencode($objects['files'][$i]).'&thumb', $objects['files'][$i], 'style="width: '.round(100/($higher-$lower), 3).'%" class="thumbnail"'); |
|
|
|
|
} |
|
|
|
|
} else { // gallery view |
|
|
|
|
if (isset($_REQUEST['select'])) { |
|
|
|
@ -365,7 +367,7 @@ if (!isset($_REQUEST['secret'])) { |
|
|
|
|
} |
|
|
|
|
$objects = extractDir($imagepath); |
|
|
|
|
foreach ($objects['dirs'] as $f) |
|
|
|
|
makelink('?path='.urlencode($subpath.($subpath!=""?'/':'').$f), '?path='.urlencode($subpath).'&folder='.urlencode($f), $f); |
|
|
|
|
makelink('?path='.urlencode($subpath.($subpath!=""?'/':'').$f), '?path='.urlencode($subpath).'&folder='.urlencode($f), $f, 'class="folder"'); |
|
|
|
|
echo '</div><div class="images">'; |
|
|
|
|
foreach ($objects['files'] as $f) |
|
|
|
|
linkorselect('?path='.urlencode($subpath).'&file='.urlencode($f).'&view', '?path='.urlencode($subpath).'&file='.urlencode($f).'&thumb', $f); |
|
|
|
|