Merge branch 'master' of https://github.com/electerious/Lychee into uploader
Conflicts: assets/css/upload.css assets/min/main.css assets/min/main.js
This commit is contained in:
commit
3e019af823
@ -35,7 +35,6 @@ search = {
|
||||
if (data&&data.photos) {
|
||||
album.json = { content: data.photos };
|
||||
$.each(album.json.content, function() {
|
||||
album.parse(this);
|
||||
photosData += build.photo(this);
|
||||
});
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -10,7 +10,7 @@
|
||||
if (!$database->query("SELECT `checksum` FROM `lychee_photos` LIMIT 1;")) {
|
||||
$result = $database->query("ALTER TABLE `lychee_photos` ADD `checksum` VARCHAR(100) DEFAULT NULL");
|
||||
if (!$result) {
|
||||
Log::error($database, 'update_020500', __LINE__, 'Could not update database (' . $database->error . ')');
|
||||
Log::error($database, 'update_020505', __LINE__, 'Could not update database (' . $database->error . ')');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ class Album extends Module {
|
||||
$photo['nextPhoto'] = '';
|
||||
$photo['thumbUrl'] = LYCHEE_URL_UPLOADS_THUMB . $photo['thumbUrl'];
|
||||
|
||||
if ($photo['takestamp']!=='0') {
|
||||
if (isset($photo['takestamp'])&&$photo['takestamp']!=='0') {
|
||||
$photo['cameraDate'] = 1;
|
||||
$photo['sysdate'] = date('d F Y', $photo['takestamp']);
|
||||
}
|
||||
|
@ -113,6 +113,10 @@ class Photo extends Module {
|
||||
}
|
||||
}
|
||||
|
||||
# Calculate checksum
|
||||
$checksum = sha1_file($path);
|
||||
if ($checksum===false) $checksum = '';
|
||||
|
||||
# Read infos
|
||||
$info = $this->getInfo($path);
|
||||
|
||||
@ -159,7 +163,7 @@ class Photo extends Module {
|
||||
'" . $albumID . "',
|
||||
'" . $public . "',
|
||||
'" . $star . "',
|
||||
'" . md5_file($path) . "');";
|
||||
'" . $checksum . "');";
|
||||
$result = $this->database->query($query);
|
||||
|
||||
if (!$result) {
|
||||
@ -407,7 +411,7 @@ class Photo extends Module {
|
||||
}
|
||||
|
||||
$photo['original_album'] = $photo['album'];
|
||||
$photo['album'] = $albumID;
|
||||
$photo['album'] = $albumID;
|
||||
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ function search($database, $settings, $term) {
|
||||
$result = $database->query("SELECT id, title, tags, public, star, album, thumbUrl FROM lychee_photos WHERE title like '%$term%' OR description like '%$term%' OR tags like '%$term%';");
|
||||
while($row = $result->fetch_assoc()) {
|
||||
$return['photos'][$row['id']] = $row;
|
||||
$return['photos'][$row['id']]['thumbUrl'] = LYCHEE_URL_UPLOADS_THUMB . $row['thumbUrl'];
|
||||
$return['photos'][$row['id']]['sysdate'] = date('d M. Y', substr($row['id'], 0, -4));
|
||||
}
|
||||
|
||||
@ -38,7 +39,7 @@ function search($database, $settings, $term) {
|
||||
$result2 = $database->query("SELECT thumbUrl FROM lychee_photos WHERE album = '" . $row->id . "' " . $settings['sorting'] . " LIMIT 0, 3;");
|
||||
$k = 0;
|
||||
while($row2 = $result2->fetch_object()){
|
||||
$return['albums'][$row->id]["thumb$k"] = $row2->thumbUrl;
|
||||
$return['albums'][$row->id]["thumb$k"] = LYCHEE_URL_UPLOADS_THUMB . $row2->thumbUrl;
|
||||
$k++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user