Merge branch 'master' into joey-testing
This commit is contained in:
@@ -1,7 +1,27 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
// Hide notification center.
|
||||||
$("#profile-menu-popup").hide();
|
$("#profile-menu-popup").hide();
|
||||||
|
|
||||||
|
// $("#own-profile-picture").click(function() {
|
||||||
|
// $("#profile-menu-popup").toggle();
|
||||||
|
// $("#profile-hello-popup").toggle();
|
||||||
|
// });
|
||||||
|
|
||||||
$("#own-profile-picture").click(function() {
|
$("#own-profile-picture").click(function() {
|
||||||
$("#profile-menu-popup").toggle();
|
if($("#notification-center").css('right') == "-256px") {
|
||||||
$("#profile-hello-popup").toggle();
|
// $(".content").animate({
|
||||||
|
// marginRight: "256px"
|
||||||
|
// }, 500);
|
||||||
|
$("#notification-center").animate({
|
||||||
|
right: "0px"
|
||||||
|
}, 500);
|
||||||
|
} else {
|
||||||
|
// $(".content").animate({
|
||||||
|
// marginRight: "0px"
|
||||||
|
// }, 500);
|
||||||
|
$("#notification-center").animate({
|
||||||
|
right: "-256px"
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<?php include("../views/head.php"); ?>
|
<?php
|
||||||
|
include_once("../queries/user.php");
|
||||||
|
include_once("../queries/group_page.php");
|
||||||
|
include("../views/head.php");
|
||||||
|
?>
|
||||||
<style>
|
<style>
|
||||||
@import url("styles/search.css");
|
@import url("styles/search.css");
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
break;
|
break;
|
||||||
case "picture":
|
case "picture":
|
||||||
updateProfilePicture();
|
updateProfilePicture();
|
||||||
$result = $notImplemented;
|
$result = new settingsMessage("happy", "Deze melding doet nog niks nuttigs.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,32 +33,12 @@ header {
|
|||||||
header div {
|
header div {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
#open-chat {
|
|
||||||
font-size: 32px;
|
|
||||||
line-height: 80px;
|
|
||||||
margin-right: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.profile-menu {
|
|
||||||
font-size: 21px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.profile-menu img {
|
.profile-menu img {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
width: 64px;
|
width: 64px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#own-profile-picture, #profile-menu-popup span {
|
#own-profile-picture {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#profile-menu-popup {
|
|
||||||
padding: 5px;
|
|
||||||
|
|
||||||
background: white;
|
|
||||||
color: #666;
|
|
||||||
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -43,3 +43,20 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
text-align: left;
|
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;
|
||||||
|
}
|
||||||
@@ -10,9 +10,12 @@
|
|||||||
margin: 0 20px 20px 0;
|
margin: 0 20px 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-box .profile-username {
|
.profile-box h1.profile-username {
|
||||||
padding-top: 50px;
|
padding-top: 50px;
|
||||||
}
|
}
|
||||||
|
.profile-box h5.profile-username {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
div.posts {
|
div.posts {
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
@@ -37,23 +40,18 @@ div.posts .post p.subscript {
|
|||||||
font-size: 8pt;
|
font-size: 8pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*.posts {*/
|
div.posts .post form input, div.posts .post form textarea {
|
||||||
/*z-index: -1;*/
|
width: calc(100% - 15px);
|
||||||
/*margin-right: 0;*/
|
}
|
||||||
/*width: calc(100% + 15px);*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
/*.post-box {*/
|
div.posts .post form input[type="submit"] {
|
||||||
/*display: inline-flex;*/
|
width: 100%;
|
||||||
/*margin: 20px 15px 0 0;*/
|
}
|
||||||
/*padding: 25px;*/
|
|
||||||
/*background-color: #FFFFFF;*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
/*!* fullscreen *!*/
|
div.posts .post form textarea.newpost {
|
||||||
/*.post-box {*/
|
margin: 15px 0 15px 0;
|
||||||
/*width: calc(25% - 69px);*/
|
height: 100px;
|
||||||
/*}*/
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 1500px) {
|
@media only screen and (max-width: 1500px) {
|
||||||
.post-box {
|
.post-box {
|
||||||
@@ -68,14 +66,6 @@ div.posts .post p.subscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post img {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post .post-date {
|
.post .post-date {
|
||||||
float: right;
|
float: right;
|
||||||
color: #aaaaaa;
|
color: #aaaaaa;
|
||||||
|
|||||||
@@ -10,3 +10,8 @@
|
|||||||
#search-friends-output {
|
#search-friends-output {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.searchleft, .searchright {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ function selectAllFriends($userID) {
|
|||||||
`user`
|
`user`
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
`friendship`
|
`friendship`
|
||||||
|
|
||||||
WHERE
|
WHERE
|
||||||
(`friendship`.`user1ID` = :userID AND
|
(`friendship`.`user1ID` = :userID AND
|
||||||
`friendship`.`user2ID` = `user`.`userID` OR
|
`friendship`.`user2ID` = `user`.`userID` OR
|
||||||
|
|||||||
@@ -172,5 +172,26 @@ function changeMultipleGroupStatusByID($ids, $status) {
|
|||||||
return $q;
|
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;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
@@ -188,22 +188,28 @@ function doChangeEmail($email) {
|
|||||||
|
|
||||||
function updateProfilePicture() {
|
function updateProfilePicture() {
|
||||||
$profilePictureDir = "/var/www/html/public/";
|
$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);
|
move_uploaded_file($_FILES['pp']['tmp_name'], $profilePictureDir . $relativePath);
|
||||||
setProfilePictureToDatabase("../" . $relativePath);
|
setProfilePictureToDatabase("../" . $relativePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//function removeOldProfilePicture() {
|
||||||
|
//
|
||||||
|
// unlink("/var/www/html/public/uploads/profilepictures/" . $_SESSION["userID"] . "_*");
|
||||||
|
//}
|
||||||
|
|
||||||
function setProfilePictureToDatabase($url) {
|
function setProfilePictureToDatabase($url) {
|
||||||
$stmt = $GLOBALS["db"]->prepare("
|
$stmt = $GLOBALS["db"]->prepare("
|
||||||
UPDATE
|
UPDATE
|
||||||
`user`
|
`user`
|
||||||
SET
|
SET
|
||||||
`profilepicture` = :profilepicture
|
`profilepicture` = :profilePicture
|
||||||
WHERE
|
WHERE
|
||||||
`userID` = :userID
|
`userID` = :userID
|
||||||
");
|
");
|
||||||
|
|
||||||
$stmt->bindParam(":profilepicture", $url);
|
$stmt->bindParam(":profilePicture", $url);
|
||||||
$stmt->bindParam(":userID", $_SESSION["userID"]);
|
$stmt->bindParam(":userID", $_SESSION["userID"]);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
}
|
||||||
@@ -272,3 +272,32 @@ function selectRandomNotFriendUser($userID) {
|
|||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
return $stmt->fetch();
|
return $stmt->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,11 +19,6 @@ $userinfo = getHeaderInfo();
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="right profile-menu">
|
<div class="right profile-menu">
|
||||||
<div id="profile-menu-popup">
|
|
||||||
<a href="/logout"><span style="color: red;" class="fa fa-sign-out" data-title="Uitloggen"></span></a> |
|
|
||||||
<a href="/settings"><span style="color: blue;" class="fa fa-cog" data-title="Instellingen"></span></a> |
|
|
||||||
<a href="/profile"><span style="color: green;" class="fa fa-user" data-title="Profiel"></span></a>
|
|
||||||
</div>
|
|
||||||
<div id="profile-hello-popup">
|
<div id="profile-hello-popup">
|
||||||
<div id="hello-loop">
|
<div id="hello-loop">
|
||||||
Hallo
|
Hallo
|
||||||
@@ -32,5 +27,6 @@ $userinfo = getHeaderInfo();
|
|||||||
</div>
|
</div>
|
||||||
<img id="own-profile-picture" class="profile-picture" src="<?=$userinfo["profilepicture"]?>"/>
|
<img id="own-profile-picture" class="profile-picture" src="<?=$userinfo["profilepicture"]?>"/>
|
||||||
</div>
|
</div>
|
||||||
<a href="/chat"><div class="right fa fa-comments-o" id="open-chat" data-title="Prive chats"></div></a>
|
|
||||||
</header>
|
</header>
|
||||||
|
<?php include("notification-center.php"); ?>
|
||||||
|
|
||||||
|
|||||||
11
website/views/notification-center.php
Normal file
11
website/views/notification-center.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<nav class="menu" id="notification-center">
|
||||||
|
<section id="quick-links">
|
||||||
|
<a href="chat.php"><i class="fa fa-comments-o" data-title="Prive chats"></i></a>
|
||||||
|
<a href="settings.php"><i class="fa fa-cog" data-title="Instellingen"></i></a>
|
||||||
|
<a href="profile.php"><i class="fa fa-user" data-title="Profiel"></i></a>
|
||||||
|
<a href="logout.php"><i class="fa fa-sign-out" data-title="Uitloggen"></i></a>
|
||||||
|
</section>
|
||||||
|
<section id="not">
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</nav>
|
||||||
@@ -4,7 +4,8 @@
|
|||||||
<div class="profile-button">
|
<div class="profile-button">
|
||||||
<p><img src="/img/add-friend.png"> Als vriend toevoegen</p>
|
<p><img src="/img/add-friend.png"> Als vriend toevoegen</p>
|
||||||
</div>
|
</div>
|
||||||
<h1 class="profile-username"><?= $user["fname"]?> <?=$user["lname"]?> (<?=$user["username"]?>)</h1>
|
<h1 class="profile-username"><?=$user["username"]?></h1>
|
||||||
|
<h5 class="profile-username"><?= $user["fname"]?> <?=$user["lname"]?></h5>
|
||||||
<p><?=$user["bio"]?></p>
|
<p><?=$user["bio"]?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -13,7 +14,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
while($friend = $profile_friends->fetch()) {
|
while($friend = $profile_friends->fetch()) {
|
||||||
echo "<a href='profile/${friend["username"]}/' data-title='${friend["username"]}'><img class='profile-picture' src='${friend["profilepicture"]}' alt='${friend["username"]}'s profielfoto></a>";
|
echo "<a href='/profile/${friend["username"]}/' data-title='${friend["username"]}'><img class='profile-picture' src='${friend["profilepicture"]}' alt='${friend["username"]}'s profielfoto></a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
while($group = $profile_groups->fetch()) {
|
while($group = $profile_groups->fetch()) {
|
||||||
echo "<a href='group/${group["name"]}/' data-title='${group["name"]}'><img class='group-picture' src='${group["picture"]}' alt='${group["name"]}s logo'></a>";
|
echo "<a href='/group/${group["name"]}/' data-title='${group["name"]}'><img class='group-picture' src='${group["picture"]}' alt='${group["name"]}s logo'></a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($profile_groups->rowCount() === 0) {
|
if($profile_groups->rowCount() === 0) {
|
||||||
@@ -41,6 +42,18 @@
|
|||||||
|
|
||||||
<div class="posts">
|
<div class="posts">
|
||||||
<?php
|
<?php
|
||||||
|
if ($_SESSION["userID"] === $userID) {
|
||||||
|
?>
|
||||||
|
<div class="post platform">
|
||||||
|
<form>
|
||||||
|
<input type="text" class="newpost" placeholder="Titel">
|
||||||
|
<textarea class="newpost">Schrijf een berichtje...</textarea>
|
||||||
|
<input type="submit" value="Plaats!">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
while($post = $posts->fetch()) {
|
while($post = $posts->fetch()) {
|
||||||
$nicetime = nicetime($post["creationdate"]);
|
$nicetime = nicetime($post["creationdate"]);
|
||||||
echo "
|
echo "
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user