diff --git a/website/public/group.php b/website/public/group.php
index ee20feb..fa45090 100644
--- a/website/public/group.php
+++ b/website/public/group.php
@@ -8,6 +8,17 @@
+
+
+"));
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($("
").text(this["title"]));
+ $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/group_page.php b/website/queries/group_page.php
index f3de045..91ed550 100644
--- a/website/queries/group_page.php
+++ b/website/queries/group_page.php
@@ -1,5 +1,58 @@
prepare("
+ SELECT
+ `group_page`.`groupID`,
+ `name`,
+ `description`,
+ `picture`,
+ `status`,
+ COUNT(`group_member`.`groupID`) as `members`
+ FROM
+ `group_page`
+ LEFT JOIN
+ `group_member`
+ ON
+ `group_page`.`groupID` = `group_member`.`groupID`
+ WHERE
+ name LIKE :name
+ ");
+
+ $stmt->bindParam(':name', $name);
+ if (!$stmt->execute()) {
+ return False;
+ }
+ return $stmt->fetch();
+}
+
+function selectGroupMembers(int $groupID) {
+ $stmt = $GLOBALS["db"]->prepare("
+ SELECT
+ `username`,
+ `fname`,
+ `lname`,
+ `profilepicture`
+ FROM
+ `group_member`
+ LEFT JOIN
+ `user`
+ ON
+ `group_member`.`userID` = `user`.`userID`
+ WHERE
+ `groupID` = :groupID
+ LIMIT 20
+ ");
+
+ $stmt->bindParam(':groupID', $groupID);
+ if (!$stmt->execute()) {
+ return False;
+ }
+ return $stmt->fetchAll();
+}
+
function selectGroupById($groupID) {
$q = $GLOBALS["db"]->prepare("
SELECT
diff --git a/website/queries/user.php b/website/queries/user.php
index 3b0c4a8..b9ba986 100644
--- a/website/queries/user.php
+++ b/website/queries/user.php
@@ -106,24 +106,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);
diff --git a/website/views/group.php b/website/views/group.php
index c8ed118..b2098c7 100644
--- a/website/views/group.php
+++ b/website/views/group.php
@@ -1,43 +1,21 @@