Compare commits
6 Commits
marijn-pos
...
marijn-set
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04df02862f | ||
|
|
e299ef59e8 | ||
|
|
12d5e00731 | ||
|
|
eb8eb5bf03 | ||
|
|
022893aca2 | ||
|
|
3c79d86abd |
@@ -120,7 +120,7 @@ function masonry(mode) {
|
||||
|
||||
$form.append($("<input class=\"newpost\" name=\"title\" placeholder=\"Titel\" type=\"text\">"));
|
||||
$form.append($("<textarea class=\"newpost\" name=\"content\" placeholder=\"Schrijf een berichtje...\" maxlength='1000'></textarea><span></span>"));
|
||||
$form.append($("<input value=\"Plaats!\" type=\"submit\">"));
|
||||
$form.append($("<button type=\"submit\"><i class='fa fa-sticky-note-o'></i> Plaats!</button>"));
|
||||
columns[0][1].append($postInput);
|
||||
|
||||
columns[0][0] = $postInput.height() + margin;
|
||||
|
||||
@@ -34,6 +34,4 @@ function deletePost(postID) {
|
||||
});
|
||||
closeModal();
|
||||
masonry(masonryMode);
|
||||
|
||||
|
||||
}
|
||||
@@ -56,5 +56,5 @@
|
||||
}
|
||||
|
||||
.bancommentform input[type="text"] {
|
||||
width: 100%;
|
||||
width: 80%;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ div.posts .post form input, div.posts .post form textarea {
|
||||
width: calc(100% - 15px);
|
||||
}
|
||||
|
||||
div.posts .post form input[type="submit"] {
|
||||
div.posts .post form input[type="submit"], .post button{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,9 @@ function search20GroupsFromNByStatus($n, $keyword, $status) {
|
||||
return $q;
|
||||
}
|
||||
|
||||
function searchSomeGroupsByStatus($n, $m, $keyword, $status) {
|
||||
function searchSomeGroupsByStatus($n, $m, $search, $status) {
|
||||
// parentheses not needed in where clause, for clarity as
|
||||
// role search should override status filter.
|
||||
$q = prepareQuery("
|
||||
SELECT
|
||||
`groupID`,
|
||||
@@ -203,16 +205,18 @@ function searchSomeGroupsByStatus($n, $m, $keyword, $status) {
|
||||
FROM
|
||||
`group_page`
|
||||
WHERE
|
||||
`name` LIKE :keyword AND
|
||||
FIND_IN_SET (`status`, :statuses)
|
||||
(`name` LIKE :keyword AND
|
||||
FIND_IN_SET (`status`, :statuses)) OR
|
||||
`status` = :search
|
||||
ORDER BY
|
||||
`name`
|
||||
LIMIT
|
||||
:n, :m
|
||||
");
|
||||
|
||||
$keyword = "%$keyword%";
|
||||
$keyword = "%$search%";
|
||||
$q->bindParam(':keyword', $keyword);
|
||||
$q->bindParam(':search', $search);
|
||||
$q->bindParam(':n', $n, PDO::PARAM_INT);
|
||||
$q->bindParam(':m', $m, PDO::PARAM_INT);
|
||||
$statuses = implode(',', $status);
|
||||
@@ -221,21 +225,23 @@ function searchSomeGroupsByStatus($n, $m, $keyword, $status) {
|
||||
return $q;
|
||||
}
|
||||
|
||||
function countSomeGroupsByStatus($keyword, $status) {
|
||||
function countSomeGroupsByStatus($search, $status) {
|
||||
$q = prepareQuery("
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
`group_page`
|
||||
WHERE
|
||||
`name` LIKE :keyword AND
|
||||
FIND_IN_SET (`status`, :statuses)
|
||||
(`name` LIKE :keyword AND
|
||||
FIND_IN_SET (`status`, :statuses)) OR
|
||||
`status` = :search
|
||||
ORDER BY
|
||||
`name`
|
||||
");
|
||||
|
||||
$keyword = "%$keyword%";
|
||||
$keyword = "%$search%";
|
||||
$q->bindParam(':keyword', $keyword);
|
||||
$q->bindParam(':search', $search);
|
||||
$statuses = implode(',', $status);
|
||||
$q->bindParam(':statuses', $statuses);
|
||||
$q->execute();
|
||||
|
||||
@@ -18,7 +18,8 @@ function getSettings() {
|
||||
`bio`,
|
||||
`profilepicture`,
|
||||
`showBday`,
|
||||
`showEmail`
|
||||
`showEmail`,
|
||||
`showProfile`
|
||||
FROM
|
||||
`user`
|
||||
WHERE
|
||||
@@ -64,7 +65,8 @@ function updateSettings() {
|
||||
`birthdate` = :bday,
|
||||
`bio` = :bio,
|
||||
`showEmail` = :showEmail,
|
||||
`showBday` = :showBday
|
||||
`showBday` = :showBday,
|
||||
`showProfile` = :showProfile
|
||||
WHERE
|
||||
`userID` = :userID
|
||||
");
|
||||
@@ -79,6 +81,7 @@ function updateSettings() {
|
||||
$stmt->bindValue(":bio", test_input($_POST["bio"]));
|
||||
$stmt->bindValue(":showEmail", (array_key_exists("showEmail", $_POST) ? "1" : "0"));
|
||||
$stmt->bindValue(":showBday", (array_key_exists("showBday", $_POST) ? "1" : "0"));
|
||||
$stmt->bindValue(":showProfile", (array_key_exists("showProfile", $_POST) ? "1" : "0"));
|
||||
|
||||
$stmt->bindValue(":userID", $_SESSION["userID"]);
|
||||
$stmt->execute();
|
||||
|
||||
@@ -205,7 +205,9 @@ function search20UsersFromNByStatus($n, $keyword, $status) {
|
||||
return $q;
|
||||
}
|
||||
|
||||
function searchSomeUsersByStatus($n, $m, $keyword, $status) {
|
||||
function searchSomeUsersByStatus($n, $m, $search, $status) {
|
||||
// parentheses not needed in where clause, for clarity as
|
||||
// role search should override status filter.
|
||||
$q = prepareQuery("
|
||||
SELECT
|
||||
`userID`,
|
||||
@@ -219,8 +221,9 @@ function searchSomeUsersByStatus($n, $m, $keyword, $status) {
|
||||
FROM
|
||||
`user`
|
||||
WHERE
|
||||
`username` LIKE :keyword AND
|
||||
FIND_IN_SET (`role`, :statuses)
|
||||
(`username` LIKE :keyword AND
|
||||
FIND_IN_SET (`role`, :statuses)) OR
|
||||
`role` = :search
|
||||
ORDER BY
|
||||
`role`,
|
||||
`username`
|
||||
@@ -228,8 +231,9 @@ function searchSomeUsersByStatus($n, $m, $keyword, $status) {
|
||||
:n, :m
|
||||
");
|
||||
|
||||
$keyword = "%$keyword%";
|
||||
$keyword = "%$search%";
|
||||
$q->bindParam(':keyword', $keyword);
|
||||
$q->bindParam(':search', $search);
|
||||
$q->bindParam(':n', $n, PDO::PARAM_INT);
|
||||
$q->bindParam(':m', $m, PDO::PARAM_INT);
|
||||
$statuses = implode(',', $status);
|
||||
@@ -238,22 +242,24 @@ function searchSomeUsersByStatus($n, $m, $keyword, $status) {
|
||||
return $q;
|
||||
}
|
||||
|
||||
function countSomeUsersByStatus($keyword, $status) {
|
||||
function countSomeUsersByStatus($search, $status) {
|
||||
$q = prepareQuery("
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
`user`
|
||||
WHERE
|
||||
`username` LIKE :keyword AND
|
||||
FIND_IN_SET (`role`, :statuses)
|
||||
(`username` LIKE :keyword AND
|
||||
FIND_IN_SET (`role`, :statuses)) OR
|
||||
`role` = :search
|
||||
ORDER BY
|
||||
`role`,
|
||||
`username`
|
||||
");
|
||||
|
||||
$keyword = "%$keyword%";
|
||||
$keyword = "%$search%";
|
||||
$q->bindParam(':keyword', $keyword);
|
||||
$q->bindParam(':search', $search);
|
||||
$statuses = implode(',', $status);
|
||||
$q->bindParam(':statuses', $statuses);
|
||||
$q->execute();
|
||||
|
||||
@@ -30,7 +30,7 @@ $fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . "
|
||||
<form id="newcommentform" onsubmit="return false;">
|
||||
<input type="hidden" id="newcomment-textarea" name="postID" value="<?= $postID ?>">
|
||||
<textarea id="newcomment" name="newcomment-content" placeholder="Laat een reactie achter..." maxlength="1000"></textarea><span></span> <br>
|
||||
<button onclick="postComment('reaction')" name="button" value="reaction">Reageer!</button>
|
||||
<button onclick="postComment('reaction')" name="button" value="reaction" class="green"><i class="fa fa-comment"></i> Reageer!</button>
|
||||
<button onclick="postComment('nietslecht')" name="button" value="nietslecht" class="nietslecht">
|
||||
<?php
|
||||
if (checkNietSlecht($postID, $_SESSION["userID"])) {
|
||||
|
||||
@@ -96,6 +96,14 @@ $settings = getSettings();
|
||||
<?=($settings["showEmail"] ? "checked" : "")?>
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<label for="showProfile">Publiek profiel</label>
|
||||
<input type="checkbox"
|
||||
name="showProfile"
|
||||
id="showProfile"
|
||||
<?=($settings["showProfile"] ? "checked" : "")?>
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<label for="bio">Bio</label>
|
||||
<textarea name="bio"
|
||||
|
||||
Reference in New Issue
Block a user