From 1acad8e7654004d840fa6f76fedf214a90cba0e5 Mon Sep 17 00:00:00 2001 From: "K. Nobel" Date: Mon, 30 Jan 2017 15:28:54 +0100 Subject: [PATCH] modified masonry and posts, masonry is now reusable on group pages. --- website/public/API/getPosts.php | 12 +++-- website/public/API/postComment.php | 2 +- website/public/js/masonry.js | 2 +- website/public/js/post.js | 4 +- website/queries/group_page.php | 3 +- website/queries/post.php | 46 +++++++++++++++++ website/queries/user.php | 82 +++++++++++++++--------------- 7 files changed, 101 insertions(+), 50 deletions(-) diff --git a/website/public/API/getPosts.php b/website/public/API/getPosts.php index eef8261..620a707 100644 --- a/website/public/API/getPosts.php +++ b/website/public/API/getPosts.php @@ -1,13 +1,17 @@ = 150 AND `post`.`content` NOT LIKE 'bindParam(':userID', $userID, PDO::PARAM_INT); + $stmt->bindParam(':groupID', $groupID , PDO::PARAM_INT); + if(!$stmt->execute()) { + return False; + } + return $stmt; + +} + function selectPostById($postID) { $stmt = prepareQuery(" SELECT diff --git a/website/queries/user.php b/website/queries/user.php index ec211c0..e3bf758 100644 --- a/website/queries/user.php +++ b/website/queries/user.php @@ -103,47 +103,47 @@ function selectAllUserGroups($userID) { return $stmt; } -function selectAllUserPosts($userID) { - $stmt = prepareQuery(" - SELECT - `post`.`postID`, - `post`.`author`, - `title`, - CASE LENGTH(`post`.`content`) >= 150 AND `post`.`content` NOT LIKE 'bindParam(':userID', $userID, PDO::PARAM_INT); - if(!$stmt->execute()) { - return False; - } - return $stmt; -} +//function selectAllUserPosts($userID) { +// $stmt = prepareQuery(" +// SELECT +// `post`.`postID`, +// `post`.`author`, +// `title`, +// CASE LENGTH(`post`.`content`) >= 150 AND `post`.`content` NOT LIKE 'bindParam(':userID', $userID, PDO::PARAM_INT); +// if(!$stmt->execute()) { +// return False; +// } +// return $stmt; +//} function select20UsersFromN($n) { $q = prepareQuery("