$insertid = mysql_insert_id(); if (is_array($typ)) { switch ($typ[2]) { case 1: $endung = '.gif'; break; case 3: $endung = '.png'; break; default: $endung = '.jpg'; break; } move_uploaded_file($picture['tmp_name'], $dir . 'large/' . $insertid . $endung); @chmod($dir . 'large/' . $insertid . $endung, $new_chmod); $galclass->savethumb($dir . 'large/' . $insertid . $endung, $dir . 'thumb/' . $insertid . '.jpg'); if ($galclass->getuserspace($userID) + filesize($dir . 'large/' . $insertid . $endung) + filesize($dir . 'thumb/' . $insertid . '.jpg') > $maxusergalleries) { @unlink($dir . 'large/' . $insertid . $endung); @unlink($dir . 'thumb/' . $insertid . '.jpg'); safe_query("DELETE FROM " . PREFIX . "gallery_pictures WHERE picID='" . $insertid . "'"); echo '<p style="color:' . $loosecolor . '">' . $_language->module['no_space_left'] . '</p>'; } } else { safe_query("DELETE FROM " . PREFIX . "gallery_pictures WHERE picID='" . $insertid . "'"); } } } elseif (isset($_GET['delete'])) { //SQL if (safe_query("DELETE FROM " . PREFIX . "gallery WHERE galleryID='" . $_GET['galleryID'] . "' AND userID='" . $userID . "'")) { //FILES $ergebnis = safe_query("SELECT picID FROM " . PREFIX . "gallery_pictures WHERE galleryID='" . $_GET['galleryID'] . "'");
case 2: $typ = '.jpg'; break; case 3: $typ = '.png'; break; } if ($name[$i]) { $insertname = $name[$i]; } else { $insertname = $picture; } safe_query("INSERT INTO " . PREFIX . "gallery_pictures ( galleryID, name, comment, comments) VALUES ('" . $_POST['galleryID'] . "', '" . $insertname . "', '" . $comment[$i] . "', '" . $_POST['comments'] . "' )"); $insertid = mysql_insert_id(); copy($dir . $picture, $dir . 'large/' . $insertid . $typ); $galclass->savethumb($dir . 'large/' . $insertid . $typ, $dir . 'thumb/' . $insertid . '.jpg'); @unlink($dir . $picture); $i++; } } else { echo $_language->module['transaction_invalid']; } } elseif (isset($_POST['saveform'])) { $dir = '../images/gallery/'; $picture = $_FILES['picture']; $CAPCLASS = new Captcha(); if ($CAPCLASS->check_captcha(0, $_POST['captcha_hash'])) { if ($picture['name'] != "") { if ($_POST['name']) { $insertname = $_POST['name']; } else {