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($("<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;

View File

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

View File

@@ -56,5 +56,5 @@
}
.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);
}
div.posts .post form input[type="submit"] {
div.posts .post form input[type="submit"], .post button{
width: 100%;
}

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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"])) {

View File

@@ -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"