diff --git a/assets/css/style.css b/assets/css/style.css
index 1923e8f..2b5a2c2 100644
--- a/assets/css/style.css
+++ b/assets/css/style.css
@@ -938,3 +938,24 @@ table {
.bloc-filter label {
width: 80%;
}
+
+.post u {
+ font-weight: 700;
+}
+
+.post i {
+ font-style: italic;
+}
+
+.post ol {
+ list-style: decimal-leading-zero;
+}
+
+.post ul {
+ list-style: disc;
+}
+
+.bloc-search a {
+ color: inherit;
+ text-decoration: inherit;
+}
diff --git a/assets/html/includes/head.html b/assets/html/includes/head.html
index d168d39..b9edff3 100644
--- a/assets/html/includes/head.html
+++ b/assets/html/includes/head.html
@@ -5,6 +5,7 @@
+
diff --git a/assets/html/search.html b/assets/html/search.html
index 447b5d0..9f778e8 100644
--- a/assets/html/search.html
+++ b/assets/html/search.html
@@ -9,7 +9,7 @@
-
+
récent
@@ -19,7 +19,6 @@
-
diff --git a/assets/js/script.js b/assets/js/script.js
index 392b5f1..59d0bd9 100644
--- a/assets/js/script.js
+++ b/assets/js/script.js
@@ -102,8 +102,10 @@ var submit = () => {
http.open("POST", "./", true);
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
- document.write(http.responseText);
- // window.location = window.location.href.replace("edit/", "");
+ // document.write(http.responseText);
+ let href = window.location.href.replace("edit/", "");
+ href.replace("new/", "");
+ window.location = href;
}
}
http.send(data);
@@ -124,7 +126,23 @@ document.querySelectorAll(".filtre").forEach(function(el) {
var tag = (tagW != null ? "&tag=" + tagW : "");
var termW = new URL(window.location).searchParams.get("term");
var term = (termW != null ? "&term=" + termW : "");
- window.location = "/search/?category=" + this.getAttribute("data-category") + tag + term;
+ var recentW = new URL(window.location).searchParams.get("recent");
+ var recent = (recentW != null ? "&recent=" + recentW : "");
+ window.location = "/search/?category=" + this.getAttribute("data-category") + tag + term + recent;
+ })
+})
+
+document.querySelectorAll(".recent").forEach(function(el) {
+ el.addEventListener("click", function() {
+ var tagW = new URL(window.location).searchParams.get("tag");
+ var tag = (tagW != null ? "&tag=" + tagW : "");
+ var termW = new URL(window.location).searchParams.get("term");
+ var term = (termW != null ? "&term=" + termW : "");
+ var recentW = new URL(window.location).searchParams.get("recent");
+ var recent = "?recent=" + (recentW != null && recentW == "false" ? "true" : "false");
+ var categoryW = new URL(window.location).searchParams.get("category");
+ var cetagory = (categoryW != null ? "&category=" + categoryW : "");
+ window.location = "/search/" + recent + tag + term + cetagory;
})
})
@@ -145,15 +163,13 @@ $(document).ready(function() {
}
},
toolbar: [
- ['style', ['style']],
['font', ['bold', 'italic', 'underline', 'clear']],
- ['fontname', ['fontname']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
['table', ['table']],
['insert', ['link', 'picture', 'hr']],
- ['view', ['fullscreen', 'codeview']],
+ ['view', ['codeview']],
['help', ['help']]
]
});
diff --git a/assets/php/Tags/Tags.php b/assets/php/Tags/Tags.php
index a6a9d75..acbda60 100644
--- a/assets/php/Tags/Tags.php
+++ b/assets/php/Tags/Tags.php
@@ -20,6 +20,7 @@ class Tags extends Tag {
$url = "?tag=" . $tag->getId();
if(isset($_GET["term"])) $url .= "&term=" . $_GET["term"];
if(isset($_GET["category"])) $url .= "&category=" . $_GET["category"];
+ if(isset($_GET["recent"])) $url .= "&recent=" . $_GET["recent"];
$res->setAttribute("href", "/search/" . $url);
$classes = "tag";
if(isset($_GET["tag"]) && $tag->getId() == $_GET["tag"]) $classes .= " active";
diff --git a/assets/php/db/Post.php b/assets/php/db/Post.php
index 993e864..97ba2ff 100644
--- a/assets/php/db/Post.php
+++ b/assets/php/db/Post.php
@@ -245,7 +245,7 @@ class Post {
$content = $post->getContent();
$category = $post->getCategory()->getId();
$author = $post->getAuthor()->getId();
- $dt = (new DateTime())->format("d/m/Y h:i:s");
+ $dt = (new DateTime())->format("d/m/Y");
$pdo = Functions::connect();