added option to add public album

This commit is contained in:
Tobias Reich 2014-03-18 22:23:07 +01:00
parent dc6b849ae2
commit 24c91e47d4

View File

@ -9,14 +9,14 @@
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
function addAlbum($title) {
function addAlbum($title, $public = 0) {
global $database;
if (strlen($title)<1||strlen($title)>50) return false;
$sysdate = date("d.m.Y");
$result = $database->query("INSERT INTO lychee_albums (title, sysdate) VALUES ('$title', '$sysdate');");
$result = $database->query("INSERT INTO lychee_albums (title, sysdate, public) VALUES ('$title', '$sysdate', '$public');");
if (!$result) return false;
return $database->insert_id;