diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-06-21 16:34:27 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-06-21 16:34:27 +0200 |
commit | 889e8eaf7c40817663dd602a21ac771062ccac3b (patch) | |
tree | ca8ac81ee202165333e5ffe16147d09e5cdaf2ab /lib/image/editinfo.php | |
parent | 5c4caed8560d5fded00525844dfa8386b97e7918 (diff) | |
download | Bits-889e8eaf7c40817663dd602a21ac771062ccac3b.tar.gz Bits-889e8eaf7c40817663dd602a21ac771062ccac3b.zip |
Big change, sir. Can now upload any kind of files.
Diffstat (limited to 'lib/image/editinfo.php')
-rw-r--r-- | lib/image/editinfo.php | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/lib/image/editinfo.php b/lib/image/editinfo.php deleted file mode 100644 index 8223c18..0000000 --- a/lib/image/editinfo.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -require("lib/markdown.php"); - -require("lib/conf/image.php"); - -$title = "Rename an image"; - -if (count($args) < 3) header("location: index.php"); -$id = intval($args[2]); - -$info = mysql_fetch_assoc(sql( - "SELECT images.owner AS owner, images.id AS id, images.name AS name, images.comment AS comment, - img_folders.id AS folder_id, img_folders.name AS folder_name - FROM images LEFT JOIN img_folders ON images.folder = img_folders.id WHERE images.id = $id" -)); - -assert_error($info["owner"] == $user["id"], "You cannot rename this image."); - -$name = $info['name']; -$comment = $info['comment']; -$folder = $info['folder_id']; -if (isset($_POST['name']) && isset($_POST['comment']) && isset($_POST['folder'])) { - $name = esca($_POST['name']); - $comment = esca($_POST['comment']); - $comment_html = Markdown($comment); - $folder = intval($_POST['folder']); - if ($name == "") { - $error = "You must give a non-empty name to this image. Please."; - } else { - sql("UPDATE images SET name = '" . escs($name) . "', comment='" . escs($comment). "', - comment_html = '" . escs($comment_html) . "', folder = $folder WHERE id = $id"); - header("Location: image"); - die(); - } -} - -$folders = array(0 => "[no folder]"); -$r = sql("SELECT id, name FROM img_folders WHERE owner = " . $user['id'] . " ORDER BY name ASC"); -while ($n = mysql_fetch_array($r)) - $folders[$n['id']] = $n['name']; - -$title = "Edit image info : " . $info['name']; -$fields = array( - array("label" => "Name : ", "name" => "name", "value" => $name), - array("label" => "Folder : ", "type" => "select", "name" => "folder", "choices" => $folders, "value" => $folder), - array("label" => "Comment : ", "name" => "comment", "value" => $comment, "type" => "textarea"), -); -$validate = "Save"; - -require("tpl/general/form.php"); |