/** * Build image check function to determine which Uploader sub-function to run based on the type of POST. * * @since 1.0 */ function dynamik_images_check() { if (!empty($_GET['fct'])) { switch ($_GET['fct']) { case 'upload': uploadimage(); break; case 'rename': renameimage(); break; case 'dorename': dorename(); break; case 'delete': deleteimage(); break; case 'dodelete': dodelete(); break; case 'bulkdelete': @dobulkdelete(); break; } } }
msg(); } else { if ($ask == "register") { register(); } else { if ($ask == "edituser") { edituser(); } else { if ($ask == "changepsd") { changepsd(); } else { if ($ask == "delete") { del(); } else { if ($ask == "image") { uploadimage(); } else { if ($ask == "file") { uploadfile(); } else { if ($ask == "lzl") { lzl(); } else { if ($ask == "search") { search(); } else { if ($ask == "action") { action(); } else { echo '<capu><info><code>14</code><msg>ask错误。</msg></info></capu>'; exit;
} $updateset[] = "anon = '" . ($_POST["anon"] ? "yes" : "no") . "'"; //update images $img1action = $_POST['img1action']; if ($img1action == "update") { $updateset[] = "image1 = " . sqlesc(uploadimage(0, $row["image1"], $id)); } if ($img1action == "delete") { if ($row[image1]) { $del = unlink($site_config["torrent_dir"] . "/images/{$row['image1']}"); $updateset[] = "image1 = ''"; } } $img2action = $_POST['img2action']; if ($img2action == "update") { $updateset[] = "image2 = " . sqlesc(uploadimage(1, $row["image2"], $id)); } if ($img2action == "delete") { if ($row[image2]) { $del = unlink($site_config["torrent_dir"] . "/images/{$row['image2']}"); $updateset[] = "image2 = ''"; } } SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = {$id}"); $returl = "torrents-edit.php?id={$id}&edited=1"; if (isset($_POST["returnto"])) { $returl = $_POST["returnto"]; } write_log("Torrent {$id} (" . htmlspecialchars($_POST["name"]) . ") was edited by {$CURUSER['username']}"); header("Location: {$returl}"); die;
if (!$row) { die; } if ($CURUSER["id"] != $row["owner"] && get_user_class() < UC_MODERATOR) { bark("You're not the owner! How did that happen?\n"); } $updateset = array(); $fname = $row["filename"]; preg_match('/^(.+)\\.torrent$/si', $fname, $matches); $shortfname = $matches[1]; $dname = $row["save_as"]; // picturemod for ($x = 1; $x <= 5; $x++) { $_GLOBALS['img' . $x . 'action'] = $_POST['img' . $x . 'action']; if ($_GLOBALS['img' . $x . 'action'] == 'update') { $updateset[] = 'image' . $x . ' = ' . sqlesc(uploadimage($x - 1, $row['image' . $x], $id)); } if ($_GLOBALS['img' . $x . 'action'] == 'delete') { if ($row['image' . $x]) { $del = unlink('torrents/images/' . $row['image' . $x]); $updateset[] = 'image' . $x . ' = ""'; } } } // picturemod if (isset($_FILES["tfile"]) && !empty($_FILES["tfile"]["name"])) { $update_torrent = true; } if ($update_torrent) { $f = $_FILES["tfile"]; $fname = unesc($f["name"]);