';
// 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()) {
diff --git a/website/public/js/main.js b/website/public/js/main.js
index b6ab703..30cd3ed 100644
--- a/website/public/js/main.js
+++ b/website/public/js/main.js
@@ -31,7 +31,7 @@ function fancyText(text) {
}
// Add links
else {
- return "
" + link + "";
+ return "
" + link + "";
}
});
diff --git a/website/public/js/masonry.js b/website/public/js/masonry.js
index 190a26f..a628e96 100644
--- a/website/public/js/masonry.js
+++ b/website/public/js/masonry.js
@@ -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.
*/
@@ -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,
diff --git a/website/public/settings.php b/website/public/settings.php
index e40f042..9247d26 100644
--- a/website/public/settings.php
+++ b/website/public/settings.php
@@ -18,7 +18,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
try {
switch ($_POST["form"]) {
case "profile":
- updateSettings();
+ checkUpdateSettings();
break;
case "password":
changePassword();
diff --git a/website/public/styles/index.css b/website/public/styles/index.css
index 196485e..c7a0aa8 100644
--- a/website/public/styles/index.css
+++ b/website/public/styles/index.css
@@ -133,6 +133,12 @@ label {
color: red;
}
+.login_containerNoscript {
+ padding: 4px;
+ text-align: center;
+ color: red;
+}
+
@keyframes animatezoom {
from {transform: scale(0)}
to {transform: scale(1)}
@@ -150,7 +156,7 @@ label {
margin: 16px auto;
overflow-y: auto;
padding: 20px;
- width: 600px;
+ width: 650px;
}
select{
diff --git a/website/public/styles/post-popup.css b/website/public/styles/post-popup.css
index 3f37ffd..24badcb 100644
--- a/website/public/styles/post-popup.css
+++ b/website/public/styles/post-popup.css
@@ -48,6 +48,10 @@
width: 90%;
}
+.post-content a {
+ text-decoration: underline;
+}
+
.commentfield {
margin-bottom: 20px;
}
diff --git a/website/public/styles/profile.css b/website/public/styles/profile.css
index 146a4fa..27ff7fd 100644
--- a/website/public/styles/profile.css
+++ b/website/public/styles/profile.css
@@ -1,5 +1,14 @@
/* New */
+.alertbox {
+ display: none;
+ background-color: firebrick;
+}
+
+.alerttext {
+ color: white;
+}
+
.user-box {
text-align: center;
}
@@ -89,6 +98,10 @@ div.posts div.post {
word-wrap: break-word;
}
+div.posts div.post a {
+ text-decoration: underline;
+}
+
div.posts div.post:hover {
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
diff --git a/website/queries/checkInput.php b/website/queries/checkInput.php
index 663da1f..69274ce 100644
--- a/website/queries/checkInput.php
+++ b/website/queries/checkInput.php
@@ -47,6 +47,8 @@ function checkName($variable){
throw new lettersAndSpacesException("Verplicht!");
} else if (!preg_match("/^[a-zA-Z ]*$/", $variable)) {
throw new lettersAndSpacesException("Alleen letters en spaties zijn toegestaan!");
+ } else if (strlen($variable) > 63){
+ throw new lettersAndSpacesException(("Mag maximaal 63 karakters hebben!"));
}
}
@@ -81,6 +83,8 @@ function username($variable){
throw new usernameException("Moet minstens 6 karakters bevatten");
} else if (getExistingUsername() == 1) {
throw new usernameException("Gebruikersnaam bestaal al");
+ } else if (strlen($variable) > 50) {
+ throw new usernameException("Mag maximaal 50 karakters!");
}
}
@@ -92,6 +96,8 @@ function fbUsername($variable){
throw new usernameException("Moet minstens 6 karakters bevatten");
} else if (getExistingFBUsername() == 1) {
throw new usernameException("Gebruikersnaam bestaal al");
+ } else if (strlen($variable) > 50) {
+ throw new usernameException("Mag maximaal 50 karakters!");
}
}
@@ -101,6 +107,8 @@ function longerEight($variable){
throw new passwordException("Verplicht!");
} else if (strlen($variable) < 8) {
throw new passwordException("Moet minstens 8 karakters bevatten");
+ } else if (strlen($variable) > 50) {
+ throw new usernameException("Mag maximaal 50 karakters!");
}
}
@@ -112,9 +120,11 @@ function validateEmail($variable){
throw new emailException("Geldige email invullen");
} else if (getExistingEmail() == 1){
throw new emailException("Email bestaal al!");
+ } else if (strlen($variable) > 255) {
+ throw new emailException("Mag maximaal 50 karakters!");
}
}
-
+//255
/* checks if an input is a valid email. */
function validateFBEmail($variable){
if (empty($variable)) {
@@ -122,7 +132,9 @@ function validateFBEmail($variable){
} else if (!filter_var($variable, FILTER_VALIDATE_EMAIL)) {
throw new emailException("Geldige email invullen");
} else if (getExistingFBEmail() == 1){
- throw new emailException("Email bestaal al!");
+ throw new emailException("Uw email wordt al gebruikt voor een ander account!");
+ } else if (strlen($variable) > 255) {
+ throw new emailException("Mag maximaal 50 karakters!");
}
}
diff --git a/website/queries/friendship.php b/website/queries/friendship.php
index 7edada9..3dcd53b 100644
--- a/website/queries/friendship.php
+++ b/website/queries/friendship.php
@@ -17,7 +17,7 @@ function selectLimitedFriends($userID, $limit) {
`profilepicture`,
'../img/avatar-standard.png'
) AS profilepicture,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`,
@@ -58,7 +58,7 @@ function selectAllFriends($userID) {
`profilepicture`,
'../img/avatar-standard.png'
) AS profilepicture,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`,
@@ -94,7 +94,7 @@ function selectAllFriendRequests() {
`profilepicture`,
'../img/avatar-standard.png'
) AS profilepicture,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`,
@@ -245,7 +245,7 @@ function searchSomeFriends($n, $m, $search) {
`profilepicture`,
'../img/avatar-standard.png'
) AS profilepicture,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`,
diff --git a/website/queries/settings.php b/website/queries/settings.php
index dfd65a0..9b17d17 100644
--- a/website/queries/settings.php
+++ b/website/queries/settings.php
@@ -50,6 +50,15 @@ function getPasswordHash() {
return $stmt->fetch();
}
+function checkUpdateSettings() {
+ if (empty(test_input($_POST['fname'])) || empty(test_input($_POST['lname']))) {
+ throw new AngryAlert("Geen voornaam of achternaam.");
+ return;
+ }
+
+ updateSettings();
+}
+
/**
* Changes the setting from post.
* @throws HappyAlert
diff --git a/website/queries/user.php b/website/queries/user.php
index 836c956..06487be 100644
--- a/website/queries/user.php
+++ b/website/queries/user.php
@@ -62,7 +62,7 @@ function selectUser($me, $other) {
) AS profilepicture,
`bio`,
`user`.`creationdate`,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`,
@@ -137,7 +137,7 @@ function select20UsersFromN($n) {
`username`,
`role`,
`bancomment`,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`
@@ -162,7 +162,7 @@ function search20UsersFromN($n, $keyword) {
`username`,
`role`,
`bancomment`,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`
@@ -190,7 +190,7 @@ function search20UsersFromNByStatus($n, $keyword, $status) {
`username`,
`role`,
`bancomment`,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`
@@ -224,7 +224,7 @@ function searchSomeUsersByStatus($n, $m, $search, $status) {
`username`,
`role`,
`bancomment`,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`
@@ -368,7 +368,7 @@ function searchSomeUsers($n, $m, $search) {
'../img/avatar-standard.png'
) AS profilepicture,
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
- CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
+ CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHEN TRUE THEN 'online'
WHEN FALSE THEN 'offline'
END AS `onlinestatus`
diff --git a/website/views/adminpanel-grouptable.php b/website/views/adminpanel-grouptable.php
index 9d2c8e8..2449b3d 100644
--- a/website/views/adminpanel-grouptable.php
+++ b/website/views/adminpanel-grouptable.php
@@ -1,8 +1,8 @@
|
- Gebruikersnaam |
+ Groepsnaam |
Status |
-
+
Actie |
@@ -33,9 +33,9 @@ while ($group = $q->fetch(PDO::FETCH_ASSOC)) {
diff --git a/website/views/facebookRegisterModal.php b/website/views/facebookRegisterModal.php
index 7db44b0..7271d63 100644
--- a/website/views/facebookRegisterModal.php
+++ b/website/views/facebookRegisterModal.php
@@ -55,7 +55,6 @@
*