Added show profile into settings

This commit is contained in:
Marijn Jansen
2017-02-02 10:28:12 +01:00
parent 12d5e00731
commit e299ef59e8
3 changed files with 13 additions and 4 deletions

View File

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

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

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