some styling

master
Marc Wäckerlin 7 years ago
parent eabd0ab402
commit 970ebcfa26
  1. 2
      COPYING
  2. 10
      ChangeLog
  3. 2
      INSTALL
  4. 84
      html/index.php
  5. 2
      html/makefile.am

@ -1 +1 @@
/usr/share/automake-1.14/COPYING
/usr/share/automake-1.15/COPYING

@ -1,3 +1,13 @@
2017-03-03 14:06
* [r30] COPYING, ChangeLog, INSTALL, html/index.php:
fix typo
2017-03-02 17:29
* [r29] html/index.php:
fix base path behind proxy
2017-03-01 19:37
* [r28] ChangeLog, etc/authentication.php, html/index.php:

@ -1 +1 @@
/usr/share/automake-1.14/INSTALL
/usr/share/automake-1.15/INSTALL

@ -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,45 +329,45 @@ 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);
} 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>';
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>';
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).'%"');
}
} else { // gallery view
if (isset($_REQUEST['select'])) {
echo '<a href="?path='.urlencode($subpath).'">Normal-Modus</a>';
echo '<form method="POST">';
echo '<input type="hidden" name="path" value="'.htmlentities($subpath).'">';
echo '<label for="password">Passwort:</label>';
echo '<input type="text" size="5" name="password" value="'.substr(str_shuffle(strtolower(sha1(rand().time()."SeAG6"))),0,4).'">';
echo '<label for="valid-until">Gültig bis:</label>';
echo '<input type="date" size="10" name="valid-until" max="'.date('Y-m-d', time()+((int)$max_validity_days)*86400).'" value="'.date('Y-m-d', time()+14*86400).'"/>';
echo '<input type="submit" name="share" value="Teilen"/>';
} else {
echo '<a href="?path='.urlencode($subpath).'&select">Auswahl-Modus</a>';
}
echo '<div class="dirs">';
if (preg_match('/\//', $subpath)) {
echo '<a href="?path='.urlencode(preg_replace('/\/[^\/]+$/', '', $subpath)).'"><img src="?folder=↑" alt="↑"/></a>';
} elseif ($subpath!="") {
echo '<a href="?"><img src="?folder=↑" alt="↑"/></a>';
}
$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).'&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="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 '<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).'%" class="thumbnail"');
}
} else { // gallery view
if (isset($_REQUEST['select'])) {
echo '<a href="?path='.urlencode($subpath).'">Normal-Modus</a>';
echo '<form method="POST">';
echo '<input type="hidden" name="path" value="'.htmlentities($subpath).'">';
echo '<label for="password">Passwort:</label>';
echo '<input type="text" size="5" name="password" value="'.substr(str_shuffle(strtolower(sha1(rand().time()."SeAG6"))),0,4).'">';
echo '<label for="valid-until">Gültig bis:</label>';
echo '<input type="date" size="10" name="valid-until" max="'.date('Y-m-d', time()+((int)$max_validity_days)*86400).'" value="'.date('Y-m-d', time()+14*86400).'"/>';
echo '<input type="submit" name="share" value="Teilen"/>';
} else {
echo '<a href="?path='.urlencode($subpath).'&select">Auswahl-Modus</a>';
}
echo '<div class="dirs">';
if (preg_match('/\//', $subpath)) {
echo '<a href="?path='.urlencode(preg_replace('/\/[^\/]+$/', '', $subpath)).'"><img src="?folder=↑" alt="↑"/></a>';
} elseif ($subpath!="") {
echo '<a href="?"><img src="?folder=↑" alt="↑"/></a>';
}
$objects = extractDir($imagepath);
foreach ($objects['dirs'] as $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);

@ -11,7 +11,7 @@
EXTRA_DIST = configuration.php.in
wwwdir = ${pkgdatadir}/html
dist_www_DATA = folder.png .htaccess index.php
dist_www_DATA = folder.png .htaccess index.php style.css
www_DATA = configuration.php
MAINTAINERCLEANFILES = makefile.in

Loading…
Cancel
Save