Merge branch 'master' into lars-algemeen

This commit is contained in:
Lars van Hijfte
2017-01-20 16:21:54 +01:00
24 changed files with 675 additions and 293 deletions

12
website/public/.htaccess Normal file
View File

@@ -0,0 +1,12 @@
Options +FollowSymLinks
RewriteEngine On
ErrorDocument 404 /error404.jpg
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
# Resolve .php file for extensionless php urls
RewriteRule ^([^/.]+)$ $1.php [L]
RewriteRule ^profile/([A-z0-9]+)$ profile.php?username=$1 [NC]

View File

@@ -0,0 +1,44 @@
window.onload = function() {
changeFilter();
};
function checkAll(allbox) {
var checkboxes = document.getElementsByClassName('checkbox-list');
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = allbox.checked;
}
}
}
function checkCheckAll(allbox) {
var checkboxes = document.getElementsByClassName('checkbox-list');
var checked = true;
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
if (checkboxes[i].checked == false) {
checked = false;
break;
}
}
}
allbox.checked = checked;
}
function changeFilter() {
if (document.getElementById('group').checked) {
document.getElementById('admin-filter').style.display = 'none';
document.getElementById('admin-groupfilter').style.display = 'inline-block';
document.getElementById('admin-batchactions').style.display = 'none';
document.getElementById('admin-groupbatchactions').style.display = 'inline-block';
} else {
document.getElementById('admin-filter').style.display = 'inline-block';
document.getElementById('admin-groupfilter').style.display = 'none';
document.getElementById('admin-batchactions').style.display = 'inline-block';
document.getElementById('admin-groupbatchactions').style.display = 'none';
}
}

View File

@@ -7,6 +7,17 @@
include_once("../queries/checkInput.php")
?>
<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
session_start();
@@ -48,18 +59,5 @@
/* This view adds login view */
include("../views/login-view.php");
?>
<script>
function checkLoggedIn() {
if (confirm("You are already logged in!\Do you want to logout?\Press ok to logout.") == true) {
unset($_SESSION["userID"]);
header("Location: login.php");
} else {
header("location: profile.php");
}
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>

View File

@@ -1,45 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<?php include("../views/head.php"); ?>
<script src="/js/masonry.js"></script>
<style>
@import url("/styles/profile.css");
</style>
</head>
<body>
<?php
include("../queries/user.php");
include("../queries/friendship.php");
function nicetime($date) {
if(empty($date)) {
return "No date provided";
}
$single_periods = array("seconde", "minuut", "uur", "dag", "week", "maand", "jaar", "decennium");
$multiple_periods = array("seconden", "minuten", "uur", "dagen", "weken", "maanden", "jaar", "decennia");
$lengths = array("60", "60", "24", "7", "4.35", "12", "10", "0");
$now = time();
$unix_date = strtotime($date);
if(empty($unix_date)) {
return "Bad date";
}
if($now > $unix_date) {
$difference = $now - $unix_date;
$tense = "geleden";
} else {
$difference = $unix_date - $now;
$tense = "vanaf nu";
}
for($i = 0; $difference >= $lengths[$i] && $i < count($lengths) - 1; $i++) {
$difference /= $lengths[$i];
}
$difference = round($difference);
if($difference != 1) {
$period = $multiple_periods[$i];
} else {
$period = $single_periods[$i];
}
return "$difference $period $tense";
}
include("../queries/nicetime.php");
if(empty($_GET["username"])) {
$userID = $_SESSION["userID"];
@@ -52,18 +24,6 @@ $profile_friends = selectAllFriends($userID);
$profile_groups = selectAllUserGroups($userID);
$posts = selectAllUserPosts($userID);
?>
<!DOCTYPE html>
<html>
<head>
<?php include("../views/head.php"); ?>
<style>
@import url("styles/profile.css");
</style>
</head>
<body>
<?php
/*
* This view adds the main layout over the screen.
* Header, menu, footer.

View File

@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<?php include("../views/head.php"); ?>
<?php
include_once("../queries/user.php");
include_once("../queries/group_page.php");
include("../views/head.php");
?>
<style>
@import url("styles/search.css");
</style>

View File

@@ -22,12 +22,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$result = updateSettings();
break;
case "password":
$result = updatePassword();
$result = changePassword();
break;
case "email":
$result = changeEmail();
break;
case "picture":
updateProfilePicture();
$result = $notImplemented;
break;
}

View File

@@ -13,7 +13,7 @@
height: auto;
}
.admin-actions {
.admin-batchactions, .admin-groupbatchactions {
display: inline-block;
padding: 8px;
vertical-align: top;
@@ -22,6 +22,10 @@
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.admin-searchform {
display: inline-block;
}
.admin-searchbar {
display: inline-block;
margin: 10px;
@@ -44,18 +48,20 @@
width: 120px;
}
.admin-groupfilter {
display: none;
}
.admin-users {
margin: 10px;
}
.admin-userpage {
width: 170px;
margin-bottom: 20px;
.admin-userheading {
width: auto;
float: left;
}
.admin-pageui {
text-align: right;
float: right;
width: auto;
margin-bottom: 20px;
}
.usertitle {

View File

@@ -1,7 +1,7 @@
a.button {
background-color: #405550;
background-color: #C8CABD;
border-radius: 10px;
color: white;
color: black;
cursor: pointer;
height: 50%;
margin: 8px 0;
@@ -46,8 +46,8 @@ body {
form {
/*background-color: #a87a87;*/
border-radius: 12px;
height: 75%;
margin: 10px auto;
height: 80%;
margin: auto;
width: 70%;
overflow-y:auto;
}
@@ -66,14 +66,15 @@ h2 {
font-size: 2.0em;
}
input[type=text], input[type=password], input[type=email], input[type="date"] {
box-sizing: border-box;
border-color: #C8CABD;
display: inline-block;
height: 50%;
height: 60%;
padding: 8px 20px;
margin: 4px 0;
width: 50%;
width: 70%;
}
/*
input[type=text], input[type=password], input[type=email], input[type="date"] {
@@ -101,6 +102,31 @@ label {
display: block;
}
.left-arrow {
display: inline-block;
position: relative;
background-color: #C8CABD;
height: 30px;
width: 90px;
padding: 3px 3px 3px 0px;
text-align: center;
border-radius: 0px 10px 10px 0px;
font-size: 24px;
}
.left-arrow:after {
content: '';
display: block;
position: absolute;
right: 100%;
top: 0;
bottom: 0;
border-top: 15px solid transparent;
border-right: 20px solid #C8CABD;
border-bottom: 15px solid transparent;
border-left: 0px solid transparent;
}
/* padding voor registreer container */
.login_containerregister {
padding: 16px;
@@ -109,7 +135,7 @@ label {
/* padding voor login_containers */
.login_containerlogin {
padding: 16px;
padding:25px;
text-align: center;
}
@@ -133,11 +159,11 @@ label {
background-repeat: repeat-x;
background-attachment: fixed;*/
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
height: 53%;
height: 550px;
margin: 34px auto;
overflow-y: auto;
padding: 20px;
width: 35%;
width: 50%;
}
/*.platform {

View File

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

View File

@@ -9,4 +9,9 @@
#search-friends-output {
margin-right: 10px;
}
.searchleft, .searchright {
display: inline-block;
vertical-align: top;
}