@ -28,14 +28,11 @@ final class Photo extends Module {
}
public function add($files, $albumID = 0, $description = '', $tags = '', $returnOnError = false) {
public function add(array $files, $albumID = 0, $description = '', $tags = '', $returnOnError = false) {
# Use $returnOnError if you want to handle errors by your own
# e.g. when calling this functions inside an if-condition
# Check dependencies
self::dependencies(isset($files));
# Check permissions
if (hasPermissions(LYCHEE_UPLOADS)===false||
hasPermissions(LYCHEE_UPLOADS_BIG)===false||
@ -255,9 +252,6 @@ final class Photo extends Module {
private function exists($checksum, $photoID = null) {
# Check dependencies
self::dependencies(isset($checksum));
# Exclude $photoID from select when $photoID is set
if (isset($photoID)) $query = Database::prepare(Database::get(), "SELECT id, url, thumbUrl, medium FROM ? WHERE checksum = '?' AND id <> '?' LIMIT 1", array(LYCHEE_TABLE_PHOTOS, $checksum, $photoID));
else $query = Database::prepare(Database::get(), "SELECT id, url, thumbUrl, medium FROM ? WHERE checksum = '?' LIMIT 1", array(LYCHEE_TABLE_PHOTOS, $checksum));
@ -290,9 +284,6 @@ final class Photo extends Module {
private function createThumb($url, $filename, $type, $width, $height) {