- Share whole albums - Public Mode - Import images via URL - New Share-Button - Improved Toolbar - Check for updates (see config.php) - ASC or DESC sorting (see config.php) - Download album fixed - Code optimizations (thanks @tibounise) - Changes and enhancements Update from version 1.0 or 1.1: 1. Replace all files, excluding `uploads/` 2. Open php/config.php and reconfigure your installation (We added new settings) 3. Open php/update.php in your browserpull/15/merge 1.2
parent
b0dccfb3e0
commit
4e5c836b8d
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 4.4 KiB |
File diff suppressed because one or more lines are too long
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
function array2json($arr) {
|
||||
if(function_exists('json_encode')) return json_encode($arr); //Lastest versions of PHP already has this functionality.
|
||||
$parts = array();
|
||||
$is_list = false;
|
||||
|
||||
//Find out if the given array is a numerical array
|
||||
$keys = array_keys($arr);
|
||||
$max_length = count($arr)-1;
|
||||
if(($keys[0] == 0) and ($keys[$max_length] == $max_length)) {//See if the first key is 0 and last key is length - 1
|
||||
$is_list = true;
|
||||
for($i=0; $i<count($keys); $i++) { //See if each key correspondes to its position
|
||||
if($i != $keys[$i]) { //A key fails at position check.
|
||||
$is_list = false; //It is an associative array.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($arr as $key=>$value) {
|
||||
if(is_array($value)) { //Custom handling for arrays
|
||||
if($is_list) $parts[] = array2json($value); /* :RECURSION: */
|
||||
else $parts[] = '"' . $key . '":' . array2json($value); /* :RECURSION: */
|
||||
} else {
|
||||
$str = '';
|
||||
if(!$is_list) $str = '"' . $key . '":';
|
||||
|
||||
//Custom handling for multiple data types
|
||||
if(is_numeric($value)) $str .= $value; //Numbers
|
||||
elseif($value === false) $str .= 'false'; //The booleans
|
||||
elseif($value === true) $str .= 'true';
|
||||
else $str .= '"' . addslashes($value) . '"'; //All other things
|
||||
// :TODO: Is there any more datatype we should be in the lookout for? (Object?)
|
||||
|
||||
$parts[] = $str;
|
||||
}
|
||||
}
|
||||
$json = implode(',',$parts);
|
||||
|
||||
if($is_list) return '[' . $json . ']';//Return numerical JSON
|
||||
return '{' . $json . '}';//Return associative JSON
|
||||
}
|
||||
?>
|
@ -1,39 +1,45 @@
|
||||
<?php
|
||||
|
||||
define("LYCHEE", true);
|
||||
define('LYCHEE', true);
|
||||
|
||||
// Declare
|
||||
$error = "";
|
||||
$error = '';
|
||||
|
||||
// Include
|
||||
include("config.php");
|
||||
require('config.php');
|
||||
|
||||
// PHP Version
|
||||
if (floatval(phpversion())<5.2) $error .= ("Error 100: Please upgrade to PHP 5.2 or higher!<br>\n");
|
||||
if (floatval(phpversion())<5.2) $error .= ('Error 100: Please upgrade to PHP 5.2 or higher!<br>\n');
|
||||
|
||||
// Extensions
|
||||
if (!extension_loaded("exif")) $error .= ("Error 200: PHP exif extension not activated.<br>\n");
|
||||
if (!extension_loaded("mbstring")) $error .= ("Error 201: PHP mbstring extension not activated.<br>\n");
|
||||
if (!extension_loaded("gd")) $error .= ("Error 202: PHP gd extension not activated.<br>\n");
|
||||
if (!extension_loaded("mysqli")) $error .= ("Error 203: PHP mysqli extension not activated.<br>\n");
|
||||
if (!extension_loaded('exif')) $error .= ('Error 200: PHP exif extension not activated.<br>\n');
|
||||
if (!extension_loaded('mbstring')) $error .= ('Error 201: PHP mbstring extension not activated.<br>\n');
|
||||
if (!extension_loaded('gd')) $error .= ('Error 202: PHP gd extension not activated.<br>\n');
|
||||
if (!extension_loaded('mysqli')) $error .= ('Error 203: PHP mysqli extension not activated.<br>\n');
|
||||
|
||||
// Config
|
||||
if (!$db||$db=="") $error .= ("Error 300: No property for \$db in config.php.<br>\n");
|
||||
if (!$dbUser||$dbUser=="") $error .= ("Error 301: No property for \$dbUser in config.php.<br>\n");
|
||||
if (!$dbPassword||$dbPassword=="") $error .= ("Error 302: No property for \$dbPassword in config.php.<br>\n");
|
||||
if (!$dbHost||$dbHost=="") $error .= ("Error 303: No property for \$dbHost in config.php.<br>\n");
|
||||
if (!$user||$user=="") $error .= ("Error 304: No property for \$user in config.php.<br>\n");
|
||||
if (!$password||$password=="") $error .= ("Error 305: No property for \$password in config.php.<br>\n");
|
||||
if (!$db||$db=='') $error .= ('Error 300: No property for \$db in config.php.<br>\n');
|
||||
if (!$dbUser||$dbUser=='') $error .= ('Error 301: No property for \$dbUser in config.php.<br>\n');
|
||||
if (!$dbPassword||$dbPassword=='') $error .= ('Error 302: No property for \$dbPassword in config.php.<br>\n');
|
||||
if (!$dbHost||$dbHost=='') $error .= ('Error 303: No property for \$dbHost in config.php.<br>\n');
|
||||
if (!$user||$user=='') $error .= ('Error 304: No property for \$user in config.php.<br>\n');
|
||||
if (!$password||$password=='') $error .= ('Error 305: No property for \$password in config.php.<br>\n');
|
||||
|
||||
// Additional Config
|
||||
//if ($checkForUpdates!=true&&heckForUpdates!=false) $error .= ('Error 306: No property for \$checkForUpdates in config.php.<br>\n');
|
||||
if (!is_numeric($thumbQuality)||$thumbQuality<=0||$thumbQuality>=100) $error .= ('Error 307: Wrong property for \$thumbQuality in config.php.<br>\n');
|
||||
if ($sorting!='ASC'&&$sorting!='DESC') $error .= ('Error 308: Wrong property for \$sorting in config.php.<br>\n');
|
||||
|
||||
// Database
|
||||
$database = new mysqli($dbHost, $dbUser, $dbPassword, $db);
|
||||
if (mysqli_connect_errno()!=0) $error .= ("Error 400: " . mysqli_connect_errno() . ": " . mysqli_connect_error() . "<br>\n");
|
||||
if (mysqli_connect_errno()!=0) $error .= ('Error 400: ' . mysqli_connect_errno() . ': ' . mysqli_connect_error() . '<br>\n');
|
||||
|
||||
// Permissions
|
||||
if (substr(sprintf('%o', fileperms("../uploads/big/")), -4) != "0777") $error .= ("Error 500: Wrong permissions for \"/uploads/big\" (777 required).<br>\n");
|
||||
if (substr(sprintf('%o', fileperms("../uploads/thumb/")), -4) != "0777") $error .= ("Error 501: Wrong permissions for \"/uploads/thumb\" (777 required).<br>\n");
|
||||
if (substr(sprintf('%o', fileperms("../uploads/import/")), -4) != "0777") $error .= ("Error 502: Wrong permissions for \"/uploads/import\" (777 required).<br>\n");
|
||||
if (substr(sprintf('%o', fileperms('../uploads/big/')), -4)!='0777') $error .= ('Error 500: Wrong permissions for \'/uploads/big\' (777 required).<br>\n');
|
||||
if (substr(sprintf('%o', fileperms('../uploads/thumb/')), -4)!='0777') $error .= ('Error 501: Wrong permissions for \'/uploads/thumb\' (777 required).<br>\n');
|
||||
if (substr(sprintf('%o', fileperms('../uploads/import/')), -4)!='0777') $error .= ('Error 502: Wrong permissions for \'/uploads/import\' (777 required).<br>\n');
|
||||
if (substr(sprintf('%o', fileperms('../uploads/')), -4)!='0777') $error .= ('Error 503: Wrong permissions for \'/uploads\' (777 required).<br>\n');
|
||||
|
||||
if ($error == "") echo("Lychee is ready!"); else echo $error;
|
||||
if ($error=='') echo('Lychee is ready!'); else echo $error;
|
||||
|
||||
?>
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
define('LYCHEE', true);
|
||||
|
||||
// Include
|
||||
require('check.php');
|
||||
|
||||
if($error=='') {
|
||||
if(!$database->query("SELECT `public` FROM `lychee_albums`;")) $database->query("ALTER TABLE `lychee_albums` ADD `public` TINYINT( 1 ) NOT NULL DEFAULT '0'");
|
||||
if(!$database->query("SELECT `password` FROM `lychee_albums`;")) $database->query("ALTER TABLE `lychee_albums` ADD `password` VARCHAR( 100 ) NULL DEFAULT NULL");
|
||||
echo "\nUpdate complete!";
|
||||
} else {
|
||||
echo "\nCould not Update!";
|
||||
}
|
||||
|
||||
?>
|
@ -1,58 +1,63 @@
|
||||
# Lychee
|
||||
|
||||
#### A great looking and easy-to-use Photo-Management-System.
|
||||
|
||||
![Lychee ImageView](http://l.electerious.com/uploads/big/13582806160093.png)
|
||||
![Lychee ImageView](http://l.electerious.com/uploads/big/13582805615704.png)
|
||||
|
||||
Lychee is a free, easy to use and great looking photo-management-system you can run on your server to manage and share photos. Just download the source and follow the instructions to install Lychee wherever you want.
|
||||
|
||||
## Installation
|
||||
|
||||
To run Lychee, everything you need is a web-server with PHP 5.3 or later and a MySQL-Database. Follow the instructions to install Lychee on your server. [Installation »](https://github.com/electerious/Lychee/wiki/Installation)
|
||||
|
||||
## Settings
|
||||
|
||||
Settings are located inside the `php/config.php`. All settings are optional and doesn't need to be changed. [Settings »](https://github.com/electerious/Lychee/wiki/Settings)
|
||||
|
||||
## How to use
|
||||
|
||||
After the configuration, navigate your browser to the place where Lychee is located. Everything should work now.
|
||||
|
||||
#### FTP Upload
|
||||
|
||||
You can upload photos directly with every FTP client into Lychee. This feature helps you to share single images quickly with others. [FTP Upload »](https://github.com/electerious/Lychee/wiki/FTP-Upload)
|
||||
|
||||
#### Keyboard Shortcuts
|
||||
|
||||
This shortcuts will help you to use Lychee even faster. [Keyboard Shortcuts »](https://github.com/electerious/Lychee/wiki/Keyboard-Shortcuts)
|
||||
|
||||
## Browser Support
|
||||
|
||||
Lychee supports the latest versions of Google Chrome, Apple Safari and Mozilla Firefox. Photos you share with others can be viewed from every browser. For the best experience we are recommending to use Google Chrome or Apple Safari.
|
||||
|
||||
## Update
|
||||
|
||||
To update Lychee, simply replace all files, excluding the following ones:
|
||||
`uploads/`, `php/config.php`
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If Lychee is not working properly, try to open `php/check.php`. This file will take a look at your configuration and displays all errors it can find. Everything should work if you can see the message "Lychee is ready!".
|
||||
|
||||
## About
|
||||
|
||||
Lychee is made by [Tobias Reich](http://electerious.com) (HTML, CSS, JS, Design, Website Design and Development) with the help of [Philipp Maurer](http://phinal.net) (PHP, MySQL).
|
||||
|
||||
##License
|
||||
|
||||
(MIT License)
|
||||
|
||||
Copyright (C) 2013 [Tobias Reich](http://electerious.com)
|
||||
Copyright (C) 2013 [Philipp Maurer](http://phinal.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
# Lychee
|
||||
|
||||
#### A great looking and easy-to-use Photo-Management-System.
|
||||
|
||||
![Lychee ImageView](http://l.electerious.com/uploads/big/13582806160093.png)
|
||||
![Lychee ImageView](http://l.electerious.com/uploads/big/13582805615704.png)
|
||||
|
||||
Lychee is a free, easy to use and great looking photo-management-system you can run on your server to manage and share photos. Just download the source and follow the instructions to install Lychee wherever you want.
|
||||
|
||||
## Installation
|
||||
|
||||
To run Lychee, everything you need is a web-server with PHP 5.3 or later and a MySQL-Database. Follow the instructions to install Lychee on your server. [Installation »](https://github.com/electerious/Lychee/wiki/Installation)
|
||||
|
||||
## Settings
|
||||
|
||||
Settings are located inside the `php/config.php`. All settings are optional and doesn't need to be changed. [Settings »](https://github.com/electerious/Lychee/wiki/Settings)
|
||||
|
||||
## How to use
|
||||
|
||||
After the configuration, navigate your browser to the place where Lychee is located. Everything should work now.
|
||||
|
||||
#### FTP Upload
|
||||
|
||||
You can upload photos directly with every FTP client into Lychee. This feature helps you to share single images quickly with others. [FTP Upload »](https://github.com/electerious/Lychee/wiki/FTP-Upload)
|
||||
|
||||
#### Keyboard Shortcuts
|
||||
|
||||
This shortcuts will help you to use Lychee even faster. [Keyboard Shortcuts »](https://github.com/electerious/Lychee/wiki/Keyboard-Shortcuts)
|
||||
|
||||
## Browser Support
|
||||
|
||||
Lychee supports the latest versions of Google Chrome, Apple Safari and Mozilla Firefox. Photos you share with others can be viewed from every browser. For the best experience we are recommending to use Google Chrome or Apple Safari.
|
||||
|
||||
## Update
|
||||
|
||||
####From version 1.0/1.1 to 1.2:
|
||||
1. Replace all files, excluding `uploads/`
|
||||
2. Open `php/config.php` and reconfigure your installation
|
||||
3. Open `php/update.php` in your browser
|
||||
|
||||
####From version 1.2 to 1.2.x:
|
||||
Replace all files, excluding `uploads/` and `php/config.php`.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If Lychee is not working properly, try to open `php/check.php`. This file will take a look at your configuration and displays all errors it can find. Everything should work if you can see the message "Lychee is ready!".
|
||||
|
||||
## About
|
||||
|
||||
Lychee is made by [Tobias Reich](http://electerious.com) (HTML, CSS, JS, Design, Website Design and Development) with the help of [Philipp Maurer](http://phinal.net) (PHP, MySQL).
|
||||
|
||||
##License
|
||||
|
||||
(MIT License)
|
||||
|
||||
Copyright (C) 2013 [Tobias Reich](http://electerious.com)
|
||||
Copyright (C) 2013 [Philipp Maurer](http://phinal.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Loading…
Reference in new issue