changed files to more updated version

This commit is contained in:
2019-09-12 12:02:17 +02:00
parent 53794ac310
commit d50b864082
84 changed files with 1560 additions and 933 deletions

View File

@@ -0,0 +1,25 @@
<?php
require_once("./controller/MVCController.php");
require_once("index.php");
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="./view/css/main.css">
</head>
<body>
<header class="row">
<?php
include_once("./view/webcontent/content_header.php");
?>
</header>
<div class="main">
<?php
$mvcController->loadView();
?>
</div>
<footer>
</footer>
</body>
</html>

View File

@@ -1,4 +1,123 @@
*{
font-family: Arial, Helvetica, sans-serif;
font-family: Arial, Helvetica, sans-serif;
}
html, body{
width: 100%;
height: 100%;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
background-color: #333333;
}
body{
}
loginForm{
}
.logo{
height: 100px;
width: 100px;
box-sizing: border-box;
border-radius: 10px;
justify-self: left;
font-size: 50pt;
padding: 10pt;
color: white;
margin-right: 10px;
/* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#1e5799+0,45427a+100 */
background: #1e5799; /* Old browsers */
background: -moz-linear-gradient(-45deg, #1e5799 0%, #45427a 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(-45deg, #1e5799 0%,#45427a 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(135deg, #1e5799 0%,#45427a 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#45427a',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
box-shadow: 0px 0px 20px black;
}
.row{
display: flex;
flex-direction: row;
flex-basis: auto;
}
header{
margin-top: 10px;
}
nav{
border-radius: 10px;
display:flex;
flex-direction: flex-row;
flex-basis: auto;
flex-shrink: 0;
flex-grow: 0;
background-color: gray;
width: 80%;
height: 100px;
max-height: 100px;
align-items: center;
justify-items: center;
align-content: center;
justify-content: center;
align-self: center;
justify-self: center;
box-shadow: 0px 0px 20px black;
}
nav a{
padding-left: 10px;
padding-right: 10px;
text-decoration: none;
font-size: 20pt;
font-weight: bold;
color: white;
}
.main{
border-radius: 15px;
margin-top: 10px;
display: flex;
flex-direction: column;
flex-grow: 0;
flex-shrink: 1;
background-color: white;
padding: 15px;
margin-bottom: 20px;
box-shadow: 0px 0px 20px black;
}
input{
padding: 5px;
margin: 5px;
}
textarea{
padding: 5px;
margin: 5px;
resize: none;
width: 50vw;
height: 20vw;
}
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
width: 80vw;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -1,3 +0,0 @@
<article>
<h1>This page does not exist!</h1>
</article>

View File

@@ -1,7 +0,0 @@
<?php
if(UserSession::isUserSignedIn()){
include("./view/pagecontent/login/content_login_succesful.php");
}else{
include("./view/pagecontent/login/content_login_unsuccesful.php");
}
?>

View File

@@ -1,3 +0,0 @@
<article>
<h1>You've been succesfully logged out</h1>
</article>

View File

@@ -1,3 +0,0 @@
<article>
<h1>Successfully registered!</h1>
</article>

View File

@@ -1,4 +0,0 @@
<?php
?>

View File

@@ -1,3 +0,0 @@
<article>
<h1>You're still signed in thanks to our cookies!</h1>
</article>

View File

@@ -1,7 +0,0 @@
<?php
if(UserSession::isUserSignedIn()){
include("./view/pagecontent/header/content_header_signedin.php");
}else{
include("./view/pagecontent/header/content_header_signedout.php");
}
?>

View File

@@ -1,3 +0,0 @@
<article>
<h1>Welkom op hForumPHP. Log in of registreer om iets te doen.</h1>
</article>

View File

@@ -1,11 +0,0 @@
<article>
<form action="?p=showtopics" method="post">
E-mail: <input type="text" name="email"><br>
Password: <input type="password" name="password"><br>
<input type="hidden" name="p" value="do_login" />
<input type="submit">
</form>
</article>
<?php
?>

View File

@@ -1,35 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>
<?=HUtils::getSiteTitle();?>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="./view/css/main.css" />
</head>
<body>
<header>
<?php
include_once("./view/pagecontent/content_header.php");
?>
</header>
<main>
<?php
//Store de geselecteerde pagina in variabele $page
$page=HUtils::getPage(HUtils::FETCHGET);
//Laad de juiste view
$path = "./view/pagecontent/content_".$page.".php";
if($page != ""){
if(file_exists($path)){
include_once($path);
}
else{
include_once("./view/pagecontent/content_404.php");
}
}
?>
</main>
</body>
</html>

View File

@@ -1,12 +0,0 @@
<script type="text/javascript" src="./view/js/checkform.js"></script>
<article>
<form action="?p=attempt_register" method="post">
Username: <input type="text" name="name" id="name" onkeyup="checkInputs()"><br>
E-mail: <input type="text" name="email" id="email" onkeyup="checkInputs()"><br>
Password: <input type="password" name="pass" id="pass" onkeyup="checkInputs()"><br>
Verify Password: <input type="password" name="pass2" id="pass2" onkeyup="checkInputs()"><br>
<input type="hidden" name="p" value="do_register" />
<input type="submit" id="submitButton" disabled>
</form>
<div id="jsSignupAlert"></div>
</article>

View File

@@ -1,8 +0,0 @@
<?php
if(UserSession::isUserSignedIn()){
echo "LIST OF BOARDS LMAO";
}
else{
echo "You must be signed in to view this page.";
}
?>

View File

@@ -1,17 +0,0 @@
<h1>TOPICS:</h1>
<?php
//Gedeeltelijk dummy code omdat de database nog niet zo ver is. Verder al wel functioneel. Gebrukersnamen worden ingeladen.
if(UserSession::isUserSignedIn()){
//$topics = Database::GetTopicList();
$topics = [ [0, "Hoeveel ICTers heb je nodig om een forum te bouwen?", 2],
[1, "LOREM IPSUM DOLOR", 3]];
for($i = 0; $i < sizeof($topics); $i++){
echo '<a href="?p=showthread&topic='.$i.'">'.$topics[$i][1].'</a> - Gestart door: '.Database::getUsername($topics[$i][2]);
echo '<br>';
}
//test
//echo('aaa');
}
?>

View File

@@ -1,16 +0,0 @@
<?php
if(isset($completed)){
echo("account activated!");
}
else{
echo("account activation went wrong!
<br> Go here: <a href='?p=resend_email'>Resend email verification</a>
<br>
");
}
?>

View File

@@ -1,7 +0,0 @@
<?php
include_once("./controller/AssetHandler.php");
AssetHandler::printAsset("logo.png", true, 128);
?>
<nav>
<a href="?action=signout">log out</a> <a href="?p=">home</a> <a href="?p=create_topic">create thread</a> <a href="?action=destroy">simulate $_SESSION expiry</a>
</nav>

View File

@@ -1,7 +0,0 @@
<?php
include_once("./controller/AssetHandler.php");
AssetHandler::printAsset("logo.png", true, 128);
?>
<nav>
<a href="?p=login">log in</a> <a href="?p=register">register</a> <a href="?p=">home</a>
</nav>

View File

@@ -1,3 +0,0 @@
<article>
<h1>Successfully logged in!</h1>
</article>

View File

@@ -1,3 +0,0 @@
<article>
<h1>UNEXPECTED LOGIN ERROR. OUR CODEMONKEYS DID SOMETHING VERY WRONG :(</h1>
</article>

View File

@@ -1,8 +0,0 @@
<div>
<form action="" method="post">
E-mail: <input type="text" name="email">
Password: <input type="password" name="password">
<input type="hidden" name="p" value="do_login"/>
<input type="submit">
</form>
</div>

View File

@@ -0,0 +1,6 @@
<?php
?>
<h1>
404
</h1>

View File

@@ -0,0 +1,5 @@
<?php
?>
<h1>
Your account appears to be inactive. Check your email for the verification mail.
</h1>

View File

@@ -0,0 +1,7 @@
<?php
require_once './model/forum/Thread.php';
require_once './model/forum/User.php';
foreach (MVCController::$viewData['boards'] as $board){
include './view/webcontent/modules/modules_boards/module_boardtable.php';
}
?>

View File

@@ -0,0 +1,6 @@
<form action="./?p=showthread&thread=<?=MVCController::$viewData['threadid'];?>" method="post">
<textarea placeholder="post content" name="content"></textarea><br>
<input type="submit" value="Create Reply">
<input type="hidden" name="thread" value="<?=MVCController::$viewData['threadid'];?>">
<input type="hidden" name="action" value="create_reply">
</form>

View File

@@ -0,0 +1,7 @@
<form action="./" method="post">
<input type="text" placeholder="Title" name="title"><br>
<textarea placeholder="post content" name="content"></textarea><br>
<input type="submit" value="Create Thread">
<input type="hidden" name="board" value="<?= isset($_GET['board']) ? $_GET['board'] : "-1" ?>">
<input type="hidden" name="action" value="create_thread">
</form>

View File

@@ -0,0 +1,4 @@
Incorrect Email or Password.
<?php
include_once('./view/webcontent/content_signin.php');
?>

View File

@@ -0,0 +1,9 @@
<?php
require_once('./controller/UserSession.php');
if(UserSession::isUserSignedIn()){
include('./view/webcontent/header/header_signedin.php');
}
else{
include('./view/webcontent/header/header_signedout.php');
}
?>

View File

@@ -0,0 +1,3 @@
<h1>
Please sign in to access our forum
</h1>

View File

@@ -0,0 +1,12 @@
<script type="text/javascript" src="./view/js/checkform.js"></script>
<article>
<form action="?p=attempt_register" method="post">
<input type="text" name="name" id="name" placeholder="Username" onkeyup="checkInputs()"><br>
<input type="text" name="email" id="email" placeholder="E-mail" onkeyup="checkInputs()"><br>
<input type="password" name="pass" id="pass" placeholder="Password" onkeyup="checkInputs()"><br>
<input type="password" name="pass2" id="pass2" placeholder="Verify Password" onkeyup="checkInputs()"><br>
<input type="hidden" name="action" value="do_register" />
<input type="submit" id="submitButton" disabled>
</form>
<div id="jsSignupAlert"></div>
</article>

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,45 @@
<?php
require_once './model/forum/Thread.php';
require_once './model/forum/Reply.php';
require_once './model/forum/User.php';
//$thread = new Thread();
$thread = MVCController::$viewData['thread'];
$replies = $thread->getReplies();
?>
<table>
<h1>
<?=$thread->getTitle()?>
</h1>
<tr>
<th width="10%">user</th>
<th width="80%">content</th>
<th width="10%">date</th>
</tr>
<tr>
<td>
<?=$thread->getOwner()->getUsername();?>
</td>
<td>
<?=$thread->getContent()?>
</td>
<td>
<?=$thread->getDate_created()->format("Y M d H:i:s")?>
</td>
</tr>
<?php
foreach($replies as $reply){
$owner = $reply->getOwner()->getUsername();
$content = $reply->getContent();
$date_created = $reply->getDate()->format("Y M d H:i:s");
echo("<tr>");
echo("<td>$owner</td>");
echo("<td>$content</td>");
echo("<td>$date_created</td>");
echo("</tr>");
}
?>
</table>
<?php
$threadID = $thread->getId();
echo "<a href=\"?p=createreply&thread=$threadID\">Create Reply</a>"
?>

View File

@@ -0,0 +1,6 @@
<form action="./" method="post">
<input type="text" placeholder="Email" name="email"><br>
<input type="password" placeholder="password" name="password"><br>
<input type="submit" value="Sign in">
<input type="hidden" name="action" value="login">
</form>

View File

@@ -0,0 +1 @@
Signed out succesfully!

View File

@@ -0,0 +1,2 @@
<?php
echo("questionmark");

View File

@@ -0,0 +1,7 @@
<div class="logo">
hF
</div>
<nav>
<a href="./">Home</a>
<a href="?action=signout">Sign out</a>
</nav>

View File

@@ -0,0 +1,8 @@
<div class="logo">
hF
</div>
<nav>
<a href="./">Home</a>
<a href="?p=register">Register</a>
<a href="?p=signin">Sign in</a>
</nav>

View File

@@ -0,0 +1,48 @@
<h2><?=$board->name?></h2>
<a href="?p=createthread&board=<?=$board->id?>">Create Thread</a>
<table>
<tr>
<th>Thread</th>
<th width=10%>Started by</th>
<th width=15%>Last reply</th>
</tr>
<?php
foreach (MVCController::$viewData['threads'] as $thread){
if($thread->getBoardID() == $board->id){
$currentRow = [];
$currentRow['threadID'] = $thread->getID();
$currentRow['threadTitle'] = $thread->getTitle();
foreach(MVCController::$viewData['users'] as $user){
if($user->getID() == $thread->getUserID()){
$currentRow['username'] = $user->getUsername();
break;
}
}
foreach(MVCController::$viewData['replies'] as $reply){
if(isset($reply)){
if($reply->getThreadID() == $thread->getId())
{
break;
}else{
$currentRow['lastUpdated'] = $thread->getDate_created()->format("Y M d H:i:s");
}
}
}
?>
<tr>
<td>
<a href="?p=showthread&thread=<?=$currentRow['threadID']?>"><?=$currentRow['threadTitle']?></a>
</td>
<td>
<?=$currentRow['username'] ?>
</td>
<td>
<?=$currentRow['lastUpdated']?>
</td>
</tr>
<?php
}
}
?>
</table>