From 24547ccec6526fcef3cccb34bc35fb81f31236b3 Mon Sep 17 00:00:00 2001 From: Nicolas BERNSTEIN Date: Sun, 12 Feb 2012 19:50:55 +0100 Subject: A lot of changes : blogging system essentially. --- lib/blog/edit.php | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lib/blog/edit.php (limited to 'lib/blog/edit.php') diff --git a/lib/blog/edit.php b/lib/blog/edit.php new file mode 100644 index 0000000..854c94f --- /dev/null +++ b/lib/blog/edit.php @@ -0,0 +1,61 @@ += 1) { + $v = array(); + foreach ($tags as $tag) { + $v[] = "($postid, '" . escs($tag) . "')"; + } + sql("INSERT INTO blog_tags(post, tag) VALUES " . implode(',', $v)); + } + if ($post['draft']) { + header("Location: drafts-blog"); + } else { + header("Location: blog"); + } + die(); + } +} + +$title = "Edit : " . $post['title']; +$fields = array( + array("label" => "Title : ", "name" => "title", "value" => $post_title), + array("label" => "Tags : ", "name" => "tags", "type" => "text", "value" => $post_tags), + array("label" => "Text : ", "name" => "text", "type" => "textarea", "value" => $post_text), + ); +$validate = "Edit post"; + +require("tpl/general/form.php"); + + -- cgit v1.2.3