From 59fc65e27af9a388497dbdfb067f5dd7055c46d0 Mon Sep 17 00:00:00 2001 From: "K. Nobel" Date: Thu, 26 Jan 2017 16:09:18 +0100 Subject: [PATCH] Made small changes to posts, added amount of comments and niet slechts --- website/public/js/masonry.js | 7 +++---- website/queries/user.php | 30 +++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/website/public/js/masonry.js b/website/public/js/masonry.js index f30139c..f30f0af 100644 --- a/website/public/js/masonry.js +++ b/website/public/js/masonry.js @@ -70,9 +70,7 @@ function masonry(mode) { $form.append($("")); columns[0][1].append($postInput); - $postInput.on("load", function() { - columns[0][0] = $postInput.height() + margin; - }); + columns[0][0] = $postInput.height() + margin; } /* @@ -99,11 +97,12 @@ function masonry(mode) { /* * Rearange the objects. */ - jQuery.each(posts, function() { + $.each(posts, function() { $post = $("
"); $post.append($("

").html(this["title"])); $post.append($("

").html(this["content"])); $post.append($("

").text(this["nicetime"])); + $post.append($("

").text("comments: " + this["comments"] + ", niet slechts: " + this["niet_slechts"])); shortestColumn = getShortestColumn(columns); shortestColumn[1].append($post); diff --git a/website/queries/user.php b/website/queries/user.php index 4a7ee57..9c23721 100644 --- a/website/queries/user.php +++ b/website/queries/user.php @@ -105,24 +105,36 @@ function selectAllUserGroups($userID) { function selectAllUserPosts($userID) { $stmt = $GLOBALS["db"]->prepare(" SELECT - `postID`, - `author`, + `post`.`postID`, + `post`.`author`, `title`, - CASE LENGTH(`content`) >= 150 AND `content` NOT LIKE '= 150 AND `post`.`content` NOT LIKE 'bindParam(':userID', $userID, PDO::PARAM_INT);