Thanks for your response. I thought I did that already. Here's the related code from my admin.php. I'm an amateur with backend, so maybe I made a mistake:
/** UPLOAD IMAGES *************************************************************/
/*****************************************************************************/
} else if ($action == "upload") {
// Check for files.
$files_empty = true;
if (isset($_FILES['files']))
foreach($_FILES['files']['name'] as $name) { if (!empty($name)) $files_empty = false; }
// Make sure the folder exists. If not, create it.
if (isset($_POST['processed'])
&& !empty($_POST['folder'])
&& !$files_empty) {
$folder = strip($_POST['folder']);
$uploaddir = SERVERPATH . '/albums/'. $folder;
if (!is_dir($uploaddir)) {
mkdir ($uploaddir,777);
}
@chmod($uploaddir,777);
$error = false;
foreach ($_FILES['files']['error'] as $key => $error) {
if ($_FILES['files']['name'][$key] == "") continue;
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES['files']['tmp_name'][$key];
$name = $_FILES['files']['name'][$key];
if (is_image($name)) {
$uploadfile = $uploaddir . '/' . $name;
move_uploaded_file($tmp_name, $uploadfile);
@chmod($uploadfile,777);
} else if (is_zip($name)) {
unzip($tmp_name, $uploaddir);
}
}
}
$album = new Album($gallery, $folder);
$title = strip($_POST['albumtitle']);
if (!empty($title)) {
$album->setTitle($title);
$album->save();
}
header("Location: " . FULLWEBPATH . "/zen/admin.php?page=edit&album=$folder");
exit();
} else {
// Handle the error and return to the upload page.
$page = "upload";
$error = true;
if ($files_empty) {
$errormsg = "You must upload at least one file.";
} else if (empty($_POST['albumtitle'])) {
$errormsg = "You must enter a title for your new album.";
} else if (empty($_POST['folder'])) {
$errormsg = "You must enter a folder name for your new album.";
} else if (empty($_POST['processed'])) {
$errormsg = "You've most likely exceeded the upload limits. Try uploading fewer files at a time, or use a ZIP file.";
} else {
$errormsg = "There was an error submitting the form. Please try again. If this keeps happening, check your "
. "server and PHP configuration (make sure file uploads are enabled, and upload_max_filesize is set high enough). "
. "If you think this is a bug, file a bug report. Thanks!";
}
}