Compare commits
15 Commits
hendrik-se
...
hendrik-po
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93e63111de | ||
|
|
feba1d9786 | ||
|
|
6ed19d9060 | ||
|
|
d4d16661df | ||
|
|
ab5f243281 | ||
|
|
327a6a8f5c | ||
|
|
d03d58ce37 | ||
|
|
487e0a0523 | ||
|
|
1dfc14e6f0 | ||
|
|
cc9866d3dd | ||
|
|
04df02862f | ||
|
|
60b55b3f04 | ||
|
|
70b7e12559 | ||
|
|
e299ef59e8 | ||
|
|
0546b8689d |
@@ -6,6 +6,7 @@ require_once ("../../queries/connect.php");
|
||||
require_once ("../../queries/private_message.php");
|
||||
require_once("../../queries/user.php");
|
||||
|
||||
// Check if the user is allowed to load them.
|
||||
if (isset($_SESSION["userID"]) &&
|
||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||
echo selectAllUnreadChat();
|
||||
|
||||
@@ -6,6 +6,7 @@ require_once ("../../queries/connect.php");
|
||||
require_once ("../../queries/friendship.php");
|
||||
require_once ("../../queries/user.php");
|
||||
|
||||
// Check if the user is allowed to load them.
|
||||
if (isset($_SESSION["userID"]) &&
|
||||
getRoleByID($_SESSION["userID"]) != 'frozen' &&
|
||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||
|
||||
@@ -7,9 +7,11 @@ require_once ("../../queries/checkInput.php");
|
||||
require_once ("../../queries/friendship.php");
|
||||
require_once("../../queries/user.php");
|
||||
|
||||
// Check if the user is allowed to load them.
|
||||
if (isset($_SESSION["userID"]) &&
|
||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||
if (isset($_SESSION["userID"])) {
|
||||
// Echo the limited or unlimited users.
|
||||
if (isset($_POST["limit"])) {
|
||||
echo selectLimitedFriends($_SESSION["userID"], (int)test_input($_POST["limit"]));
|
||||
} else if (isset($_GET["limit"])) {
|
||||
|
||||
@@ -8,8 +8,10 @@ require_once ("../../queries/group_member.php");
|
||||
|
||||
require_once("../../queries/user.php");
|
||||
|
||||
// Check if the user is allowed to load them.
|
||||
if (isset($_SESSION["userID"]) &&
|
||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||
// Echo the limited or unlimited groups.
|
||||
if (isset($_POST["limit"])) {
|
||||
echo selectLimitedGroupsFromUser($_SESSION["userID"], (int)test_input($_POST["limit"]));
|
||||
} else {
|
||||
|
||||
@@ -8,8 +8,10 @@ require_once("../../queries/checkInput.php");
|
||||
require_once("../../queries/friendship.php");
|
||||
require_once("../../queries/user.php");
|
||||
|
||||
// Check if the user is allowed to get the messages.
|
||||
if (isset($_SESSION["userID"]) &&
|
||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||
// Check if the users wants new messages or old ones, and give the right one back.
|
||||
if (isset($_POST["lastID"]) && $_POST["lastID"] != "") {
|
||||
setLastVisited(test_input($_POST["destination"]));
|
||||
echo getNewChatMessages(test_input($_POST["lastID"]), test_input($_POST["destination"]));
|
||||
|
||||
@@ -12,36 +12,39 @@ if (isset($_SESSION["userID"]) &&
|
||||
getRoleByID($_SESSION["userID"]) != 'frozen' &&
|
||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||
|
||||
if (empty($_POST["title"]) or
|
||||
empty($_POST["content"]) or
|
||||
empty($_SESSION["userID"])
|
||||
) {
|
||||
if (empty($_SESSION["userID"])) {
|
||||
header('HTTP/1.1 500 Non enough arguments');
|
||||
}
|
||||
|
||||
if (empty($_POST["group"])) {
|
||||
// User Post
|
||||
makePost(
|
||||
$_SESSION["userID"],
|
||||
null,
|
||||
test_input($_POST["title"]),
|
||||
test_input($_POST["content"])
|
||||
);
|
||||
if (empty(test_input($_POST["title"])) or
|
||||
empty(test_input($_POST["content"]))
|
||||
) {
|
||||
echo "empty";
|
||||
} else {
|
||||
// Group Post
|
||||
if (empty($_POST["group"])) {
|
||||
// User Post
|
||||
makePost(
|
||||
$_SESSION["userID"],
|
||||
null,
|
||||
test_input($_POST["title"]),
|
||||
test_input($_POST["content"])
|
||||
);
|
||||
} else {
|
||||
// Group Post
|
||||
|
||||
// Check if the user is an admin or mod of the group.
|
||||
if (!in_array(selectGroupRole($_POST["group"]), array('mod', 'admin'))) {
|
||||
header('HTTP/1.1 500 Non enough rights');
|
||||
return;
|
||||
// Check if the user is an admin or mod of the group.
|
||||
if (!in_array(selectGroupRole($_POST["group"]), array('mod', 'admin'))) {
|
||||
header('HTTP/1.1 500 Non enough rights');
|
||||
return;
|
||||
}
|
||||
|
||||
makePost(
|
||||
$_SESSION["userID"],
|
||||
$_POST["group"],
|
||||
test_input($_POST["title"]),
|
||||
test_input($_POST["content"])
|
||||
);
|
||||
}
|
||||
|
||||
makePost(
|
||||
$_SESSION["userID"],
|
||||
$_POST["group"],
|
||||
test_input($_POST["title"]),
|
||||
test_input($_POST["content"])
|
||||
);
|
||||
}
|
||||
} else {
|
||||
echo "frozen";
|
||||
|
||||
@@ -6,12 +6,15 @@ require_once("../../queries/private_message.php");
|
||||
require_once("../../queries/checkInput.php");
|
||||
require_once("../../queries/user.php");
|
||||
|
||||
// Check if the user is allowed to send a message.
|
||||
if (isset($_SESSION["userID"]) &&
|
||||
getRoleByID($_SESSION["userID"]) != 'frozen' &&
|
||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||
if (!empty(test_input($_POST["destination"])) &&
|
||||
!empty(test_input($_POST["content"]))
|
||||
) {
|
||||
// Send the message.
|
||||
// Returns false when it didn't succeed sending the message.
|
||||
if (sendMessage(test_input($_POST["destination"]), test_input($_POST["content"]))) {
|
||||
echo 1;
|
||||
} else {
|
||||
|
||||
@@ -4,6 +4,7 @@ session_start();
|
||||
|
||||
include_once ("../../queries/friendship.php");
|
||||
|
||||
// Initialize variables to given or default values.
|
||||
if (isset($_POST["action"])) {
|
||||
$action = $_POST["action"];
|
||||
} else {
|
||||
@@ -18,6 +19,8 @@ if (isset($_POST["actionType"])) {
|
||||
|
||||
$friends = json_decode($_POST["friends"]);
|
||||
|
||||
|
||||
// Foreach friend, return them as list item.
|
||||
foreach($friends as $i => $friend) {
|
||||
$friendshipStatus = getFriendshipStatus($friend->userID);
|
||||
?>
|
||||
@@ -38,7 +41,7 @@ foreach($friends as $i => $friend) {
|
||||
<?= $friend->fullname ?><br/>
|
||||
<span style='color: #666'><?php
|
||||
if (isset($friend->username)) {
|
||||
echo $friend->username;
|
||||
echo $friend->usernameshort;
|
||||
} else if (isset($friend->content)) {
|
||||
echo $friend->content;
|
||||
}
|
||||
@@ -48,6 +51,7 @@ foreach($friends as $i => $friend) {
|
||||
</button>
|
||||
</form>
|
||||
<?php
|
||||
// Add friendship options if possible.
|
||||
if ($friendshipStatus > 1) {
|
||||
if ($friendshipStatus == 2) {
|
||||
$denyName = "Annuleer";
|
||||
|
||||
@@ -6,6 +6,7 @@ include_once ("../../queries/group_member.php");
|
||||
|
||||
$groups = json_decode($_POST["groups"]);
|
||||
|
||||
// Add each group as list item.
|
||||
foreach($groups as $i => $group) {
|
||||
?>
|
||||
<li class='group-item'>
|
||||
|
||||
@@ -9,13 +9,17 @@ $(document).ready(function() {
|
||||
$(".chat-field").hide();
|
||||
});
|
||||
|
||||
// This function loads the new messages and runs the addMessages function to show them.
|
||||
function loadMessages() {
|
||||
// If the function is not running elsewhere, run it here.
|
||||
if (!gettingMessages) {
|
||||
gettingMessages = true;
|
||||
// Get the messages.
|
||||
$.post(
|
||||
"API/loadMessages.php",
|
||||
$("#lastIDForm").serialize()
|
||||
).done(function (data) {
|
||||
// Post the messages in the chat.
|
||||
if (data && data != "[]") {
|
||||
messages = JSON.parse(data);
|
||||
addMessages(messages);
|
||||
@@ -28,7 +32,7 @@ function loadMessages() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Send a message to a friend of the user.
|
||||
function sendMessage() {
|
||||
$.post(
|
||||
"API/sendMessage.php",
|
||||
@@ -37,42 +41,54 @@ function sendMessage() {
|
||||
if (response == "frozen") {
|
||||
alert("Je account is bevroren, dus je kan niet chat berichten versturen. Contacteer een admin als je denkt dat dit onjuist is.");
|
||||
}
|
||||
// Load messages if the message has been send, so it shows in the chat.
|
||||
loadMessages();
|
||||
});
|
||||
|
||||
$("#newContent").val("");
|
||||
loadMessages();
|
||||
}
|
||||
|
||||
// Add messages to the chat.
|
||||
function addMessages(messages) {
|
||||
var messagesText = "";
|
||||
|
||||
// Loop over all the messages.
|
||||
for(var i in messages) {
|
||||
// Initialize message variables
|
||||
// Initialize message variables.
|
||||
var thisDate = new Date(messages[i].creationdate.replace(/ /,"T"));
|
||||
var thisTime = thisDate.getHours() + ":" + thisDate.getMinutes();
|
||||
var type;
|
||||
thisDate.setHours(0,0,0,0);
|
||||
|
||||
// See where the message has been send from, so it shows on the right side.
|
||||
if (messages[i].destination == $(".destinationID").val()) {
|
||||
type = "chat-message-self";
|
||||
} else {
|
||||
type = "chat-message-other";
|
||||
}
|
||||
|
||||
// If it is the first message, open the message box and maybe add a year.
|
||||
if (i == 0) {
|
||||
if (thisDate.getTime() > previousDate.getTime()) {
|
||||
messagesText += '\
|
||||
<div class="day-message"> \
|
||||
<div class="day-message-content">\
|
||||
' + days[thisDate.getDay()] + " " + thisDate.getDate() + " " + months[thisDate.getMonth()] + " " + thisDate.getFullYear() + '\
|
||||
</div> \
|
||||
</div>';
|
||||
}
|
||||
previousDate = thisDate;
|
||||
messagesText += '\
|
||||
<div class="day-message"> \
|
||||
<div class="day-message-content">\
|
||||
' + days[thisDate.getDay()] + " " + thisDate.getDate() + " " + months[thisDate.getMonth()] + " " + thisDate.getFullYear() + '\
|
||||
</div> \
|
||||
</div>';
|
||||
messagesText += '<div class="chat-message"><div class="' + type + '">';
|
||||
// If it is not the first message, and has a different date/time/type then the previous message,
|
||||
} else if (type != previousType || thisTime != previousTime || thisDate.getTime() > previousDate.getTime()) {
|
||||
// Close the previous message.
|
||||
messagesText += '<div class="chat-time">\
|
||||
' + thisTime + '\
|
||||
</div></div></div>';
|
||||
|
||||
previousTime = thisTime;
|
||||
previousType = type;
|
||||
// If the date is different, add a new date.
|
||||
if (thisDate > previousDate) {
|
||||
previousDate = thisDate;
|
||||
messagesText += '\
|
||||
@@ -83,8 +99,11 @@ function addMessages(messages) {
|
||||
</div>';
|
||||
}
|
||||
|
||||
// Open the new message.
|
||||
messagesText += '<div class="chat-message"><div class="' + type + '">';
|
||||
}
|
||||
|
||||
// Add the content of the message in the new box.
|
||||
messagesText += fancyText(messages[i].content) + "<br />";
|
||||
}
|
||||
|
||||
@@ -93,11 +112,14 @@ function addMessages(messages) {
|
||||
' + thisTime + '\
|
||||
</div></div></div>';
|
||||
|
||||
// Add all the new created messaged to the chat.
|
||||
$("#chat-history").append(messagesText);
|
||||
|
||||
// Scroll down, so the user can see the new messages.
|
||||
$("#chat-history").scrollTop($("#chat-history")[0].scrollHeight - $('#chat-history')[0].clientHeight);
|
||||
}
|
||||
|
||||
// Switch to a different user.
|
||||
function switchUser(userID) {
|
||||
previousDate = new Date("1970-01-01 00:00:00");
|
||||
$(".chat-field").show();
|
||||
@@ -108,6 +130,7 @@ function switchUser(userID) {
|
||||
$("#friend-item-" + userID).addClass("active-friend-chat");
|
||||
}
|
||||
|
||||
// Insert a message in the chat, this is used when it is empty.
|
||||
function sayEmpty() {
|
||||
$("#chat-history").html("Probeer ook eens foto's en video's te sturen");
|
||||
}
|
||||
@@ -14,14 +14,14 @@ function fancyText(text) {
|
||||
return "<video width='100%'>" +
|
||||
"<source src='"+ link +"' type='video/mp4'>" +
|
||||
"<b>Je browser ondersteund geen video</b>" +
|
||||
"</video><button class='gray' onclick='$(this).prev().get(0).play();'>Speel af</button>";
|
||||
"</video><button class='gray' onclick='$(this).prev().get(0).play();'><i class='fa fa-play'></i></button>";
|
||||
}
|
||||
// Add ogg video's
|
||||
else if (link.match(/(https?:\/\/.[^ ]*\.(?:ogg))/ig)) {
|
||||
return "<video width='100%'>" +
|
||||
"<source src='"+ link +"' type='video/ogg'>" +
|
||||
"<b>Je browser ondersteund geen video</b>" +
|
||||
"</video><button onclick='$(this).prev().get(0).play();'>Speel af</button>";
|
||||
"</video><button class='gray' onclick='$(this).prev().get(0).play();'><i class='fa fa-play'></i></button>";
|
||||
}
|
||||
// Add youtube video's
|
||||
else if (link.match(/(https?:\/\/.(www.)?youtube|youtu.be)*watch/ig)) {
|
||||
@@ -38,6 +38,8 @@ function fancyText(text) {
|
||||
return text;
|
||||
}
|
||||
|
||||
// This function gets the value of a cookie when given a key.
|
||||
// If didn´t find any compatible cookie, it returns false.
|
||||
function getCookie(key) {
|
||||
cookies = document.cookie.split("; ");
|
||||
for (var i in cookies) {
|
||||
@@ -49,6 +51,7 @@ function getCookie(key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Edit the friendship status of two users.
|
||||
function editFriendship(userID, value) {
|
||||
$.post("API/editFriendship.php", { usr: userID, action: value })
|
||||
.done(function() {
|
||||
@@ -57,6 +60,8 @@ function editFriendship(userID, value) {
|
||||
});
|
||||
}
|
||||
|
||||
// Show the given friends in the given list.
|
||||
// The friends are giving in JSON, and the list is giving with a hashtag.
|
||||
function showFriends(friends, list) {
|
||||
if(friends && friends != "[]") {
|
||||
$(list).load("bits/friend-item.php", {
|
||||
@@ -69,6 +74,8 @@ function showFriends(friends, list) {
|
||||
}
|
||||
}
|
||||
|
||||
// Show the given friends in the given list.
|
||||
// This function supports more options given as parameters. This adds extra functionality.
|
||||
function showFriendsPlus(friends, list, limit, action, actionType) {
|
||||
if(friends && friends != "[]") {
|
||||
$(list).load("bits/friend-item.php", {
|
||||
@@ -84,6 +91,7 @@ function showFriendsPlus(friends, list, limit, action, actionType) {
|
||||
}
|
||||
}
|
||||
|
||||
// Show the given groups in the given list.
|
||||
function showGroups(groups, list) {
|
||||
if(groups && groups != "[]") {
|
||||
$(list).load("bits/group-item.php", {
|
||||
|
||||
@@ -31,14 +31,28 @@ function postPost() {
|
||||
$.post("API/postPost.php", { title: title,
|
||||
content : content,
|
||||
group : groupID })
|
||||
.done(function() {
|
||||
masonry(masonryMode);
|
||||
.done(function(data) {
|
||||
if (data == "empty") {
|
||||
$('#alertbox').show();
|
||||
$('#alerttext').html("Geen titel of inhoud; vul a.u.b. in.");
|
||||
window.scrollTo(0,0);
|
||||
} else {
|
||||
$('#alertbox').hide();
|
||||
masonry(masonryMode);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.post("API/postPost.php", { title: title,
|
||||
content : content })
|
||||
.done(function() {
|
||||
masonry(masonryMode);
|
||||
.done(function(data) {
|
||||
if (data == "empty") {
|
||||
$('#alertbox').show();
|
||||
$('#alerttext').html("Geen titel of inhoud; vul a.u.b. in.");
|
||||
window.scrollTo(0,0);
|
||||
} else {
|
||||
$('#alertbox').hide();
|
||||
masonry(masonryMode);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -98,6 +112,10 @@ function masonry(mode) {
|
||||
masonryMode = mode;
|
||||
$container.children().remove();
|
||||
|
||||
// reinit posts
|
||||
noposts = false;
|
||||
postAmount = 0;
|
||||
|
||||
/*
|
||||
* Initialise columns.
|
||||
*/
|
||||
@@ -120,7 +138,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;
|
||||
@@ -153,9 +171,6 @@ function loadMorePosts(uID, gID, offset, limit) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(uID, gID, offset, limit);
|
||||
|
||||
|
||||
$.post("API/getPosts.php", { usr : uID,
|
||||
grp : gID,
|
||||
offset : offset,
|
||||
|
||||
@@ -34,6 +34,4 @@ function deletePost(postID) {
|
||||
});
|
||||
closeModal();
|
||||
masonry(masonryMode);
|
||||
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ $(window).on('load', function () {
|
||||
pageNumber();
|
||||
});
|
||||
|
||||
// Search for the users and put them in the user list.
|
||||
function searchUsers() {
|
||||
$.post(
|
||||
"API/searchUsers.php",
|
||||
@@ -13,6 +14,7 @@ function searchUsers() {
|
||||
});
|
||||
}
|
||||
|
||||
// Search for the groups and put them in the group list.
|
||||
function searchGroups() {
|
||||
$.post(
|
||||
"API/searchGroups.php",
|
||||
@@ -24,6 +26,7 @@ function searchGroups() {
|
||||
});
|
||||
}
|
||||
|
||||
// Get the page numbers and return them in the select.
|
||||
function pageNumber() {
|
||||
var input = input2 = $('#search-form').serialize();
|
||||
$.post(
|
||||
|
||||
@@ -102,7 +102,6 @@ p {
|
||||
|
||||
.group-picture {
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.item-box, .item-box-full-width {
|
||||
@@ -117,7 +116,7 @@ p {
|
||||
|
||||
@media only screen and (max-width: 1400px) {
|
||||
.item-box {
|
||||
width: calc(100% - 50px);
|
||||
width: calc(100% - 50px)!important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,19 +290,6 @@ div[data-title]:hover:after {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background: none;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
-webkit-border-radius: 20px;
|
||||
border-radius: 20px;
|
||||
background: #4CAF50;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1080px) {
|
||||
body {
|
||||
font-size: 28px!important;
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
/* New */
|
||||
|
||||
.alertbox {
|
||||
display: none;
|
||||
background-color: firebrick;
|
||||
}
|
||||
|
||||
.user-box {
|
||||
text-align: center;
|
||||
}
|
||||
@@ -11,7 +16,7 @@
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.friend-button-container {
|
||||
.friend-button-container, .group-button-container {
|
||||
position: relative;
|
||||
float: right;
|
||||
width: 200px;
|
||||
@@ -62,7 +67,6 @@
|
||||
|
||||
.group-picture {
|
||||
border: none;
|
||||
margin-bottom: 0;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
@@ -108,7 +112,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%;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,11 @@
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.settings-password, .settings-email {
|
||||
width: calc(50% - 60px);
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.settings-password label, .settings-email label {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -10,8 +10,9 @@ function selectLimitedFriends($userID, $limit) {
|
||||
$stmt = prepareQuery("
|
||||
SELECT
|
||||
`userID`,
|
||||
LEFT(`username`, 12) as `usernameshort`,
|
||||
`username`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 15) as `fullname`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
|
||||
IFNULL(
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
@@ -50,8 +51,9 @@ function selectAllFriends($userID) {
|
||||
$stmt = prepareQuery("
|
||||
SELECT
|
||||
`userID`,
|
||||
LEFT(`username`, 12) as `usernameshort`,
|
||||
`username`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 15) as `fullname`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
|
||||
IFNULL(
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
@@ -85,8 +87,9 @@ function selectAllFriendRequests() {
|
||||
$stmt = prepareQuery("
|
||||
SELECT
|
||||
`userID`,
|
||||
LEFT(`username`, 12) as `usernameshort`,
|
||||
`username`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 15) as `fullname`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
|
||||
IFNULL(
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
@@ -235,8 +238,9 @@ function searchSomeFriends($n, $m, $search) {
|
||||
$stmt = prepareQuery("
|
||||
SELECT
|
||||
`userID`,
|
||||
LEFT(`username`, 12) as `usernameshort`,
|
||||
`username`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 15) as `fullname`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
|
||||
IFNULL(
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
|
||||
@@ -95,7 +95,7 @@ function getNewChatMessages($lastID, $destination) {
|
||||
function selectAllUnreadChat() {
|
||||
$stmt = prepareQuery("
|
||||
SELECT
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 15) AS `fullname`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
|
||||
`user`.`userID`,
|
||||
IFNULL(
|
||||
`profilepicture`,
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -52,6 +52,10 @@ function selectUser($me, $other) {
|
||||
`username`,
|
||||
`birthdate`,
|
||||
`location`,
|
||||
`showBday`,
|
||||
`showEmail`,
|
||||
`showProfile`,
|
||||
`email`,
|
||||
IFNULL(
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
@@ -351,12 +355,13 @@ function searchSomeUsers($n, $m, $search) {
|
||||
$stmt = prepareQuery("
|
||||
SELECT
|
||||
`userID`,
|
||||
LEFT(`username`, 12) as `usernameshort`,
|
||||
`username`,
|
||||
IFNULL(
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
) AS profilepicture,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 15) as `fullname`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
|
||||
CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
|
||||
WHEN TRUE THEN 'online'
|
||||
WHEN FALSE THEN 'offline'
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
<div class="content">
|
||||
<div class="profile-box platform">
|
||||
<img class="left main-picture group-picture" src="<?= $group['picture'] ?>">
|
||||
<div class="group-button-container"></div>
|
||||
<h1 class="profile-username"><?= $group['name'] ?></h1>
|
||||
<p><?= $group['description'] ?></p>
|
||||
|
||||
<div class="user-box">
|
||||
<img class="group-picture main-picture" src="<?= $group["picture"] ?>"><br />
|
||||
<div class="platform">
|
||||
<div class="status-buttons-container">
|
||||
<button disabled class="gray"><?= $group["status"] ?></button>
|
||||
</div>
|
||||
<div class="group-button-container"></div>
|
||||
<div class="profile-info">
|
||||
<h2><?= $group["name"]?></h2>
|
||||
<?= $group["description"] ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-box-full-width platform">
|
||||
<h2>Leden (<?= $group['members'] ?>)</h2>
|
||||
<p>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<meta charset="utf-8">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="description" content="MyHyvesbook+ is het sociaal media voor alle coole mensen.">
|
||||
<meta name="keywords" content="MyHyvesbookPlus,Myhyvesbook+,sociaal,media">
|
||||
<meta name="author" content="MyHyvesbookplus corporation">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>MyHyvesbook+</title>
|
||||
<!-- Add your javascript files here. -->
|
||||
<script src="js/jquery.js"></script>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
echo "<style>@import url('styles/adminbutton.css'); </style>";
|
||||
}
|
||||
?>
|
||||
<a href="logout.php" data-title="Admin"><i class="fa fa-sign-out"></i></a>
|
||||
<a href="logout.php" data-title="Uitloggen"><i class="fa fa-sign-out"></i></a>
|
||||
</section>
|
||||
<section id="friend-request-section">
|
||||
<h4>
|
||||
|
||||
@@ -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"])) {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<div class="content">
|
||||
<div class='platform alertbox' id="alertbox">
|
||||
<span id="alerttext"></span>
|
||||
</div>
|
||||
|
||||
<div class="user-box">
|
||||
<img class="profile-picture main-picture <?= $user["onlinestatus"] ?>" src="<?= $user["profilepicture"] ?>"><br />
|
||||
<div class="platform">
|
||||
@@ -29,7 +33,12 @@
|
||||
<h3>Informatie</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<?php if ($user["showBday"]) { ?>
|
||||
<li>Leeftijd: <?= getAge($user["birthdate"]) ?> jaar</li>
|
||||
<?php } ?>
|
||||
<?php if ($user["showEmail"]) { ?>
|
||||
<li>Email: <?= $user["email"] ?></li>
|
||||
<?php } ?>
|
||||
<li>Locatie: <?= $user["location"] ?></li>
|
||||
<li>Lid sinds: <?= nicetime($user["creationdate"]) ?></li>
|
||||
</ul>
|
||||
|
||||
@@ -17,6 +17,7 @@ $settings = getSettings();
|
||||
<input type="text"
|
||||
name="fname"
|
||||
id="fname"
|
||||
maxlength="63"
|
||||
placeholder="Voornaam"
|
||||
title="Voornaam"
|
||||
value="<?=$settings["fname"]?>"
|
||||
@@ -27,6 +28,7 @@ $settings = getSettings();
|
||||
<input type="text"
|
||||
name="lname"
|
||||
id="lname"
|
||||
maxlength="63"
|
||||
placeholder="Achternaam"
|
||||
value="<?=$settings["lname"]?>"
|
||||
>
|
||||
@@ -36,6 +38,7 @@ $settings = getSettings();
|
||||
<input type="text"
|
||||
name="location"
|
||||
id="location"
|
||||
maxlength="50"
|
||||
placeholder="Locatie"
|
||||
value="<?=$settings["location"]?>"
|
||||
>
|
||||
@@ -96,6 +99,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"
|
||||
@@ -186,6 +197,7 @@ $settings = getSettings();
|
||||
<label for="email-old">Huidig Email </label>
|
||||
<input type="email"
|
||||
id="email-old"
|
||||
maxlength="255"
|
||||
value="<?=$settings["email"]?>"
|
||||
disabled
|
||||
>
|
||||
@@ -194,6 +206,7 @@ $settings = getSettings();
|
||||
<label for="email">Nieuw Email</label>
|
||||
<input type="email"
|
||||
name="email"
|
||||
maxlength="255"
|
||||
id="email"
|
||||
placeholder="Nieuw Email"
|
||||
>
|
||||
@@ -203,14 +216,16 @@ $settings = getSettings();
|
||||
<input type="email"
|
||||
name="email-confirm"
|
||||
id="email-confirm"
|
||||
maxlength="255"
|
||||
placeholder="Bevestig Email"
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<button type="submit"
|
||||
name="form"
|
||||
value="email"
|
||||
>Verander Email</button>
|
||||
value="email">
|
||||
Verander Email
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user