modal.show("Import from Link","Please enter the direct link to a photo to import it: <input class='text' type='text' placeholder='http://' value='http://'>",buttons);
},
@ -194,10 +195,15 @@ upload = {
upload.close();
upload.notify("Import complete");
if(album.getID()===false)lychee.goto("0");
if(data==="Notice: Import only contains albums!"){
if(visible.albums())lychee.load();
elselychee.goto("");
}
elseif(album.getID()===false)lychee.goto("0");
elsealbum.load(albumID);
if(data==="Warning: Folder empty!")lychee.error("Folder empty. No photos imported!",params,data);
if(data==="Notice: Import only contains albums!")returntrue;
elseif(data==="Warning: Folder empty!")lychee.error("Folder empty. No photos imported!",params,data);
modal.show("Import from Server","This action will import all photos which are located in <b>'uploads/import/'</b> of your Lychee installation.",buttons);
modal.show("Import from Server","This action will import all photos and albums which are located in <b>'uploads/import/'</b> of your Lychee installation.",buttons);
$result2 = $database->query("SELECT thumbUrl FROM lychee_photos WHERE album = '$albumID' ORDER BY star DESC, " . substr($settings['sorting'], 9) . " LIMIT 0, 3");
$k = 0;
@ -56,6 +62,7 @@ function getAlbums($public) {
if (!isset($return["content"][$row->id]["thumb0"])) $return["content"][$row->id]["thumb0"] = "";
if (!isset($return["content"][$row->id]["thumb1"])) $return["content"][$row->id]["thumb1"] = "";
if (!isset($return["content"][$row->id]["thumb2"])) $return["content"][$row->id]["thumb2"] = "";
}
// Album count
@ -65,9 +72,6 @@ function getAlbums($public) {
$return["num"] = $i;
if ($i==0) $return["albums"] = false;
else $return["albums"] = true;
return $return;
}
@ -77,8 +81,8 @@ function getSmartInfo() {
global $database, $settings;
// Unsorted
$result= $database->query("SELECT thumbUrl FROM lychee_photos WHERE album = 0 " . $settings['sorting']);
$i= 0;
$result= $database->query("SELECT thumbUrl FROM lychee_photos WHERE album = 0 " . $settings['sorting']);
$i= 0;
while($row = $result->fetch_object()) {
if ($i<3)$return["unsortedThumb$i"]=$row->thumbUrl;
$i++;
@ -86,8 +90,8 @@ function getSmartInfo() {
$return['unsortedNum'] = $i;
// Public
$result2= $database->query("SELECT thumbUrl FROM lychee_photos WHERE public = 1 " . $settings['sorting']);
$i= 0;
$result2= $database->query("SELECT thumbUrl FROM lychee_photos WHERE public = 1 " . $settings['sorting']);
$i= 0;
while($row2 = $result2->fetch_object()) {
if ($i<3)$return["publicThumb$i"]=$row2->thumbUrl;
$i++;
@ -95,8 +99,8 @@ function getSmartInfo() {
$return['publicNum'] = $i;
// Starred
$result3= $database->query("SELECT thumbUrl FROM lychee_photos WHERE star = 1 " . $settings['sorting']);
$i= 0;
$result3= $database->query("SELECT thumbUrl FROM lychee_photos WHERE star = 1 " . $settings['sorting']);
$i= 0;
while($row3 = $result3->fetch_object()) {
if ($i<3)$return["starredThumb$i"]=$row3->thumbUrl;
$i++;
@ -128,34 +132,33 @@ function getAlbum($albumID) {
default: $result = $database->query("SELECT * FROM lychee_albums WHERE id = '$albumID';");
$row = $result->fetch_object();
$return['title'] = $row->title;
$return['description'] = $row->description;
$return['sysdate'] = date('d M. Y', strtotime($row->sysdate));
$return['public'] = $row->public;
if ($row->password=="") $return['password'] = false;
else $return['password'] = true;
$return['title'] = $row->title;
$return['description'] = $row->description;
$return['sysdate'] = date('d M. Y', strtotime($row->sysdate));
$result = $database->query("SELECT * FROM lychee_photos WHERE title like '%$term%' OR description like '%$term%' OR tags like '%$term%';");
// Photos
$result = $database->query("SELECT id, title, tags, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE title like '%$term%' OR description like '%$term%' OR tags like '%$term%';");
while($row = $result->fetch_array()) {
$return['photos'][$row['id']]= $row;
$return['photos'][$row['id']]['sysdate']= date('d F Y', strtotime($row['sysdate']));
$return['photos'][$row['id']]= $row;
$return['photos'][$row['id']]['sysdate']= date('d F Y', strtotime($row['sysdate']));
}
// Albums
$result = $database->query("SELECT * FROM lychee_albums WHERE title like '%$term%' OR description like '%$term%';");