Skip to content

Commit d544ea7

Browse files
author
root
committed
Diverse Anpassungen und Fehlerbehebungen
1 parent ae0a681 commit d544ea7

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ data.txt
1111
.sass-cache
1212
package-lock.json
1313
.htaccess
14+
.htpasswd
15+
config.json

admin/config.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

config.inc.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
// WARNING!
4+
// This config gets overwritten by the admin panel if you use it.
5+
// If you want to use only this file, delete the admin/config.json file and do not use the admin panel
6+
// as it writes new config.json files.
7+
38
$config = array();
49
$sys['os'] = (DIRECTORY_SEPARATOR == '\\') || (strtolower(substr(PHP_OS, 0, 3)) === 'win') ? 'windows' : 'linux';
510
$config['dev'] = true;
@@ -52,17 +57,4 @@
5257
if($filename){
5358
$file = json_decode(file_get_contents($filename),true);
5459
$config = $file;
55-
// foreach($config as $k=>$conf){
56-
// if(is_array($conf)) {
57-
// foreach($conf as $sk => $sc) {
58-
// if(isset($file[$k][$sk]) && !empty($file[$k][$sk])) {
59-
// $config[$k][$sk] = $file[$k][$sk];
60-
// }
61-
// }
62-
// } else {
63-
// if(isset($file[$k]) && !empty($file[$k])) {
64-
// $config[$k] = $file[$k];
65-
// }
66-
// }
67-
// }
6860
}

index.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<script type="text/javascript">
3030
var isdev = true;
3131
var useVideo = <?php echo ($config['previewFromCam']) ? 'true' : 'false'; ?>;
32+
var imgFolder = <?php echo '"'.$config['folders']['images'].'"'; ?>;
33+
var thumbFolder = <?php echo '"'.$config['folders']['thumbs'].'"'; ?>;
3234
var gallery_newest_first = <?php echo ($config['gallery']['newest_first']) ? 'true' : 'false'; ?>;
3335
</script>
3436
</head>
@@ -86,8 +88,12 @@
8688
<?php
8789
$imagelist = ($config['gallery']['newest_first'] === true) ? array_reverse($images) : $images;
8890
foreach($imagelist as $image) {
89-
echo '<a href="/images/'.$image.'" data-size="1920x1280">
90-
<img src="/thumbs/'.$image.'" />
91+
92+
$filename_photo = $config['folders']['images'] . DIRECTORY_SEPARATOR . $image;
93+
$filename_thumb = $config['folders']['thumbs'] . DIRECTORY_SEPARATOR . $image;
94+
95+
echo '<a href="'.$filename_photo.'" data-size="1920x1280">
96+
<img src="'.$filename_thumb.'" />
9197
<figure>Caption</figure>
9298
</a>';
9399
}

resources/js/core.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ var photoBooth = (function () {
151151
public.addImage(result.img);
152152

153153
// Add Image
154-
$('<img src="/images/' + result.img + '" class="original">').load(function () {
154+
$('<img src="/'+imgFolder+'/' + result.img + '" class="original">').load(function () {
155155
$('#result').css({
156-
'background-image': 'url(/images/' + result.img + ')'
156+
'background-image': 'url(/'+imgFolder+'/' + result.img + ')'
157157
});
158158
startPage.fadeOut(400, function () {
159159
resultPage.fadeIn(400, function () {
@@ -176,7 +176,7 @@ var photoBooth = (function () {
176176
// add image to Gallery
177177
public.addImage = function (image) {
178178
// fixme: set to appendTo, if new images should appear at the end, or to prependTo, if new images should appear at the beginning
179-
var $node = $('<a>').html('<img src="/thumbs/' + image + '" />').data('size', '1920x1280').attr('href', '/images/' + image + '?new=1')
179+
var $node = $('<a>').html('<img src="/'+thumbFolder+'/' + image + '" />').data('size', '1920x1280').attr('href', '/'+imgFolder+'/' + image + '?new=1')
180180
if (gallery_newest_first) {
181181
$node.prependTo($('#galimages'));
182182
} else {
@@ -220,7 +220,7 @@ var photoBooth = (function () {
220220
} else {
221221
if (!processing) {
222222
public.reset();
223-
if(useVideo){
223+
if(useVideo && navigator.mediaDevices){
224224
navigator.getMedia = (navigator.mediaDevices.getUserMedia || navigator.mediaDevices.webkitGetUserMedia || navigator.mediaDevices.mozGetUserMedia || false);
225225
if(navigator.getMedia) {
226226
navigator.mediaDevices.getUserMedia(webcamConstraints)
@@ -285,7 +285,7 @@ var photoBooth = (function () {
285285
} else {
286286
pswpQR.empty();
287287
var img = pswp.currItem.src;
288-
img = img.replace('/images/', '');
288+
img = img.replace('/'+imgFolder+'/', '');
289289
$('<img>').attr('src', 'qrcode.php?filename=' + img).appendTo(pswpQR);
290290

291291
pswpQR.addClass('qr-active').fadeIn('fast');
@@ -295,7 +295,7 @@ var photoBooth = (function () {
295295
$(document).on('click touchstart', '.gal-print', function (e) {
296296
e.preventDefault();
297297
var img = pswp.currItem.src;
298-
img = img.replace('images/', '');
298+
img = img.replace(imgFolder+'/', '');
299299
$.ajax({
300300
url: 'print.php?filename=' + encodeURI(img),
301301
}).done(function (data) {

0 commit comments

Comments
 (0)