diff --git a/website/public/js/masonry.js b/website/public/js/masonry.js index e9419a2..b523828 100644 --- a/website/public/js/masonry.js +++ b/website/public/js/masonry.js @@ -1,37 +1,28 @@ margin = 20; -$(window).on("load", function() { - console.log("LOADED"); - container = $("div.posts"); - posts = container.children(); - posts.remove(); - - column = $('
').append(posts); - container.append(column); - - mansonry(); - mansonry(); -}); - $(window).resize(function() { clearTimeout(window.resizedFinished); window.resizeFinished = setTimeout(function() { - mansonry(); + masonry(); }, 250); }); -function mansonry() { +var $container = $(".posts"); +function masonry() { + $container.children().remove(); columnCount = Math.floor($(".posts").width() / 250); - console.log("columns: " + columnCount); /* * Initialise columns. */ var columns = new Array(columnCount); + var $columns = new Array(columnCount); for (i = 0; i < columnCount; i++) { - columns[i] = [0, []]; - console.log(columns[i]); + $column = $("").html(this["content"])); - } - - $("div.posts div.column").width(100/columnCount + "%"); -} \ No newline at end of file + shortestColumn = getShortestColumn(columns); + shortestColumn[1].append($post); + shortestColumn[0] = shortestColumn[0] + $post.height() + margin; + }); + }); +} diff --git a/website/public/profile.php b/website/public/profile.php index 6e188c4..1423483 100644 --- a/website/public/profile.php +++ b/website/public/profile.php @@ -2,7 +2,6 @@
- @@ -45,10 +44,25 @@ include("../views/footer.php"); ?> + diff --git a/website/queries/user.php b/website/queries/user.php index 9904eee..7672746 100644 --- a/website/queries/user.php +++ b/website/queries/user.php @@ -126,7 +126,9 @@ function selectAllUserPosts($userID) { "); $stmt->bindParam(':userID', $userID, PDO::PARAM_INT); - $stmt->execute(); + if(!$stmt->execute()) { + return False; + } return $stmt; } diff --git a/website/views/profile.php b/website/views/profile.php index 3719ff1..6b7b283 100644 --- a/website/views/profile.php +++ b/website/views/profile.php @@ -5,7 +5,7 @@ - +=$user["bio"]?>
@@ -43,29 +43,29 @@${post["content"]}
-${nicetime} geplaatst.
-${post["content"]}
+//${nicetime} geplaatst.
+//