diff --git a/website/public/API/getPosts.php b/website/public/API/getPosts.php
new file mode 100644
index 0000000..eef8261
--- /dev/null
+++ b/website/public/API/getPosts.php
@@ -0,0 +1,24 @@
+fetchAll(PDO::FETCH_ASSOC);
+
+for($i = 0; $i < sizeof($results); $i++) {
+ $results[$i]["nicetime"] = nicetime($results[$i]["creationdate"]);
+}
+
+//$results[0]["niceTime"] = nicetime($results[0]["creationdate"]);
+
+echo json_encode($results);
\ No newline at end of file
diff --git a/website/public/API/postComment.php b/website/public/API/postComment.php
new file mode 100644
index 0000000..b840e0b
--- /dev/null
+++ b/website/public/API/postComment.php
@@ -0,0 +1,18 @@
+prepare("
SELECT
@@ -18,11 +19,11 @@ if (array_key_exists("u", $_GET) and array_key_exists("h", $_GET)) {
if ($role == "unconfirmed") {
doActivate($email);
} else {
- echo "Ongeldige link.";
+ messagePage("Ongeldige link.");
}
} else {
- echo "Ongeldige link.";
+ messagePage("Ongeldige link.");
}
function doActivate(string $email) {
@@ -39,11 +40,10 @@ function doActivate(string $email) {
$confirmUser->bindParam(":userID", $_GET["u"]);
$confirmUser->execute();
if ($confirmUser->rowCount()) {
- echo "Email bevestigd
- U wordt automatisch doorgestuurd naar de login pagina over 5 seconden. ";
- header("refresh:5;url=login.php");
+ messagePage("Email bevestigd
+ Klik hier om terug te gaan naar de login pagina.");
}
} else {
- echo "Ongeldige link.";
+ messagePage("Ongeldige link.");
}
}
\ No newline at end of file
diff --git a/website/public/js/masonry.js b/website/public/js/masonry.js
index 3b872ba..7f6423e 100644
--- a/website/public/js/masonry.js
+++ b/website/public/js/masonry.js
@@ -11,12 +11,10 @@ function scrollbarMargin(width, overflow) {
});
}
-function requestPost(post) {
+function requestPost(postID) {
$(".modal").show();
- $.get(
- "API/loadPost.php",
- $(post).children("form").serialize()
- ).done(function (data) {
+
+ $.get("API/loadPost.php", { postID : postID }).done(function(data) {
$('.modal-default').hide();
var scrollBarWidth = window.innerWidth - document.body.offsetWidth;
scrollbarMargin(scrollBarWidth, 'hidden');
@@ -26,37 +24,55 @@ function requestPost(post) {
}
$(window).on("load", function() {
- console.log("LOADED");
- container = $("div.posts");
- posts = container.children();
- posts.remove();
-
- column = $('