Merge branch 'master' of https://github.com/electerious/Lychee into uploader
Conflicts: assets/min/main.css assets/min/main.js assets/min/view.js
This commit is contained in:
commit
e4592190bc
@ -148,6 +148,9 @@
|
|||||||
.photo .overlay a {
|
.photo .overlay a {
|
||||||
margin: 155px 0px 5px 15px;
|
margin: 155px 0px 5px 15px;
|
||||||
}
|
}
|
||||||
|
.photo .overlay a span {
|
||||||
|
margin: 0px 5px 0px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Badges ------------------------------------------------*/
|
/* Badges ------------------------------------------------*/
|
||||||
.album .badge,
|
.album .badge,
|
||||||
@ -173,6 +176,10 @@
|
|||||||
.photo .badge.icon-share {
|
.photo .badge.icon-share {
|
||||||
padding: 12px 6px 3px 8px;
|
padding: 12px 6px 3px 8px;
|
||||||
}
|
}
|
||||||
|
.album .badge.icon-time,
|
||||||
|
.photo .badge.icon-time {
|
||||||
|
padding: 12px 8px 3px 9px;
|
||||||
|
}
|
||||||
.album .badge::after,
|
.album .badge::after,
|
||||||
.photo .badge::after {
|
.photo .badge::after {
|
||||||
content: "";
|
content: "";
|
||||||
@ -195,6 +202,10 @@
|
|||||||
.photo .badge.icon-share::after {
|
.photo .badge.icon-share::after {
|
||||||
margin-left: -31px;
|
margin-left: -31px;
|
||||||
}
|
}
|
||||||
|
.album .badge.icon-time::after,
|
||||||
|
.photo .badge.icon-time::after {
|
||||||
|
margin-left: -29px;
|
||||||
|
}
|
||||||
.album .badge.icon-reorder::after {
|
.album .badge.icon-reorder::after {
|
||||||
margin-left: -30px;
|
margin-left: -30px;
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
#infobox .edit {
|
#infobox .edit {
|
||||||
display: inline;
|
display: inline;
|
||||||
|
@ -18,6 +18,7 @@ album = {
|
|||||||
else id = $(".album:hover, .album.active").attr("data-id");
|
else id = $(".album:hover, .album.active").attr("data-id");
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
|
if (!id) id = $(".album:hover, .album.active").attr("data-id");
|
||||||
if (!id) id = $(".photo:hover, .photo.active").attr("data-album-id");
|
if (!id) id = $(".photo:hover, .photo.active").attr("data-album-id");
|
||||||
|
|
||||||
if (id) return id;
|
if (id) return id;
|
||||||
@ -36,7 +37,7 @@ album = {
|
|||||||
|
|
||||||
if (!refresh) {
|
if (!refresh) {
|
||||||
loadingBar.show();
|
loadingBar.show();
|
||||||
lychee.animate(".album, .photo", "contentZoomOut");
|
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomOut");
|
||||||
lychee.animate(".divider", "fadeOut");
|
lychee.animate(".divider", "fadeOut");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +74,7 @@ album = {
|
|||||||
view.album.init();
|
view.album.init();
|
||||||
|
|
||||||
if (!refresh) {
|
if (!refresh) {
|
||||||
lychee.animate(".album, .photo", "contentZoomIn");
|
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
||||||
view.header.mode("album");
|
view.header.mode("album");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,8 +88,7 @@ album = {
|
|||||||
|
|
||||||
parse: function(photo) {
|
parse: function(photo) {
|
||||||
|
|
||||||
if (photo&&photo.thumbUrl) photo.thumbUrl = lychee.upload_path_thumb + photo.thumbUrl;
|
if (!album.json.title) album.json.title = "Untitled";
|
||||||
else if (!album.json.title) album.json.title = "Untitled";
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -201,6 +201,7 @@ album = {
|
|||||||
// Get old title if only one album is selected
|
// Get old title if only one album is selected
|
||||||
if (album.json) oldTitle = album.json.title;
|
if (album.json) oldTitle = album.json.title;
|
||||||
else if (albums.json) oldTitle = albums.json.content[albumIDs].title;
|
else if (albums.json) oldTitle = albums.json.content[albumIDs].title;
|
||||||
|
if (!oldTitle) oldTitle = "";
|
||||||
oldTitle = oldTitle.replace("'", "'");
|
oldTitle = oldTitle.replace("'", "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ albums = {
|
|||||||
durationTime,
|
durationTime,
|
||||||
waitTime;
|
waitTime;
|
||||||
|
|
||||||
lychee.animate(".album, .photo", "contentZoomOut");
|
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomOut");
|
||||||
lychee.animate(".divider", "fadeOut");
|
lychee.animate(".divider", "fadeOut");
|
||||||
|
|
||||||
startTime = new Date().getTime();
|
startTime = new Date().getTime();
|
||||||
@ -53,6 +53,16 @@ albums = {
|
|||||||
thumb2: data.publicThumb2
|
thumb2: data.publicThumb2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
data.recentAlbum = {
|
||||||
|
id: "r",
|
||||||
|
title: "Recent",
|
||||||
|
sysdate: data.recentNum + " photos",
|
||||||
|
recent: 1,
|
||||||
|
thumb0: data.recentThumb0,
|
||||||
|
thumb1: data.recentThumb1,
|
||||||
|
thumb2: data.recentThumb2
|
||||||
|
};
|
||||||
|
|
||||||
albums.json = data;
|
albums.json = data;
|
||||||
|
|
||||||
durationTime = (new Date().getTime() - startTime);
|
durationTime = (new Date().getTime() - startTime);
|
||||||
@ -64,7 +74,7 @@ albums = {
|
|||||||
|
|
||||||
view.header.mode("albums");
|
view.header.mode("albums");
|
||||||
view.albums.init();
|
view.albums.init();
|
||||||
lychee.animate(".album, .photo", "contentZoomIn");
|
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
||||||
|
|
||||||
}, waitTime);
|
}, waitTime);
|
||||||
|
|
||||||
@ -79,9 +89,9 @@ albums = {
|
|||||||
album.thumb1 = "assets/img/password.svg";
|
album.thumb1 = "assets/img/password.svg";
|
||||||
album.thumb2 = "assets/img/password.svg";
|
album.thumb2 = "assets/img/password.svg";
|
||||||
} else {
|
} else {
|
||||||
if (album.thumb0) album.thumb0 = lychee.upload_path_thumb + album.thumb0; else album.thumb0 = "assets/img/no_images.svg";
|
if (!album.thumb0) album.thumb0 = "assets/img/no_images.svg";
|
||||||
if (album.thumb1) album.thumb1 = lychee.upload_path_thumb + album.thumb1; else album.thumb1 = "assets/img/no_images.svg";
|
if (!album.thumb1) album.thumb1 = "assets/img/no_images.svg";
|
||||||
if (album.thumb2) album.thumb2 = lychee.upload_path_thumb + album.thumb2; else album.thumb2 = "assets/img/no_images.svg";
|
if (!album.thumb2) album.thumb2 = "assets/img/no_images.svg";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -54,9 +54,10 @@ build = {
|
|||||||
album += "<a>" + albumJSON.sysdate + "</a>";
|
album += "<a>" + albumJSON.sysdate + "</a>";
|
||||||
album += "</div>";
|
album += "</div>";
|
||||||
|
|
||||||
if(!lychee.publicMode&&albumJSON.star==1) album += "<a class='badge red icon-star'></a>";
|
if(!lychee.publicMode&&albumJSON.star===1) album += "<a class='badge red icon-star'></a>";
|
||||||
if(!lychee.publicMode&&albumJSON.public==1) album += "<a class='badge red icon-share'></a>";
|
if(!lychee.publicMode&&albumJSON.public===1) album += "<a class='badge red icon-share'></a>";
|
||||||
if(!lychee.publicMode&&albumJSON.unsorted==1) album += "<a class='badge red icon-reorder'></a>";
|
if(!lychee.publicMode&&albumJSON.unsorted===1) album += "<a class='badge red icon-reorder'></a>";
|
||||||
|
if(!lychee.publicMode&&albumJSON.recent===1) album += "<a class='badge red icon-time'></a>";
|
||||||
|
|
||||||
album += "</div>";
|
album += "</div>";
|
||||||
|
|
||||||
@ -81,7 +82,13 @@ build = {
|
|||||||
photo += "<img src='" + photoJSON.thumbUrl + "' width='200' height='200' alt='thumb'>";
|
photo += "<img src='" + photoJSON.thumbUrl + "' width='200' height='200' alt='thumb'>";
|
||||||
photo += "<div class='overlay'>";
|
photo += "<div class='overlay'>";
|
||||||
photo += "<h1 title='" + longTitle + "'>" + title + "</h1>";
|
photo += "<h1 title='" + longTitle + "'>" + title + "</h1>";
|
||||||
photo += "<a>" + photoJSON.sysdate + "</a>";
|
|
||||||
|
if (photoJSON.cameraDate==1) {
|
||||||
|
photo += "<a><span class='icon-camera' title='Photo Date'></span>" + photoJSON.sysdate + "</a>";
|
||||||
|
} else {
|
||||||
|
photo += "<a>" + photoJSON.sysdate + "</a>";
|
||||||
|
}
|
||||||
|
|
||||||
photo += "</div>";
|
photo += "</div>";
|
||||||
|
|
||||||
if (photoJSON.star==1) photo += "<a class='badge red icon-star'></a>";
|
if (photoJSON.star==1) photo += "<a class='badge red icon-star'></a>";
|
||||||
|
@ -114,7 +114,7 @@ contextMenu = {
|
|||||||
mouse_y = e.pageY - $(document).scrollTop(),
|
mouse_y = e.pageY - $(document).scrollTop(),
|
||||||
items;
|
items;
|
||||||
|
|
||||||
if (albumID==="0"||albumID==="f"||albumID==="s") return false;
|
if (albumID==="0"||albumID==="f"||albumID==="s"||albumID==="r") return false;
|
||||||
|
|
||||||
contextMenu.fns = [
|
contextMenu.fns = [
|
||||||
function() { album.setTitle([albumID]) },
|
function() { album.setTitle([albumID]) },
|
||||||
|
@ -8,17 +8,14 @@
|
|||||||
var lychee = {
|
var lychee = {
|
||||||
|
|
||||||
title: "",
|
title: "",
|
||||||
version: "2.5 rc1",
|
version: "2.5.5",
|
||||||
version_code: "020500",
|
version_code: "020505",
|
||||||
|
|
||||||
api_path: "php/api.php",
|
api_path: "php/api.php",
|
||||||
update_path: "http://lychee.electerious.com/version/index.php",
|
update_path: "http://lychee.electerious.com/version/index.php",
|
||||||
updateURL: "https://github.com/electerious/Lychee",
|
updateURL: "https://github.com/electerious/Lychee",
|
||||||
website: "http://lychee.electerious.com",
|
website: "http://lychee.electerious.com",
|
||||||
|
|
||||||
upload_path_thumb: "uploads/thumb/",
|
|
||||||
upload_path_big: "uploads/big/",
|
|
||||||
|
|
||||||
publicMode: false,
|
publicMode: false,
|
||||||
viewMode: false,
|
viewMode: false,
|
||||||
debugMode: false,
|
debugMode: false,
|
||||||
|
@ -135,7 +135,7 @@ multiselect = {
|
|||||||
|
|
||||||
id = $(this).data('id');
|
id = $(this).data('id');
|
||||||
|
|
||||||
if (id!=='0'&&id!==0&&id!=='f'&&id!=='s'&&id!==null&id!==undefined) {
|
if (id!=='0'&&id!==0&&id!=='f'&&id!=='s'&&id!=='r'&&id!==null&id!==undefined) {
|
||||||
|
|
||||||
ids.push(id);
|
ids.push(id);
|
||||||
$(this).addClass('active');
|
$(this).addClass('active');
|
||||||
|
@ -52,7 +52,6 @@ photo = {
|
|||||||
parse: function() {
|
parse: function() {
|
||||||
|
|
||||||
if (!photo.json.title) photo.json.title = "Untitled";
|
if (!photo.json.title) photo.json.title = "Untitled";
|
||||||
photo.json.url = lychee.upload_path_big + photo.json.url;
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ search = {
|
|||||||
|
|
||||||
$(".no_content").remove();
|
$(".no_content").remove();
|
||||||
|
|
||||||
lychee.animate(".album, .photo", "contentZoomOut");
|
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomOut");
|
||||||
lychee.animate(".divider", "fadeOut");
|
lychee.animate(".divider", "fadeOut");
|
||||||
|
|
||||||
search.code = md5(code);
|
search.code = md5(code);
|
||||||
@ -59,7 +59,7 @@ search = {
|
|||||||
if (code==="error") $("body").append(build.no_content("search"));
|
if (code==="error") $("body").append(build.no_content("search"));
|
||||||
else {
|
else {
|
||||||
lychee.content.html(code);
|
lychee.content.html(code);
|
||||||
lychee.animate(".album, .photo", "contentZoomIn");
|
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
||||||
$("img[data-type!='svg']").retina();
|
$("img[data-type!='svg']").retina();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,12 @@ search = {
|
|||||||
|
|
||||||
if (search.code!=="") {
|
if (search.code!=="") {
|
||||||
|
|
||||||
|
// Trash data
|
||||||
|
albums.json = null;
|
||||||
|
album.json = null;
|
||||||
|
photo.json = null;
|
||||||
search.code = "";
|
search.code = "";
|
||||||
|
|
||||||
lychee.animate(".divider", "fadeOut");
|
lychee.animate(".divider", "fadeOut");
|
||||||
albums.load();
|
albums.load();
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ view = {
|
|||||||
$("#tools_albums, #tools_photo").hide();
|
$("#tools_albums, #tools_photo").hide();
|
||||||
$("#tools_album").show();
|
$("#tools_album").show();
|
||||||
album.json.content === false ? $("#button_archive").hide() : $("#button_archive").show();
|
album.json.content === false ? $("#button_archive").hide() : $("#button_archive").show();
|
||||||
if (albumID==="s"||albumID==="f") {
|
if (albumID==="s"||albumID==="f"||albumID==="r") {
|
||||||
$("#button_info_album, #button_trash_album, #button_share_album").hide();
|
$("#button_info_album, #button_trash_album, #button_share_album").hide();
|
||||||
} else if (albumID==="0") {
|
} else if (albumID==="0") {
|
||||||
$("#button_info_album, #button_share_album").hide();
|
$("#button_info_album, #button_share_album").hide();
|
||||||
@ -130,7 +130,8 @@ view = {
|
|||||||
albums.parse(albums.json.unsortedAlbum);
|
albums.parse(albums.json.unsortedAlbum);
|
||||||
albums.parse(albums.json.publicAlbum);
|
albums.parse(albums.json.publicAlbum);
|
||||||
albums.parse(albums.json.starredAlbum);
|
albums.parse(albums.json.starredAlbum);
|
||||||
if (!lychee.publicMode) smartData = build.divider("Smart Albums") + build.album(albums.json.unsortedAlbum) + build.album(albums.json.starredAlbum) + build.album(albums.json.publicAlbum);
|
albums.parse(albums.json.recentAlbum);
|
||||||
|
if (!lychee.publicMode) smartData = build.divider("Smart Albums") + build.album(albums.json.unsortedAlbum) + build.album(albums.json.starredAlbum) + build.album(albums.json.publicAlbum) + build.album(albums.json.recentAlbum);
|
||||||
|
|
||||||
/* Albums */
|
/* Albums */
|
||||||
if (albums.json.content) {
|
if (albums.json.content) {
|
||||||
@ -216,6 +217,9 @@ view = {
|
|||||||
case "s":
|
case "s":
|
||||||
lychee.setTitle("Public", false);
|
lychee.setTitle("Public", false);
|
||||||
break;
|
break;
|
||||||
|
case "r":
|
||||||
|
lychee.setTitle("Recent", false);
|
||||||
|
break;
|
||||||
case "0":
|
case "0":
|
||||||
lychee.setTitle("Unsorted", false);
|
lychee.setTitle("Unsorted", false);
|
||||||
break;
|
break;
|
||||||
@ -242,7 +246,6 @@ view = {
|
|||||||
var photosData = "";
|
var photosData = "";
|
||||||
|
|
||||||
$.each(album.json.content, function() {
|
$.each(album.json.content, function() {
|
||||||
album.parse(this);
|
|
||||||
photosData += build.photo(this);
|
photosData += build.photo(this);
|
||||||
});
|
});
|
||||||
lychee.content.html(photosData);
|
lychee.content.html(photosData);
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,6 +1,15 @@
|
|||||||
|
## v2.5.5
|
||||||
|
|
||||||
|
Released July 5, 2014
|
||||||
|
|
||||||
|
- `New` Smart Album "Recent"
|
||||||
|
- `New` Checksum of photo in database (#48)
|
||||||
|
- `New` Show takedate in photo-overlay (when available)
|
||||||
|
- `Improved` Permission check when running with the same UID (#174)
|
||||||
|
|
||||||
## v2.5
|
## v2.5
|
||||||
|
|
||||||
Released -
|
Released June 24, 2014
|
||||||
|
|
||||||
- `New` Swipe gestures on mobile devices
|
- `New` Swipe gestures on mobile devices
|
||||||
- `New` Plugin-System
|
- `New` Plugin-System
|
||||||
|
13
docs/FAQ.md
13
docs/FAQ.md
@ -18,12 +18,12 @@ If possible, change these settings directly in your `php.ini`. We recommend to i
|
|||||||
#### Which browsers are supported?
|
#### Which browsers are supported?
|
||||||
Lychee supports the latest versions of Google Chrome, Apple Safari, Mozilla Firefox and Opera. Photos you share with others can be viewed from every browser.
|
Lychee supports the latest versions of Google Chrome, Apple Safari, Mozilla Firefox and Opera. Photos you share with others can be viewed from every browser.
|
||||||
|
|
||||||
#### How can I set thumbnails for my albums?
|
|
||||||
Thumbnails are chosen automatically by the photos you have starred and in the order you uploaded them. Star a photo inside an album to set it as a thumbnail.
|
|
||||||
|
|
||||||
#### What is new?
|
#### What is new?
|
||||||
Take a look at the [Changelog](Changelog.md) to see what's new.
|
Take a look at the [Changelog](Changelog.md) to see what's new.
|
||||||
|
|
||||||
|
#### How can I set thumbnails for my albums?
|
||||||
|
Thumbnails are chosen automatically by the photos you have starred and in the order you uploaded them. Star a photo inside an album to set it as a thumbnail.
|
||||||
|
|
||||||
#### How can I backup my installation?
|
#### How can I backup my installation?
|
||||||
To backup your Lychee installation you need to do the following steps:
|
To backup your Lychee installation you need to do the following steps:
|
||||||
|
|
||||||
@ -42,5 +42,8 @@ No. Lychee has it's own folder-structure and database. Please upload or import a
|
|||||||
#### Can I upload videos?
|
#### Can I upload videos?
|
||||||
No. Video support is not planned.
|
No. Video support is not planned.
|
||||||
|
|
||||||
#### What's the advantage of buying Lychee?
|
#### Is it possible to create multiple users?
|
||||||
Lychee is completely free to use for personal usage. However, if you like Lychee or want to use in commercially, you need to buy Lychee from [our site](http://lychee.electerious.com). I hope you appreciate my work and support further development by buying a license.
|
[No, not yet.](https://github.com/electerious/Lychee/issues/132)
|
||||||
|
|
||||||
|
#### Blank screen when viewing a photo using iOS
|
||||||
|
There's a problem with images compressed by ImageOptim. [Read more.](https://github.com/electerious/Lychee/issues/175#issuecomment-47403992)
|
||||||
|
@ -61,7 +61,7 @@ if (!empty($_POST['function'])||!empty($_GET['function'])) {
|
|||||||
# Validate parameters
|
# Validate parameters
|
||||||
if (isset($_POST['albumIDs'])&&preg_match('/^[0-9\,]{1,}$/', $_POST['albumIDs'])!==1) exit('Error: Wrong parameter type for albumIDs!');
|
if (isset($_POST['albumIDs'])&&preg_match('/^[0-9\,]{1,}$/', $_POST['albumIDs'])!==1) exit('Error: Wrong parameter type for albumIDs!');
|
||||||
if (isset($_POST['photoIDs'])&&preg_match('/^[0-9\,]{1,}$/', $_POST['photoIDs'])!==1) exit('Error: Wrong parameter type for photoIDs!');
|
if (isset($_POST['photoIDs'])&&preg_match('/^[0-9\,]{1,}$/', $_POST['photoIDs'])!==1) exit('Error: Wrong parameter type for photoIDs!');
|
||||||
if (isset($_POST['albumID'])&&preg_match('/^[0-9sf]{1,}$/', $_POST['albumID'])!==1) exit('Error: Wrong parameter type for albumID!');
|
if (isset($_POST['albumID'])&&preg_match('/^[0-9sfr]{1,}$/', $_POST['albumID'])!==1) exit('Error: Wrong parameter type for albumID!');
|
||||||
if (isset($_POST['photoID'])&&preg_match('/^[0-9]{14}$/', $_POST['photoID'])!==1) exit('Error: Wrong parameter type for photoID!');
|
if (isset($_POST['photoID'])&&preg_match('/^[0-9]{14}$/', $_POST['photoID'])!==1) exit('Error: Wrong parameter type for photoID!');
|
||||||
|
|
||||||
# Function for switch statement
|
# Function for switch statement
|
||||||
|
@ -23,5 +23,6 @@ CREATE TABLE IF NOT EXISTS `lychee_photos` (
|
|||||||
`star` tinyint(1) NOT NULL,
|
`star` tinyint(1) NOT NULL,
|
||||||
`thumbUrl` varchar(50) NOT NULL,
|
`thumbUrl` varchar(50) NOT NULL,
|
||||||
`album` varchar(30) NOT NULL DEFAULT '0',
|
`album` varchar(30) NOT NULL DEFAULT '0',
|
||||||
|
`checksum` VARCHAR(100) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
|
25
php/database/update_020505.php
Normal file
25
php/database/update_020505.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
###
|
||||||
|
# @name Update to version 2.5.5
|
||||||
|
# @author Tobias Reich
|
||||||
|
# @copyright 2014 by Tobias Reich
|
||||||
|
###
|
||||||
|
|
||||||
|
# Add `checksum`
|
||||||
|
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 . ')');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set version
|
||||||
|
$result = $database->query("UPDATE lychee_settings SET value = '020505' WHERE `key` = 'version';");
|
||||||
|
if (!$result) {
|
||||||
|
Log::error($database, 'update_020505', __LINE__, 'Could not update database (' . $database->error . ')');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
@ -21,4 +21,8 @@ define('LYCHEE_PLUGINS', LYCHEE . 'plugins/');
|
|||||||
# Define files
|
# Define files
|
||||||
define('LYCHEE_CONFIG_FILE', LYCHEE_DATA . 'config.php');
|
define('LYCHEE_CONFIG_FILE', LYCHEE_DATA . 'config.php');
|
||||||
|
|
||||||
|
# Define urls
|
||||||
|
define('LYCHEE_URL_UPLOADS_THUMB', 'uploads/thumb/');
|
||||||
|
define('LYCHEE_URL_UPLOADS_BIG', 'uploads/big/');
|
||||||
|
|
||||||
?>
|
?>
|
@ -29,7 +29,7 @@ class Album extends Module {
|
|||||||
public function add($title = 'Untitled', $public = 0, $visible = 1) {
|
public function add($title = 'Untitled', $public = 0, $visible = 1) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database));
|
self::dependencies(isset($this->database));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -55,7 +55,7 @@ class Album extends Module {
|
|||||||
public function get() {
|
public function get() {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->settings, $this->albumIDs));
|
self::dependencies(isset($this->database, $this->settings, $this->albumIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -64,22 +64,26 @@ class Album extends Module {
|
|||||||
switch ($this->albumIDs) {
|
switch ($this->albumIDs) {
|
||||||
|
|
||||||
case 'f': $return['public'] = false;
|
case 'f': $return['public'] = false;
|
||||||
$query = "SELECT id, title, tags, public, star, album, thumbUrl FROM lychee_photos WHERE star = 1 " . $this->settings['sorting'];
|
$query = "SELECT id, title, tags, public, star, album, thumbUrl, takestamp FROM lychee_photos WHERE star = 1 " . $this->settings['sorting'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's': $return['public'] = false;
|
case 's': $return['public'] = false;
|
||||||
$query = "SELECT id, title, tags, public, star, album, thumbUrl FROM lychee_photos WHERE public = 1 " . $this->settings['sorting'];
|
$query = "SELECT id, title, tags, public, star, album, thumbUrl, takestamp FROM lychee_photos WHERE public = 1 " . $this->settings['sorting'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'r': $return['public'] = false;
|
||||||
|
$query = "SELECT id, title, tags, public, star, album, thumbUrl, takestamp FROM lychee_photos WHERE LEFT(id, 10) >= unix_timestamp(DATE_SUB(NOW(), INTERVAL 1 DAY)) " . $this->settings['sorting'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '0': $return['public'] = false;
|
case '0': $return['public'] = false;
|
||||||
$query = "SELECT id, title, tags, public, star, album, thumbUrl FROM lychee_photos WHERE album = 0 " . $this->settings['sorting'];
|
$query = "SELECT id, title, tags, public, star, album, thumbUrl, takestamp FROM lychee_photos WHERE album = 0 " . $this->settings['sorting'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: $albums = $this->database->query("SELECT * FROM lychee_albums WHERE id = '$this->albumIDs' LIMIT 1;");
|
default: $albums = $this->database->query("SELECT * FROM lychee_albums WHERE id = '$this->albumIDs' LIMIT 1;");
|
||||||
$return = $albums->fetch_assoc();
|
$return = $albums->fetch_assoc();
|
||||||
$return['sysdate'] = date('d M. Y', $return['sysstamp']);
|
$return['sysdate'] = date('d M. Y', $return['sysstamp']);
|
||||||
$return['password'] = ($return['password']=='' ? false : true);
|
$return['password'] = ($return['password']=='' ? false : true);
|
||||||
$query = "SELECT id, title, tags, public, star, album, thumbUrl FROM lychee_photos WHERE album = '$this->albumIDs' " . $this->settings['sorting'];
|
$query = "SELECT id, title, tags, public, star, album, thumbUrl, takestamp FROM lychee_photos WHERE album = '$this->albumIDs' " . $this->settings['sorting'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -92,7 +96,13 @@ class Album extends Module {
|
|||||||
# Parse
|
# Parse
|
||||||
$photo['sysdate'] = date('d F Y', substr($photo['id'], 0, -4));
|
$photo['sysdate'] = date('d F Y', substr($photo['id'], 0, -4));
|
||||||
$photo['previousPhoto'] = $previousPhotoID;
|
$photo['previousPhoto'] = $previousPhotoID;
|
||||||
$photo['nextPhoto'] = '';
|
$photo['nextPhoto'] = '';
|
||||||
|
$photo['thumbUrl'] = LYCHEE_URL_UPLOADS_THUMB . $photo['thumbUrl'];
|
||||||
|
|
||||||
|
if ($photo['takestamp']!=='0') {
|
||||||
|
$photo['cameraDate'] = 1;
|
||||||
|
$photo['sysdate'] = date('d F Y', $photo['takestamp']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($previousPhotoID!=='') $return['content'][$previousPhotoID]['nextPhoto'] = $photo['id'];
|
if ($previousPhotoID!=='') $return['content'][$previousPhotoID]['nextPhoto'] = $photo['id'];
|
||||||
$previousPhotoID = $photo['id'];
|
$previousPhotoID = $photo['id'];
|
||||||
@ -135,7 +145,7 @@ class Album extends Module {
|
|||||||
public function getAll($public) {
|
public function getAll($public) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->settings, $public));
|
self::dependencies(isset($this->database, $this->settings, $public));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -166,7 +176,7 @@ class Album extends Module {
|
|||||||
# For each thumb
|
# For each thumb
|
||||||
$k = 0;
|
$k = 0;
|
||||||
while ($thumb = $thumbs->fetch_object()) {
|
while ($thumb = $thumbs->fetch_object()) {
|
||||||
$album["thumb$k"] = $thumb->thumbUrl;
|
$album["thumb$k"] = LYCHEE_URL_UPLOADS_THUMB . $thumb->thumbUrl;
|
||||||
$k++;
|
$k++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,14 +200,14 @@ class Album extends Module {
|
|||||||
private function getSmartInfo() {
|
private function getSmartInfo() {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->settings));
|
self::dependencies(isset($this->database, $this->settings));
|
||||||
|
|
||||||
# Unsorted
|
# Unsorted
|
||||||
$unsorted = $this->database->query("SELECT thumbUrl FROM lychee_photos WHERE album = 0 " . $this->settings['sorting']);
|
$unsorted = $this->database->query("SELECT thumbUrl FROM lychee_photos WHERE album = 0 " . $this->settings['sorting']);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while($row = $unsorted->fetch_object()) {
|
while($row = $unsorted->fetch_object()) {
|
||||||
if ($i<3) {
|
if ($i<3) {
|
||||||
$return["unsortedThumb$i"] = $row->thumbUrl;
|
$return["unsortedThumb$i"] = LYCHEE_URL_UPLOADS_THUMB . $row->thumbUrl;
|
||||||
$i++;
|
$i++;
|
||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
@ -208,7 +218,7 @@ class Album extends Module {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while($row2 = $public->fetch_object()) {
|
while($row2 = $public->fetch_object()) {
|
||||||
if ($i<3) {
|
if ($i<3) {
|
||||||
$return["publicThumb$i"] = $row2->thumbUrl;
|
$return["publicThumb$i"] = LYCHEE_URL_UPLOADS_THUMB . $row2->thumbUrl;
|
||||||
$i++;
|
$i++;
|
||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
@ -219,12 +229,23 @@ class Album extends Module {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while($row3 = $starred->fetch_object()) {
|
while($row3 = $starred->fetch_object()) {
|
||||||
if ($i<3) {
|
if ($i<3) {
|
||||||
$return["starredThumb$i"] = $row3->thumbUrl;
|
$return["starredThumb$i"] = LYCHEE_URL_UPLOADS_THUMB . $row3->thumbUrl;
|
||||||
$i++;
|
$i++;
|
||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
$return['starredNum'] = $starred->num_rows;
|
$return['starredNum'] = $starred->num_rows;
|
||||||
|
|
||||||
|
# Recent
|
||||||
|
$recent = $this->database->query("SELECT thumbUrl FROM lychee_photos WHERE LEFT(id, 10) >= unix_timestamp(DATE_SUB(NOW(), INTERVAL 1 DAY)) " . $this->settings['sorting']);
|
||||||
|
$i = 0;
|
||||||
|
while($row3 = $recent->fetch_object()) {
|
||||||
|
if ($i<3) {
|
||||||
|
$return["recentThumb$i"] = LYCHEE_URL_UPLOADS_THUMB . $row3->thumbUrl;
|
||||||
|
$i++;
|
||||||
|
} else break;
|
||||||
|
}
|
||||||
|
$return['recentNum'] = $recent->num_rows;
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -232,7 +253,7 @@ class Album extends Module {
|
|||||||
public function getArchive() {
|
public function getArchive() {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->albumIDs));
|
self::dependencies(isset($this->database, $this->albumIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -253,6 +274,10 @@ class Album extends Module {
|
|||||||
$photos = "SELECT title, url FROM lychee_photos WHERE star = '1';";
|
$photos = "SELECT title, url FROM lychee_photos WHERE star = '1';";
|
||||||
$zipTitle = 'Starred';
|
$zipTitle = 'Starred';
|
||||||
break;
|
break;
|
||||||
|
case 'r':
|
||||||
|
$photos = "SELECT title, url FROM lychee_photos WHERE LEFT(id, 10) >= unix_timestamp(DATE_SUB(NOW(), INTERVAL 1 DAY));";
|
||||||
|
$zipTitle = 'Recent';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$photos = "SELECT title, url FROM lychee_photos WHERE album = '$this->albumIDs';";
|
$photos = "SELECT title, url FROM lychee_photos WHERE album = '$this->albumIDs';";
|
||||||
$zipTitle = 'Unsorted';
|
$zipTitle = 'Unsorted';
|
||||||
@ -346,7 +371,7 @@ class Album extends Module {
|
|||||||
public function setTitle($title = 'Untitled') {
|
public function setTitle($title = 'Untitled') {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->albumIDs));
|
self::dependencies(isset($this->database, $this->albumIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -371,7 +396,7 @@ class Album extends Module {
|
|||||||
public function setDescription($description = '') {
|
public function setDescription($description = '') {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->albumIDs));
|
self::dependencies(isset($this->database, $this->albumIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -397,7 +422,7 @@ class Album extends Module {
|
|||||||
public function getPublic() {
|
public function getPublic() {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->albumIDs));
|
self::dependencies(isset($this->database, $this->albumIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -419,7 +444,7 @@ class Album extends Module {
|
|||||||
public function setPublic($password) {
|
public function setPublic($password) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->albumIDs));
|
self::dependencies(isset($this->database, $this->albumIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -463,7 +488,7 @@ class Album extends Module {
|
|||||||
public function setPassword($password) {
|
public function setPassword($password) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->albumIDs));
|
self::dependencies(isset($this->database, $this->albumIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -497,7 +522,7 @@ class Album extends Module {
|
|||||||
public function checkPassword($password) {
|
public function checkPassword($password) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->albumIDs));
|
self::dependencies(isset($this->database, $this->albumIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -518,7 +543,7 @@ class Album extends Module {
|
|||||||
public function delete($albumIDs) {
|
public function delete($albumIDs) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->albumIDs));
|
self::dependencies(isset($this->database, $this->albumIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
|
@ -46,7 +46,8 @@ class Database extends Module {
|
|||||||
'020100', #2.1
|
'020100', #2.1
|
||||||
'020101', #2.1.1
|
'020101', #2.1.1
|
||||||
'020200', #2.2
|
'020200', #2.2
|
||||||
'020500' #2.5
|
'020500', #2.5
|
||||||
|
'020505' #2.5.5
|
||||||
);
|
);
|
||||||
|
|
||||||
# For each update
|
# For each update
|
||||||
|
@ -26,7 +26,7 @@ class Module {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dependencies($available = false) {
|
public static function dependencies($available = false) {
|
||||||
|
|
||||||
if ($available===false) exit('Error: Can not execute function. Missing parameters or variables.');
|
if ($available===false) exit('Error: Can not execute function. Missing parameters or variables.');
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class Photo extends Module {
|
|||||||
public function add($files, $albumID, $description = '', $tags = '') {
|
public function add($files, $albumID, $description = '', $tags = '') {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database));
|
self::dependencies(isset($this->database));
|
||||||
|
|
||||||
# Check permissions
|
# Check permissions
|
||||||
if (hasPermissions(LYCHEE_UPLOADS_BIG)===false||hasPermissions(LYCHEE_UPLOADS_THUMB)===false) {
|
if (hasPermissions(LYCHEE_UPLOADS_BIG)===false||hasPermissions(LYCHEE_UPLOADS_THUMB)===false) {
|
||||||
@ -68,6 +68,13 @@ class Photo extends Module {
|
|||||||
$albumID = 0;
|
$albumID = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'r':
|
||||||
|
# r for recent
|
||||||
|
$public = 0;
|
||||||
|
$star = 0;
|
||||||
|
$albumID = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$star = 0;
|
$star = 0;
|
||||||
$public = 0;
|
$public = 0;
|
||||||
@ -130,7 +137,7 @@ class Photo extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Save to DB
|
# Save to DB
|
||||||
$query = "INSERT INTO lychee_photos (id, title, url, description, tags, type, width, height, size, iso, aperture, make, model, shutter, focal, takestamp, thumbUrl, album, public, star)
|
$query = "INSERT INTO lychee_photos (id, title, url, description, tags, type, width, height, size, iso, aperture, make, model, shutter, focal, takestamp, thumbUrl, album, public, star, checksum)
|
||||||
VALUES (
|
VALUES (
|
||||||
'" . $id . "',
|
'" . $id . "',
|
||||||
'" . $info['title'] . "',
|
'" . $info['title'] . "',
|
||||||
@ -151,7 +158,8 @@ class Photo extends Module {
|
|||||||
'" . md5($id) . ".jpeg',
|
'" . md5($id) . ".jpeg',
|
||||||
'" . $albumID . "',
|
'" . $albumID . "',
|
||||||
'" . $public . "',
|
'" . $public . "',
|
||||||
'" . $star . "');";
|
'" . $star . "',
|
||||||
|
'" . md5_file($path) . "');";
|
||||||
$result = $this->database->query($query);
|
$result = $this->database->query($query);
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
@ -171,7 +179,7 @@ class Photo extends Module {
|
|||||||
private function createThumb($url, $filename, $width = 200, $height = 200) {
|
private function createThumb($url, $filename, $width = 200, $height = 200) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->settings, $url, $filename));
|
self::dependencies(isset($this->database, $this->settings, $url, $filename));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -255,7 +263,7 @@ class Photo extends Module {
|
|||||||
private function adjustFile($path, $info) {
|
private function adjustFile($path, $info) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($path, $info));
|
self::dependencies(isset($path, $info));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -369,7 +377,7 @@ class Photo extends Module {
|
|||||||
public function get($albumID) {
|
public function get($albumID) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -382,6 +390,9 @@ class Photo extends Module {
|
|||||||
$photo['sysdate'] = date('d M. Y', substr($photo['id'], 0, -4));
|
$photo['sysdate'] = date('d M. Y', substr($photo['id'], 0, -4));
|
||||||
if (strlen($photo['takestamp'])>1) $photo['takedate'] = date('d M. Y', $photo['takestamp']);
|
if (strlen($photo['takestamp'])>1) $photo['takedate'] = date('d M. Y', $photo['takestamp']);
|
||||||
|
|
||||||
|
# Parse url
|
||||||
|
$photo['url'] = LYCHEE_URL_UPLOADS_BIG . $photo['url'];
|
||||||
|
|
||||||
if ($albumID!='false') {
|
if ($albumID!='false') {
|
||||||
|
|
||||||
if ($photo['album']!=0) {
|
if ($photo['album']!=0) {
|
||||||
@ -410,7 +421,7 @@ class Photo extends Module {
|
|||||||
private function getInfo($url) {
|
private function getInfo($url) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $url));
|
self::dependencies(isset($this->database, $url));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -504,7 +515,7 @@ class Photo extends Module {
|
|||||||
public function getArchive() {
|
public function getArchive() {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -541,7 +552,7 @@ class Photo extends Module {
|
|||||||
public function setTitle($title) {
|
public function setTitle($title) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -566,7 +577,7 @@ class Photo extends Module {
|
|||||||
public function setDescription($description) {
|
public function setDescription($description) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -592,7 +603,7 @@ class Photo extends Module {
|
|||||||
public function setStar() {
|
public function setStar() {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -629,7 +640,7 @@ class Photo extends Module {
|
|||||||
public function getPublic($password) {
|
public function getPublic($password) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -657,7 +668,7 @@ class Photo extends Module {
|
|||||||
public function setPublic() {
|
public function setPublic() {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -686,7 +697,7 @@ class Photo extends Module {
|
|||||||
function setAlbum($albumID) {
|
function setAlbum($albumID) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -708,7 +719,7 @@ class Photo extends Module {
|
|||||||
public function setTags($tags) {
|
public function setTags($tags) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -738,7 +749,7 @@ class Photo extends Module {
|
|||||||
public function delete() {
|
public function delete() {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $this->photoIDs));
|
self::dependencies(isset($this->database, $this->photoIDs));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
|
@ -25,7 +25,7 @@ class Session extends Module {
|
|||||||
public function init($database, $dbName, $public, $version) {
|
public function init($database, $dbName, $public, $version) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->settings, $public, $version));
|
self::dependencies(isset($this->settings, $public, $version));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
@ -75,7 +75,7 @@ class Session extends Module {
|
|||||||
public function login($username, $password) {
|
public function login($username, $password) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->settings, $username, $password));
|
self::dependencies(isset($this->settings, $username, $password));
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
$this->plugins(__METHOD__, 0, func_get_args());
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
|
@ -24,7 +24,7 @@ class Settings extends Module {
|
|||||||
public function get() {
|
public function get() {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database));
|
self::dependencies(isset($this->database));
|
||||||
|
|
||||||
# Execute query
|
# Execute query
|
||||||
$settings = $this->database->query('SELECT * FROM lychee_settings;');
|
$settings = $this->database->query('SELECT * FROM lychee_settings;');
|
||||||
@ -42,7 +42,7 @@ class Settings extends Module {
|
|||||||
public function setLogin($oldPassword = '', $username, $password) {
|
public function setLogin($oldPassword = '', $username, $password) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database));
|
self::dependencies(isset($this->database));
|
||||||
|
|
||||||
# Load settings
|
# Load settings
|
||||||
$settings = $this->get();
|
$settings = $this->get();
|
||||||
@ -66,7 +66,7 @@ class Settings extends Module {
|
|||||||
private function setUsername($username) {
|
private function setUsername($username) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database));
|
self::dependencies(isset($this->database));
|
||||||
|
|
||||||
# Parse
|
# Parse
|
||||||
$username = htmlentities($username);
|
$username = htmlentities($username);
|
||||||
@ -89,7 +89,7 @@ class Settings extends Module {
|
|||||||
private function setPassword($password) {
|
private function setPassword($password) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database));
|
self::dependencies(isset($this->database));
|
||||||
|
|
||||||
$password = get_hashed_password($password);
|
$password = get_hashed_password($password);
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ class Settings extends Module {
|
|||||||
public function setDropboxKey($key) {
|
public function setDropboxKey($key) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $key));
|
self::dependencies(isset($this->database, $key));
|
||||||
|
|
||||||
if (strlen($key)<1||strlen($key)>50) {
|
if (strlen($key)<1||strlen($key)>50) {
|
||||||
Log::notice($this->database, __METHOD__, __LINE__, 'Dropbox key is either too short or too long');
|
Log::notice($this->database, __METHOD__, __LINE__, 'Dropbox key is either too short or too long');
|
||||||
@ -128,7 +128,7 @@ class Settings extends Module {
|
|||||||
public function setSorting($type, $order) {
|
public function setSorting($type, $order) {
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
$this->dependencies(isset($this->database, $type, $order));
|
self::dependencies(isset($this->database, $type, $order));
|
||||||
|
|
||||||
$sorting = 'ORDER BY ';
|
$sorting = 'ORDER BY ';
|
||||||
|
|
||||||
|
@ -120,6 +120,9 @@ function get_hashed_password($password) {
|
|||||||
|
|
||||||
function hasPermissions($path, $permissions = '0777') {
|
function hasPermissions($path, $permissions = '0777') {
|
||||||
|
|
||||||
|
/* assume that if running with the same uid as the owner of the directory it's ok */
|
||||||
|
$stat = @stat($path);
|
||||||
|
if ($stat && ($stat['uid'] == getmyuid())) return true;
|
||||||
if (substr(sprintf('%o', @fileperms($path)), -4)!=$permissions) return false;
|
if (substr(sprintf('%o', @fileperms($path)), -4)!=$permissions) return false;
|
||||||
else return true;
|
else return true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user