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,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>