commit e4889de0718caca3e5dab9914d77a0b147a85694
parent 638b56e5ed47861a1190b37373c7d3d6f626f961
Author: MTRNord <mtrnord1@gmail.com>
Date: Tue, 13 Jan 2015 19:42:16 +0100
activate newpost function (not tested yet
Diffstat:
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/core/backend/admin/blog/newpost.php b/core/backend/admin/blog/newpost.php
@@ -27,9 +27,12 @@ if ($resultat = $connection->query('SELECT id FROM posts')) {
#$resultat->close();
}
-$author = "not implemented yet";
+$author = $_GET["author"];
+$title = $_GET["title"];
+$text = $_GET["content"];
+$category = $_GET["category"];
-if ($resultat = $connection->query("INSERT INTO posts (id,text,title,author,date,category) VALUES ('$ids', '$text', '$title', '$author', '$date', '$category')")) {
+if ($resultat = $connection->query("INSERT INTO posts (id,text,title,author,date,category) VALUES ('$ids', '$text', '$title', '$author', 'date('Y-m-d H:i:s')', '$category')")) {
$resultat->close();
}
diff --git a/themes/jumbotron/admin.php b/themes/jumbotron/admin.php
@@ -118,7 +118,6 @@ foreach($langs as $prio => $lang) {
function foo() {
if(window.location.hash) {
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
- alert (hash);
var divid1 = document.getElementById(hash);
divid1.style.display = "block";
} else {
@@ -198,12 +197,20 @@ foreach($langs as $prio => $lang) {
<div class="hide_" id="newpost">
<h2>New Post</h2>
- <form method="post" action="">
+ <form method="post" action="core/backend/admin/blog/newpost.php">
<div class="form-group">
<label for="post_title">Title</label>
<input type="text" name="title" class="form-control" id="post_title">
</div>
<div class="form-group">
+ <label for="post_author">Author</label><!-- will later be check with login ;) -->
+ <input type="text" name="author" class="form-control" id="post_author">
+ </div>
+ <div class="form-group">
+ <label for="post_category">Category</label><!-- will later be check with login ;) -->
+ <input type="text" name="category" class="form-control" id="post_category">
+ </div>
+ <div class="form-group">
<label for="post_content">Content</label>
<textarea name="content" style="width:100%"></textarea>
</div>