Lars chat #107

Merged
11291680 merged 11 commits from lars-chat into master 2017-01-24 14:30:12 +01:00
26 changed files with 302 additions and 130 deletions
Showing only changes of commit 2ff23ae668 - Show all commits

View File

@@ -1,6 +1,7 @@
<?php <?php
session_start(); session_start();
require_once("../../queries/connect.php"); require_once("../../queries/connect.php");
require_once("../../queries/private_message.php"); require_once("../../queries/private_message.php");
require_once("../../queries/checkInput.php"); require_once("../../queries/checkInput.php");

View File

@@ -0,0 +1,8 @@
<?php
session_start();
require_once ("../../queries/connect.php");
require_once ("../../queries/friendship.php");
echo selectAllFriendRequests();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View File

@@ -1,7 +1,33 @@
$(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);
$(".chat-right").animate({
width: "100%"
}, 500);
$("#notification-center").animate({
right: "0px"
}, 500);
} else {
$(".chat-right").animate({
width: "100%"
}, 500);
$(".content").animate({
marginRight: "0px"
}, 500);
$("#notification-center").animate({
right: "-256px"
}, 500);
}
}); });
}); });

View File

@@ -0,0 +1,34 @@
function showNotifications(notifications, id) {
$("#friendrequestslist").html("");
for (i in notifications) {
$("#friendrequestslist").append(" \
<li class='friend-item $extraItem'> \
<form action='profile.php' method='get'> \
<button type='submit' \
name='username' \
value='"+ notifications[i].username +"'> \
<div class='friend'> \
<img alt='PF' class='profile-picture' src='"+ notifications[i].profilepicture +"'/> \
"+ notifications[i].username +" \
</div> \
</button> \
</form> \
</li> \
");
}
}
function loadNotifications() {
$.post(
"API/loadNotifications.php"
).done(function(data) {
if (data && data != "[]") {
showNotifications(JSON.parse(data), "friendrequestslist");
}
});
setTimeout(loadNotifications, 10000);
}
loadNotifications();

View File

@@ -0,0 +1,8 @@
function checkLoggedIn() {
if (confirm("You are already logged in!\nDo you want to logout?\nPress ok to logout.") == true) {
window.location.href = "logout.php";
} else {
window.location.href = "profile.php";
}
document.getElementById("demo").innerHTML = x;
}

View File

@@ -4,20 +4,9 @@
include("../views/login_head.php"); include("../views/login_head.php");
require_once("../queries/connect.php"); require_once("../queries/connect.php");
include_once("../queries/login.php"); include_once("../queries/login.php");
include_once("../queries/checkInput.php") include_once("../queries/checkInput.php");
?> ?>
<body> <body>
<script>
function checkLoggedIn() {
if (confirm("You are already logged in!\nDo you want to logout?\nPress ok to logout.") == true) {
window.location.href = "logout.php";
} else {
window.history.back();
}
document.getElementById("demo").innerHTML = x;
}
</script>
<?php <?php
session_start(); session_start();

View File

@@ -4,7 +4,7 @@
<?php include("../views/head.php"); ?> <?php include("../views/head.php"); ?>
<script src="/js/masonry.js"></script> <script src="/js/masonry.js"></script>
<style> <style>
@import url("/styles/profile.css"); @import url("styles/profile.css");
</style> </style>
</head> </head>
<body> <body>

View File

@@ -9,7 +9,9 @@
<body> <body>
<?php <?php
session_start(); session_start();
if(isset($_SESSION["userID"])){
header("location: profile.php");
}
// define variables and set to empty values // define variables and set to empty values
$name = $surname = $bday = $username = $password = $confirmpassword = $location = $housenumber = $email = ""; $name = $surname = $bday = $username = $password = $confirmpassword = $location = $housenumber = $email = "";
$genericErr = $nameErr = $surnameErr = $bdayErr = $usernameErr = $passwordErr = $confirmpasswordErr = $locationErr = $housenumberErr = $emailErr = ""; $genericErr = $nameErr = $surnameErr = $bdayErr = $usernameErr = $passwordErr = $confirmpasswordErr = $locationErr = $housenumberErr = $emailErr = "";

View File

@@ -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;
} }
} }

View File

@@ -6,7 +6,7 @@
.admin-title { .admin-title {
margin: 10px; margin: 10px;
padding-bottom: 5px; padding-bottom: 5px;
border-bottom: 4px solid #845663; border-bottom: 4px solid #FBC02D;
} }
.admin-panel input[type="radio"], input[type="checkbox"] { .admin-panel input[type="radio"], input[type="checkbox"] {
@@ -18,7 +18,7 @@
padding: 8px; padding: 8px;
vertical-align: top; vertical-align: top;
border-radius: 10px; border-radius: 10px;
border: 4px solid #845663; border: 4px solid #FBC02D;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
} }

View File

@@ -83,7 +83,7 @@
.chat-field input[type="submit"] { .chat-field input[type="submit"] {
width: auto; width: auto;
float: right; float: right;
background-color: #845663; background-color: #FBC02D;
color: white; color: white;
padding: 5px 10px; padding: 5px 10px;
border-radius: 0 10px 10px 0; border-radius: 0 10px 10px 0;

View File

@@ -8,21 +8,23 @@ header {
width: 100%; width: 100%;
color: white; color: white;
background-color: rgba(132,86,99, 0.98); background-color: #FBC02D;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
} }
#header-logo {
padding-left: 42px;
}
#header-logo, #header-logo img { #header-logo, #header-logo img {
height: 80px; height: 80px;
vertical-align: middle; vertical-align: middle;
line-height: 80px; line-height: 80px;
padding-left: 5px;
} }
#header-search { #header-search {
padding-left: 48px; padding-left: 42px;
} }
@@ -33,32 +35,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;
}

View File

@@ -13,13 +13,13 @@ a.button {
/* Body */ /* Body */
body { body {
height: 900px; height: 100%;
background-color: #C8CABD; background-color: #C8CABD;
/*background-image: url(http://play.pokemonshowdown.com/fx/client-bg-shaymin.jpg); /*background-image: url(http://play.pokemonshowdown.com/fx/client-bg-shaymin.jpg);
background-size: cover; background-size: cover;
background-attachment: fixed;*/ background-attachment: fixed;*/
/*background-color: #B78996;*/ /*background-color: #EEE;*/
color: #333; color: #333;
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
} }
@@ -46,7 +46,7 @@ body {
form { form {
/*background-color: #a87a87;*/ /*background-color: #a87a87;*/
border-radius: 12px; border-radius: 12px;
height: 80%; height: 70%;
margin: auto; margin: auto;
width: 70%; width: 70%;
overflow-y:auto; overflow-y:auto;
@@ -159,7 +159,7 @@ label {
background-repeat: repeat-x; background-repeat: repeat-x;
background-attachment: fixed;*/ background-attachment: fixed;*/
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
height: 550px; height: 500px;
margin: 34px auto; margin: 34px auto;
overflow-y: auto; overflow-y: auto;
padding: 20px; padding: 20px;

View File

@@ -18,7 +18,7 @@ html {
body { body {
height: 100%; height: 100%;
background-color: #B78996; background-color: #EEE;
color: #333; color: #333;
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
} }
@@ -37,11 +37,12 @@ h3 {
} }
h4 { h4 {
font-size: 1.6em; font-size: 1.2em;
} }
h5 { h5 {
font-size: 1.4em; font-size: 1.0em;
color: #666;
} }
ul { ul {
@@ -54,12 +55,12 @@ p {
/* Selection colors */ /* Selection colors */
::selection { ::selection {
background: #845663; background: #FBC02D;
color: white; color: white;
} }
::-moz-selection { ::-moz-selection {
background: #845663; background: #FBC02D;
color: white; color: white;
} }
@@ -75,7 +76,7 @@ p {
.platform { .platform {
padding: 20px; padding: 20px;
margin-bottom: 10px; margin-bottom: 10px;
border-radius: 10px; border-radius: 5px;
background-color: #FFFFFF; background-color: #FFFFFF;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
} }
@@ -143,7 +144,7 @@ button, input, select {
cursor: pointer; cursor: pointer;
border: none; border: none;
font-size: 16px; font-size: 16px;
border-radius: 7px; transition-duration: 250ms;
} }
/* All textinput and sections */ /* All textinput and sections */
@@ -151,19 +152,53 @@ textarea, input, select {
padding: 0 5px; padding: 0 5px;
background: white; background: white;
color: #333333; color: #333333;
border: 1px solid #845663; border-radius: 5px;
border-radius: 7px; border-bottom: 1px solid #4CAF50;
font-size: 16px; font-size: 16px;
outline: none;
transition-duration: 250ms;
}
textarea {
padding: 5px;
resize: none;
}
textarea:hover, input:hover, select:hover {
border-radius: 10px;
}
textarea:focus, input:focus, select:focus {
border-radius: 10px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
} }
/* All buttons */ /* All buttons */
button, button,
input[type="submit"], input[type="submit"],
input[type="reset"] { input[type="reset"] {
background-color: #845663; background-color: #FBC02D;
color: white; color: white;
padding: 0 10px; padding: 0 10px;
border: none; border: none;
border-radius: 5px;
}
button:focus,
input[type="submit"]:focus,
input[type="reset"]:focus {
outline: none;
}
button:active,
input[type="submit"]:active,
input[type="reset"]:active {
outline: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)
}
input[type="radio"] {
border-radius: 100%;
} }
/* Tables */ /* Tables */
@@ -190,19 +225,17 @@ img[data-title]:hover:after,
span[data-title]:hover:after, span[data-title]:hover:after,
div[data-title]:hover:after { div[data-title]:hover:after {
content: attr(data-title); content: attr(data-title);
padding: 4px 4px; padding: 7px 7px;
color: #FFFFFF; color: #FFFFFF;
position: absolute; position: absolute;
left: 0; left: 0;
top: 100%; top: 150%;
z-index: 20; z-index: 200;
white-space: nowrap; white-space: nowrap;
-moz-border-radius: 5px; -moz-border-radius: 3px;
-webkit-border-radius: 5px; -webkit-border-radius: 3px;
border-radius: 5px; border-radius: 3px;
-moz-box-shadow: 0 0 4px #222; box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
-webkit-box-shadow: 0 0 4px #222;
box-shadow: 0 0 4px #222;
background-color: #333; background-color: #333;
font-size: 15px; font-size: 15px;
line-height: normal; line-height: normal;

View File

@@ -1,12 +1,19 @@
.menu { .menu {
position: fixed; position: fixed;
z-index: 50; z-index: 50;
overflow-y: auto;
left: 0; left: 0;
top: 80px; top: 80px;
height: calc(100% - 80px); height: calc(100% - 80px);
width: 256px; width: 256px;
background-color: #EEE;
/*box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);*/
}
.menu section {
margin: 0 5px 10px 5px;
background-color: white; background-color: white;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
} }
@@ -26,12 +33,13 @@
cursor: pointer; cursor: pointer;
} }
.friend-item { .friend-item, .group-item {
cursor: pointer; cursor: pointer;
transition-duration: 250ms;
} }
.friend-item:hover, .group-item:hover { .friend-item:hover, .group-item:hover {
background: #845663; background: #FBC02D;
color: white; color: white;
} }
@@ -42,4 +50,21 @@
height: 100%; height: 100%;
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: #4CAF50;
font-size: 42px;
padding: 7px;
} }

View File

@@ -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: 0 0 10px 0;
}
div.posts { div.posts {
padding-top: 20px; padding-top: 20px;
@@ -25,6 +28,15 @@ div.posts div.post {
margin: 20px 0 0 0; margin: 20px 0 0 0;
padding: 10px; padding: 10px;
width: calc(100% - 40px); width: calc(100% - 40px);
cursor: pointer;
transition-duration: 250ms;
}
div.posts div.post:hover {
/*margin: 15px 0 0 -5px;*/
/*padding: 15px;*/
/*z-index: 20;*/
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
} }
div.posts div.post img { div.posts div.post img {
@@ -37,23 +49,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 +75,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;
@@ -86,11 +85,12 @@ div.posts .post p.subscript {
float: right; float: right;
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
background-color: #845663; background-color: #4CAF50;
color: #FFFFFF; color: #FFFFFF;
transition-duration: 250ms; transition-duration: 250ms;
cursor: pointer;
} }
.profile-button:hover { .profile-button:hover {
background-color: #B78996; box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
} }

View File

@@ -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
@@ -28,4 +29,35 @@ function selectAllFriends($userID) {
$stmt->execute(); $stmt->execute();
return $stmt; return $stmt;
}
function selectAllFriendRequests() {
$stmt = $GLOBALS["db"]->prepare("
SELECT
`userID`,
`username`,
IFNULL(
`profilepicture`,
'../img/notbad.jpg'
) AS profilepicture,
`onlinestatus`,
`role`
FROM
`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` = 0
");
$stmt->bindParam(':userID', $_SESSION["userID"], PDO::PARAM_INT);
$stmt->execute();
return json_encode($stmt->fetchAll());
} }

View File

@@ -87,13 +87,12 @@ function updateSettings() {
`userID` = :userID `userID` = :userID
"); ");
$stmt->bindParam(":fname", test_input($_POST["fname"])); $stmt->bindValue(":fname", test_input($_POST["fname"]));
$stmt->bindParam(":lname", test_input($_POST["lname"])); $stmt->bindValue(":lname", test_input($_POST["lname"]));
$stmt->bindParam(":location", test_input($_POST["location"])); $stmt->bindValue(":location", test_input($_POST["location"]));
$stmt->bindParam(":bday", $_POST["bday"]); $stmt->bindValue(":bday", test_input($_POST["bday"]));
$stmt->bindParam(":bio", test_input($_POST["bio"])); $stmt->bindValue(":bio", test_input($_POST["bio"]));
$stmt->bindParam(":userID", $_SESSION["userID"]); $stmt->bindValue(":userID", $_SESSION["userID"]);
$stmt->execute(); $stmt->execute();
return new settingsMessage("happy", "Instellingen zijn opgeslagen."); return new settingsMessage("happy", "Instellingen zijn opgeslagen.");
@@ -188,22 +187,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();
} }

View File

@@ -36,7 +36,7 @@
?> ?>
</ul> </ul>
</nav> </nav>
<div class="chat-right right"> <div class="chat-right">
<div id="chat-history" class="chat-history platform"> <div id="chat-history" class="chat-history platform">
</div> </div>
<form id="lastIDForm"> <form id="lastIDForm">

View File

@@ -1,16 +1,17 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>MyHyvesbook+</title> <title>MyHyvesbook+</title>
<!-- Add your javascript files here. --> <!-- Add your javascript files here. -->
<script src="/js/jquery.js"></script> <script src="js/jquery.js"></script>
<script src="/js/header.js"></script> <script src="js/header.js"></script>
<script src="/js/menu.js"></script> <script src="js/menu.js"></script>
<script src="js/notifications.js"></script>
<style> <style>
/* Add your css files here. */ /* Add your css files here. */
@import url("/styles/main.css"); @import url("styles/main.css");
@import url("/styles/font-awesome.css"); @import url("styles/font-awesome.css");
@import url("/styles/header.css"); @import url("styles/header.css");
@import url("/styles/menu.css"); @import url("styles/menu.css");
@import url("/styles/footer.css"); @import url("styles/footer.css");
</style> </style>
<?php <?php

View File

@@ -8,7 +8,7 @@ $userinfo = getHeaderInfo();
<a href="profile.php"><img src="/img/top-logo.png" alt="MyHyvesbook+" /></a> <a href="profile.php"><img src="/img/top-logo.png" alt="MyHyvesbook+" /></a>
</div> </div>
<div id="header-search"> <div id="header-search">
<form action="/search" method="get"> <form action="search.php" method="get">
<input name="search" <input name="search"
type="text" type="text"
placeholder="Zoek naar wat je wil" placeholder="Zoek naar wat je wil"
@@ -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"); ?>

View File

@@ -6,6 +6,7 @@
href="/styles/main.css"> href="/styles/main.css">
<link rel="stylesheet" <link rel="stylesheet"
type="text/css" type="text/css"
href="/styles/index.css"> href="styles/index.css">
<script src="/js/jquery.js"></script> <script src="/js/jqeury.js"></script>
<script src="/js/registerAndLogin.js"></script>
</head> </head>

View File

@@ -1,5 +1,5 @@
<nav class="menu"> <nav class="menu">
<section id="friends-menu-section"> <section id="friends-menu-section platform">
<h4> <h4>
Vrienden Vrienden
</h4> </h4>
@@ -27,7 +27,7 @@
if (!empty($friend["profilepicture"])) if (!empty($friend["profilepicture"]))
$pf = $friend["profilepicture"]; $pf = $friend["profilepicture"];
if ($i > 1) if ($i > 5)
$extraItem = "extra-menu-items"; $extraItem = "extra-menu-items";
// Echo the friend. // Echo the friend.
@@ -62,8 +62,8 @@
</form> </form>
</li> </li>
"; ";
if ($i > 1) { if ($i > 5) {
$i -= 1; $i -= 5;
echo " echo "
<li class='more-item' id='more-friends-click'> <li class='more-item' id='more-friends-click'>
En nog $i anderen... En nog $i anderen...

View File

@@ -0,0 +1,16 @@
<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="notifocationCenter">
<h4>
Vriendchapsverzoeken
</h4>
<ul class="nav-list" id="friendrequestslist">
</ul>
</section>
</nav>

View File

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