Skip to content

Commit

Permalink
Merge pull request Aidenir#6 from electerious/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
qligier committed Apr 17, 2016
2 parents 45a5713 + 42fafb0 commit 55577e1
Show file tree
Hide file tree
Showing 40 changed files with 233 additions and 142 deletions.
2 changes: 1 addition & 1 deletion dist/main.css

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/main.js
100755 → 100644

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/view.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## v3.1.0

Released March ??, 2016
Released March 29, 2016

**Warning**: It's no longer possible to update from Lychee versions older than 2.7.

Expand All @@ -14,14 +14,19 @@ This updates includes a huge rewrite of the back-end. We are now using namespace

- `New` Empty titles for albums
- `New` Share albums as hidden so they are only viewable with a direct link (#27)
- `Improved` Error messages and log output
- `New` Log failed and successful login attempts (Thanks @qligier, #382 #246)
- `Improved` error messages and log output
- `Improved` The search shows albums above photos (#434)
- `Improved` Album id now based on the current microtime (#27)
- `Improved` Back-end modules and plugins
- `Improved` Database connect function and update mechanism
- `Improved` Default photo title now "Untitled"
- `Improved` Move to next photo after after moving a picture (#437)
- `Improved` Return to album overview when canceling album password input
- `Improved` URL import now accepts photo URLs containing "?" and ":" (Thanks @qligier, #482)
- `Improved` Replaced date by strftime to simplify date translations (Thanks @qligier, #461)
- `Fixed` Missing icons in Safari 9.1
- `Fixed` duplicate uploads (Thanks @qligier, #433)
- `Fixed` incorrect escaping when using backslashes
- `Fixed` session_start() after sending headers (#433)
- `Fixed` error when deleting last open photo in album
Expand Down
5 changes: 4 additions & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ Yes. Lychee uses ImageMagick when available.
There's a problem with images compressed by ImageOptim. [Read more.](https://github.com/electerious/Lychee/issues/175#issuecomment-47403992)

#### How to change the title of the site?
[#455](https://github.com/electerious/Lychee/issues/455)
[#455](https://github.com/electerious/Lychee/issues/455)

#### How to reset username and password?
Simply delete the whole `lychee_settings` table from the database. Lychee will regenerate it and ask you to enter a new username and password.
6 changes: 3 additions & 3 deletions php/Access/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static function addAlbumAction() {
Validator::required(isset($_POST['title']), __METHOD__);

$album = new Album(null);
Response::json($album->add($_POST['title']));
Response::json($album->add($_POST['title']), JSON_NUMERIC_CHECK);

}

Expand Down Expand Up @@ -231,7 +231,7 @@ private static function uploadAction() {
Validator::required(isset($_FILES, $_POST['albumID']), __METHOD__);

$photo = new Photo(null);
Response::json($photo->add($_FILES, $_POST['albumID']));
Response::json($photo->add($_FILES, $_POST['albumID']), JSON_NUMERIC_CHECK);

}

Expand All @@ -249,7 +249,7 @@ private static function importServerAction() {
Validator::required(isset($_POST['albumID'], $_POST['path']), __METHOD__);

$import = new Import();
echo $import->server($_POST['path'], $_POST['albumID']);
Response::json($import->server($_POST['path'], $_POST['albumID']));

}

Expand Down
2 changes: 1 addition & 1 deletion php/Access/Installation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private static function configCreateAction() {

Validator::required(isset($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']), __METHOD__);

echo Config::create($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']);
Response::json(Config::create($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']));

}

Expand Down
2 changes: 1 addition & 1 deletion php/Modules/Album.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct($albumIDs) {
}

/**
* @return integer|false ID of the created album.
* @return string|false ID of the created album.
*/
public function add($title = 'Untitled') {

Expand Down
2 changes: 1 addition & 1 deletion php/Modules/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function create($host, $user, $password, $name = 'lychee', $prefix
?>";

// Save file
if (file_put_contents(LYCHEE_CONFIG_FILE, $config)===false) return 'Warning: Could not create file!';
if (@file_put_contents(LYCHEE_CONFIG_FILE, $config)===false) return 'Warning: Could not create file!';

return true;

Expand Down
4 changes: 2 additions & 2 deletions php/Modules/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private function __construct($host, $user, $password, $name = 'lychee', $dbTable
$connection = self::connect($host, $user, $password);

// Check if the connection was successful
if ($connection===false) Response::error('' . $connection->connect_error);
if ($connection===false) Response::error($connection->connect_error);

if (self::setCharset($connection)===false) Response::error('Could not set database charset!');

Expand All @@ -81,7 +81,7 @@ private function __construct($host, $user, $password, $name = 'lychee', $dbTable
public static function connect($host = 'localhost', $user, $password) {

// Open a new connection to the MySQL server
$connection = new Mysqli($host, $user, $password);
$connection = @new Mysqli($host, $user, $password);

// Check if the connection was successful
if ($connection->connect_errno) return false;
Expand Down
4 changes: 2 additions & 2 deletions php/Modules/Photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct($photoIDs) {
* Creats new photo(s).
* Exits on error.
* Use $returnOnError if you want to handle errors by your own.
* @return boolean Returns true when successful.
* @return string|false ID of the added photo.
*/
public function add(array $files, $albumID = 0, $returnOnError = false) {

Expand Down Expand Up @@ -251,7 +251,7 @@ public function add(array $files, $albumID = 0, $returnOnError = false) {
// Call plugins
Plugins::get()->activate(__METHOD__, 1, func_get_args());

return true;
return $id;

}

Expand Down
8 changes: 4 additions & 4 deletions php/Modules/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ final class Response {

public static function warning($msg) {

exit('Warning: ' . $msg);
exit(json_encode('Warning: ' . $msg));

}

public static function error($msg) {

exit('Error: ' . $msg);
exit(json_encode('Error: ' . $msg));

}

public static function json($str) {
public static function json($str, $options = 0) {

exit(json_encode($str));
exit(json_encode($str, $options));

}

Expand Down
2 changes: 1 addition & 1 deletion php/database/update_030100.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
if ($result===false) Response::error('Could not adjust the length of the album id field!');

// Set version
// if (Database::setVersion($connection, '030100')===false) Response::error('Could not update version of database!');
if (Database::setVersion($connection, '030100')===false) Response::error('Could not update version of database!');

?>
3 changes: 2 additions & 1 deletion php/define.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
define('LYCHEE_URL_UPLOADS_MEDIUM', 'uploads/medium/');
define('LYCHEE_URL_UPLOADS_THUMB', 'uploads/thumb/');

function defineTablePrefix($dbTablePrefix = '') {
function defineTablePrefix($dbTablePrefix) {

// This part is wrapped into a function, because it needs to be called
// after the config-file has been loaded. Other defines are available
// before the config-file has been loaded.

// Parse table prefix
// Old users do not have the table prefix stored in their config-file
if (isset($dbTablePrefix)===false) $dbTablePrefix = '';
if ($dbTablePrefix!=='') $dbTablePrefix .= '_';

// Define tables
Expand Down
8 changes: 6 additions & 2 deletions php/helpers/generateID.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

/**
* @return string Generated ID.
*/
function generateID() {

// Generate id based on the current microtime
Expand All @@ -8,8 +11,9 @@ function generateID() {
// Ensure that the id has a length of 14 chars
while(strlen($id)<14) $id .= 0;

// Return the integer value of the id
return intval($id);
// Return id as a string. Don't convert the id to an integer
// as 14 digits are too big for 32bit PHP versions.
return $id;

}

Expand Down
1 change: 1 addition & 0 deletions src/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ paths.view = {
],
scripts: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/basiccontext/dist/basicContext.min.js',
'../dist/_view--javascript.js'
],
svg: [
Expand Down
Binary file modified src/images/apple-touch-icon-ipad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/apple-touch-icon-iphone-plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/apple-touch-icon-iphone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/images/no_cover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/images/no_images.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/images/password.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 62 additions & 8 deletions src/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
"dependencies": {
"babel-preset-es2015": "^6.6.0",
"basiccontext": "^3.5.1",
"basicmodal": "^3.3.3",
"basicmodal": "^3.3.4",
"gulp": "^3.9.1",
"gulp-autoprefixer": "3.1.0",
"gulp-babel": "^6.1.2",
"gulp-concat": "^2.6.0",
"gulp-inject": "^3.0.0",
"gulp-inject": "^4.0.0",
"gulp-load-plugins": "^1.2.0",
"gulp-minify-css": "^1.2.4",
"gulp-rimraf": "^0.2.0",
"gulp-sass": "^2.2.0",
"gulp-uglify": "^1.5.3",
"jquery": "^2.2.1",
"jquery": "^2.2.3",
"mousetrap": "^1.5.3"
}
}
Loading

0 comments on commit 55577e1

Please sign in to comment.