diff --git a/website/public/js/header.js b/website/public/js/header.js
index 797c56c..ceb6086 100644
--- a/website/public/js/header.js
+++ b/website/public/js/header.js
@@ -1,7 +1,27 @@
$(document).ready(function() {
+ // Hide notification center.
$("#profile-menu-popup").hide();
+
+ // $("#own-profile-picture").click(function() {
+ // $("#profile-menu-popup").toggle();
+ // $("#profile-hello-popup").toggle();
+ // });
+
$("#own-profile-picture").click(function() {
- $("#profile-menu-popup").toggle();
- $("#profile-hello-popup").toggle();
+ if($("#notification-center").css('right') == "-256px") {
+ // $(".content").animate({
+ // marginRight: "256px"
+ // }, 500);
+ $("#notification-center").animate({
+ right: "0px"
+ }, 500);
+ } else {
+ // $(".content").animate({
+ // marginRight: "0px"
+ // }, 500);
+ $("#notification-center").animate({
+ right: "-256px"
+ }, 500);
+ }
});
});
diff --git a/website/public/search.php b/website/public/search.php
index c314791..6cfadd8 100644
--- a/website/public/search.php
+++ b/website/public/search.php
@@ -1,7 +1,11 @@
-
+
diff --git a/website/public/settings.php b/website/public/settings.php
index d52608b..06d17c0 100644
--- a/website/public/settings.php
+++ b/website/public/settings.php
@@ -29,7 +29,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
break;
case "picture":
updateProfilePicture();
- $result = $notImplemented;
+ $result = new settingsMessage("happy", "Deze melding doet nog niks nuttigs.");
break;
}
}
diff --git a/website/public/styles/header.css b/website/public/styles/header.css
index 84f308c..ddefdec 100644
--- a/website/public/styles/header.css
+++ b/website/public/styles/header.css
@@ -33,32 +33,12 @@ header {
header div {
display: inline-block;
}
-
-#open-chat {
- font-size: 32px;
- line-height: 80px;
- margin-right: 50px;
-}
-
-.profile-menu {
- font-size: 21px;
-}
-
.profile-menu img {
padding: 8px;
height: 64px;
width: 64px;
}
-#own-profile-picture, #profile-menu-popup span {
+#own-profile-picture {
cursor: pointer;
}
-
-#profile-menu-popup {
- padding: 5px;
-
- background: white;
- color: #666;
-
- border-radius: 3px;
-}
diff --git a/website/public/styles/menu.css b/website/public/styles/menu.css
index 4d4b8bb..b9e3904 100644
--- a/website/public/styles/menu.css
+++ b/website/public/styles/menu.css
@@ -42,4 +42,21 @@
height: 100%;
padding: 0;
text-align: left;
+}
+
+#notification-center {
+ left: auto;
+ width: 256px;
+ right: -256px;
+}
+
+#quick-links {
+ text-align: center;
+ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
+}
+
+#quick-links i {
+ color: #845663;
+ font-size: 42px;
+ padding: 7px;
}
\ No newline at end of file
diff --git a/website/public/styles/profile.css b/website/public/styles/profile.css
index af1ed58..9c07242 100644
--- a/website/public/styles/profile.css
+++ b/website/public/styles/profile.css
@@ -10,9 +10,12 @@
margin: 0 20px 20px 0;
}
-.profile-box .profile-username {
+.profile-box h1.profile-username {
padding-top: 50px;
}
+.profile-box h5.profile-username {
+ padding-top: 0;
+}
div.posts {
padding-top: 20px;
@@ -37,23 +40,18 @@ div.posts .post p.subscript {
font-size: 8pt;
}
-/*.posts {*/
- /*z-index: -1;*/
- /*margin-right: 0;*/
- /*width: calc(100% + 15px);*/
-/*}*/
+div.posts .post form input, div.posts .post form textarea {
+ width: calc(100% - 15px);
+}
-/*.post-box {*/
- /*display: inline-flex;*/
- /*margin: 20px 15px 0 0;*/
- /*padding: 25px;*/
- /*background-color: #FFFFFF;*/
-/*}*/
+div.posts .post form input[type="submit"] {
+ width: 100%;
+}
-/*!* fullscreen *!*/
-/*.post-box {*/
- /*width: calc(25% - 69px);*/
-/*}*/
+div.posts .post form textarea.newpost {
+ margin: 15px 0 15px 0;
+ height: 100px;
+}
@media only screen and (max-width: 1500px) {
.post-box {
@@ -68,14 +66,6 @@ div.posts .post p.subscript {
}
}
-.post {
- width: 100%;
-}
-
-.post img {
- width: 100%;
-}
-
.post .post-date {
float: right;
color: #aaaaaa;
diff --git a/website/public/styles/search.css b/website/public/styles/search.css
index 4b2281c..b54723d 100644
--- a/website/public/styles/search.css
+++ b/website/public/styles/search.css
@@ -9,4 +9,9 @@
#search-friends-output {
margin-right: 10px;
+}
+
+.searchleft, .searchright {
+ display: inline-block;
+ vertical-align: top;
}
\ No newline at end of file
diff --git a/website/queries/friendship.php b/website/queries/friendship.php
index 258699f..df6a917 100644
--- a/website/queries/friendship.php
+++ b/website/queries/friendship.php
@@ -15,13 +15,14 @@ function selectAllFriends($userID) {
`user`
INNER JOIN
`friendship`
+
WHERE
(`friendship`.`user1ID` = :userID AND
`friendship`.`user2ID` = `user`.`userID` OR
`friendship`.`user2ID` = :userID AND
`friendship`.`user1ID` = `user`.`userID`) AND
`role` != 5 AND
- `status` = 1
+ `status` = 1
");
$stmt->bindParam(':userID', $userID, PDO::PARAM_INT);
diff --git a/website/queries/group_page.php b/website/queries/group_page.php
index ef7af07..d704e8c 100644
--- a/website/queries/group_page.php
+++ b/website/queries/group_page.php
@@ -172,5 +172,26 @@ function changeMultipleGroupStatusByID($ids, $status) {
return $q;
}
+function searchSomeGroups($n, $m, $search) {
+ $stmt = $GLOBALS["db"]->prepare("
+ SELECT
+ `name`,
+ `picture`
+ FROM
+ `group_page`
+ WHERE
+ `name` LIKE :keyword
+ ORDER BY
+ `name`
+ LIMIT
+ :n, :m
+ ");
-?>
+ $search = "%$search%";
+ $stmt->bindParam(':keyword', $search);
+ $stmt->bindParam(':n', $n, PDO::PARAM_INT);
+ $stmt->bindParam(':m', $m, PDO::PARAM_INT);
+ $stmt->execute();
+ return $stmt;
+}
+?>
\ No newline at end of file
diff --git a/website/queries/settings.php b/website/queries/settings.php
index 7d3bf9c..0e6dff2 100644
--- a/website/queries/settings.php
+++ b/website/queries/settings.php
@@ -188,22 +188,28 @@ function doChangeEmail($email) {
function updateProfilePicture() {
$profilePictureDir = "/var/www/html/public/";
- $relativePath = "uploads/" . $_SESSION["userID"] . "_" . basename($_FILES["pp"]["name"]);
+ $relativePath = "uploads/profilepictures/" . $_SESSION["userID"] . "_" . basename($_FILES["pp"]["name"]);
+// removeOldProfilePicture();
move_uploaded_file($_FILES['pp']['tmp_name'], $profilePictureDir . $relativePath);
setProfilePictureToDatabase("../" . $relativePath);
}
+//function removeOldProfilePicture() {
+//
+// unlink("/var/www/html/public/uploads/profilepictures/" . $_SESSION["userID"] . "_*");
+//}
+
function setProfilePictureToDatabase($url) {
$stmt = $GLOBALS["db"]->prepare("
UPDATE
`user`
SET
- `profilepicture` = :profilepicture
+ `profilepicture` = :profilePicture
WHERE
`userID` = :userID
");
- $stmt->bindParam(":profilepicture", $url);
+ $stmt->bindParam(":profilePicture", $url);
$stmt->bindParam(":userID", $_SESSION["userID"]);
$stmt->execute();
}
\ No newline at end of file
diff --git a/website/queries/user.php b/website/queries/user.php
index 398e2e4..114d673 100644
--- a/website/queries/user.php
+++ b/website/queries/user.php
@@ -252,12 +252,12 @@ function selectRandomNotFriendUser($userID) {
FROM
`user`
WHERE
- `userID` NOT IN (SELECT
+ `userID` NOT IN (SELECT
`user1ID`
FROM
`friendship`
WHERE `user1ID` = :userID) OR
- `userID` NOT IN (SELECT
+ `userID` NOT IN (SELECT
`user2ID`
FROM
`friendship`
@@ -271,4 +271,33 @@ function selectRandomNotFriendUser($userID) {
$stmt->bindParam(':userID', $userID, PDO::PARAM_INT);
$stmt->execute();
return $stmt->fetch();
-}
\ No newline at end of file
+}
+
+function searchSomeUsers($n, $m, $search) {
+ $stmt = $GLOBALS["db"]->prepare("
+ SELECT
+ `username`,
+ `profilepicture`,
+ `fname`,
+ `lname`
+ FROM
+ `user`
+ WHERE
+ `username` LIKE :keyword OR
+ `fname` LIKE :keyword OR
+ `lname` LIKE :keyword
+ ORDER BY
+ `fname`,
+ `lname`,
+ `username`
+ LIMIT
+ :n, :m
+ ");
+
+ $search = "%$search%";
+ $stmt->bindParam(':keyword', $search);
+ $stmt->bindParam(':n', $n, PDO::PARAM_INT);
+ $stmt->bindParam(':m', $m, PDO::PARAM_INT);
+ $stmt->execute();
+ return $stmt;
+}
diff --git a/website/views/header.php b/website/views/header.php
index 2a1f580..0637818 100644
--- a/website/views/header.php
+++ b/website/views/header.php
@@ -19,11 +19,6 @@ $userinfo = getHeaderInfo();
@@ -13,7 +14,7 @@
fetch()) {
- echo "
";
+ echo "
";
}
@@ -29,7 +30,7 @@
fetch()) {
- echo "
";
+ echo "
";
}
if($profile_groups->rowCount() === 0) {
@@ -41,6 +42,18 @@
+
+
+
+ fetch()) {
$nicetime = nicetime($post["creationdate"]);
echo "
diff --git a/website/views/search-view.php b/website/views/search-view.php
index b1418d1..0d650d4 100644
--- a/website/views/search-view.php
+++ b/website/views/search-view.php
@@ -1,3 +1,16 @@
+
+