6 Commits

Author SHA1 Message Date
Marijn Jansen
04df02862f More Awesome Fonts :D 2017-02-02 10:52:42 +01:00
Marijn Jansen
e299ef59e8 Added show profile into settings 2017-02-02 10:28:12 +01:00
Lars van Hijfte
12d5e00731 Merge branch 'hendrik-testing' into 'master'
Hendrik testing

See merge request !173
2017-02-01 14:52:03 +01:00
Marijn Jansen
eb8eb5bf03 Merge branch 'marijn-postdelete' into 'master'
Double session_start fixed :D

See merge request !176
2017-02-01 14:46:31 +01:00
Hendrik
022893aca2 Merge branch 'master' into hendrik-testing 2017-02-01 14:24:27 +01:00
Hendrik
3c79d86abd add admin search by role 2017-02-01 11:33:34 +01:00
9 changed files with 45 additions and 24 deletions

View File

@@ -120,7 +120,7 @@ function masonry(mode) {
$form.append($("<input class=\"newpost\" name=\"title\" placeholder=\"Titel\" type=\"text\">")); $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($("<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][1].append($postInput);
columns[0][0] = $postInput.height() + margin; columns[0][0] = $postInput.height() + margin;

View File

@@ -34,6 +34,4 @@ function deletePost(postID) {
}); });
closeModal(); closeModal();
masonry(masonryMode); masonry(masonryMode);
} }

View File

@@ -56,5 +56,5 @@
} }
.bancommentform input[type="text"] { .bancommentform input[type="text"] {
width: 100%; width: 80%;
} }

View File

@@ -108,7 +108,7 @@ div.posts .post form input, div.posts .post form textarea {
width: calc(100% - 15px); width: calc(100% - 15px);
} }
div.posts .post form input[type="submit"] { div.posts .post form input[type="submit"], .post button{
width: 100%; width: 100%;
} }

View File

@@ -193,7 +193,9 @@ function search20GroupsFromNByStatus($n, $keyword, $status) {
return $q; 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(" $q = prepareQuery("
SELECT SELECT
`groupID`, `groupID`,
@@ -203,16 +205,18 @@ function searchSomeGroupsByStatus($n, $m, $keyword, $status) {
FROM FROM
`group_page` `group_page`
WHERE WHERE
`name` LIKE :keyword AND (`name` LIKE :keyword AND
FIND_IN_SET (`status`, :statuses) FIND_IN_SET (`status`, :statuses)) OR
`status` = :search
ORDER BY ORDER BY
`name` `name`
LIMIT LIMIT
:n, :m :n, :m
"); ");
$keyword = "%$keyword%"; $keyword = "%$search%";
$q->bindParam(':keyword', $keyword); $q->bindParam(':keyword', $keyword);
$q->bindParam(':search', $search);
$q->bindParam(':n', $n, PDO::PARAM_INT); $q->bindParam(':n', $n, PDO::PARAM_INT);
$q->bindParam(':m', $m, PDO::PARAM_INT); $q->bindParam(':m', $m, PDO::PARAM_INT);
$statuses = implode(',', $status); $statuses = implode(',', $status);
@@ -221,21 +225,23 @@ function searchSomeGroupsByStatus($n, $m, $keyword, $status) {
return $q; return $q;
} }
function countSomeGroupsByStatus($keyword, $status) { function countSomeGroupsByStatus($search, $status) {
$q = prepareQuery(" $q = prepareQuery("
SELECT SELECT
COUNT(*) COUNT(*)
FROM FROM
`group_page` `group_page`
WHERE WHERE
`name` LIKE :keyword AND (`name` LIKE :keyword AND
FIND_IN_SET (`status`, :statuses) FIND_IN_SET (`status`, :statuses)) OR
`status` = :search
ORDER BY ORDER BY
`name` `name`
"); ");
$keyword = "%$keyword%"; $keyword = "%$search%";
$q->bindParam(':keyword', $keyword); $q->bindParam(':keyword', $keyword);
$q->bindParam(':search', $search);
$statuses = implode(',', $status); $statuses = implode(',', $status);
$q->bindParam(':statuses', $statuses); $q->bindParam(':statuses', $statuses);
$q->execute(); $q->execute();

View File

@@ -18,7 +18,8 @@ function getSettings() {
`bio`, `bio`,
`profilepicture`, `profilepicture`,
`showBday`, `showBday`,
`showEmail` `showEmail`,
`showProfile`
FROM FROM
`user` `user`
WHERE WHERE
@@ -64,7 +65,8 @@ function updateSettings() {
`birthdate` = :bday, `birthdate` = :bday,
`bio` = :bio, `bio` = :bio,
`showEmail` = :showEmail, `showEmail` = :showEmail,
`showBday` = :showBday `showBday` = :showBday,
`showProfile` = :showProfile
WHERE WHERE
`userID` = :userID `userID` = :userID
"); ");
@@ -79,6 +81,7 @@ function updateSettings() {
$stmt->bindValue(":bio", test_input($_POST["bio"])); $stmt->bindValue(":bio", test_input($_POST["bio"]));
$stmt->bindValue(":showEmail", (array_key_exists("showEmail", $_POST) ? "1" : "0")); $stmt->bindValue(":showEmail", (array_key_exists("showEmail", $_POST) ? "1" : "0"));
$stmt->bindValue(":showBday", (array_key_exists("showBday", $_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->bindValue(":userID", $_SESSION["userID"]);
$stmt->execute(); $stmt->execute();

View File

@@ -205,7 +205,9 @@ function search20UsersFromNByStatus($n, $keyword, $status) {
return $q; 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(" $q = prepareQuery("
SELECT SELECT
`userID`, `userID`,
@@ -219,8 +221,9 @@ function searchSomeUsersByStatus($n, $m, $keyword, $status) {
FROM FROM
`user` `user`
WHERE WHERE
`username` LIKE :keyword AND (`username` LIKE :keyword AND
FIND_IN_SET (`role`, :statuses) FIND_IN_SET (`role`, :statuses)) OR
`role` = :search
ORDER BY ORDER BY
`role`, `role`,
`username` `username`
@@ -228,8 +231,9 @@ function searchSomeUsersByStatus($n, $m, $keyword, $status) {
:n, :m :n, :m
"); ");
$keyword = "%$keyword%"; $keyword = "%$search%";
$q->bindParam(':keyword', $keyword); $q->bindParam(':keyword', $keyword);
$q->bindParam(':search', $search);
$q->bindParam(':n', $n, PDO::PARAM_INT); $q->bindParam(':n', $n, PDO::PARAM_INT);
$q->bindParam(':m', $m, PDO::PARAM_INT); $q->bindParam(':m', $m, PDO::PARAM_INT);
$statuses = implode(',', $status); $statuses = implode(',', $status);
@@ -238,22 +242,24 @@ function searchSomeUsersByStatus($n, $m, $keyword, $status) {
return $q; return $q;
} }
function countSomeUsersByStatus($keyword, $status) { function countSomeUsersByStatus($search, $status) {
$q = prepareQuery(" $q = prepareQuery("
SELECT SELECT
COUNT(*) COUNT(*)
FROM FROM
`user` `user`
WHERE WHERE
`username` LIKE :keyword AND (`username` LIKE :keyword AND
FIND_IN_SET (`role`, :statuses) FIND_IN_SET (`role`, :statuses)) OR
`role` = :search
ORDER BY ORDER BY
`role`, `role`,
`username` `username`
"); ");
$keyword = "%$keyword%"; $keyword = "%$search%";
$q->bindParam(':keyword', $keyword); $q->bindParam(':keyword', $keyword);
$q->bindParam(':search', $search);
$statuses = implode(',', $status); $statuses = implode(',', $status);
$q->bindParam(':statuses', $statuses); $q->bindParam(':statuses', $statuses);
$q->execute(); $q->execute();

View File

@@ -30,7 +30,7 @@ $fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . "
<form id="newcommentform" onsubmit="return false;"> <form id="newcommentform" onsubmit="return false;">
<input type="hidden" id="newcomment-textarea" name="postID" value="<?= $postID ?>"> <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> <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"> <button onclick="postComment('nietslecht')" name="button" value="nietslecht" class="nietslecht">
<?php <?php
if (checkNietSlecht($postID, $_SESSION["userID"])) { if (checkNietSlecht($postID, $_SESSION["userID"])) {

View File

@@ -96,6 +96,14 @@ $settings = getSettings();
<?=($settings["showEmail"] ? "checked" : "")?> <?=($settings["showEmail"] ? "checked" : "")?>
> >
</li> </li>
<li>
<label for="showProfile">Publiek profiel</label>
<input type="checkbox"
name="showProfile"
id="showProfile"
<?=($settings["showProfile"] ? "checked" : "")?>
>
</li>
<li> <li>
<label for="bio">Bio</label> <label for="bio">Bio</label>
<textarea name="bio" <textarea name="bio"