changed files to more updated version
This commit is contained in:
6
dev_mvc/view/webcontent/content_404.php
Normal file
6
dev_mvc/view/webcontent/content_404.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
?>
|
||||
<h1>
|
||||
404
|
||||
</h1>
|
||||
5
dev_mvc/view/webcontent/content_account_inactive.php
Normal file
5
dev_mvc/view/webcontent/content_account_inactive.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
?>
|
||||
<h1>
|
||||
Your account appears to be inactive. Check your email for the verification mail.
|
||||
</h1>
|
||||
7
dev_mvc/view/webcontent/content_boards.php
Normal file
7
dev_mvc/view/webcontent/content_boards.php
Normal 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';
|
||||
}
|
||||
?>
|
||||
6
dev_mvc/view/webcontent/content_createreply.php
Normal file
6
dev_mvc/view/webcontent/content_createreply.php
Normal 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>
|
||||
7
dev_mvc/view/webcontent/content_createthread.php
Normal file
7
dev_mvc/view/webcontent/content_createthread.php
Normal 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>
|
||||
4
dev_mvc/view/webcontent/content_error_login.php
Normal file
4
dev_mvc/view/webcontent/content_error_login.php
Normal file
@@ -0,0 +1,4 @@
|
||||
Incorrect Email or Password.
|
||||
<?php
|
||||
include_once('./view/webcontent/content_signin.php');
|
||||
?>
|
||||
9
dev_mvc/view/webcontent/content_header.php
Normal file
9
dev_mvc/view/webcontent/content_header.php
Normal 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');
|
||||
}
|
||||
?>
|
||||
3
dev_mvc/view/webcontent/content_home.php
Normal file
3
dev_mvc/view/webcontent/content_home.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<h1>
|
||||
Please sign in to access our forum
|
||||
</h1>
|
||||
12
dev_mvc/view/webcontent/content_register.php
Normal file
12
dev_mvc/view/webcontent/content_register.php
Normal 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>
|
||||
1
dev_mvc/view/webcontent/content_reply.php
Normal file
1
dev_mvc/view/webcontent/content_reply.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
45
dev_mvc/view/webcontent/content_showthread.php
Normal file
45
dev_mvc/view/webcontent/content_showthread.php
Normal 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>"
|
||||
?>
|
||||
6
dev_mvc/view/webcontent/content_signin.php
Normal file
6
dev_mvc/view/webcontent/content_signin.php
Normal 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>
|
||||
1
dev_mvc/view/webcontent/content_signout.php
Normal file
1
dev_mvc/view/webcontent/content_signout.php
Normal file
@@ -0,0 +1 @@
|
||||
Signed out succesfully!
|
||||
2
dev_mvc/view/webcontent/content_verify.php
Normal file
2
dev_mvc/view/webcontent/content_verify.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
echo("questionmark");
|
||||
7
dev_mvc/view/webcontent/header/header_signedin.php
Normal file
7
dev_mvc/view/webcontent/header/header_signedin.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="logo">
|
||||
hF
|
||||
</div>
|
||||
<nav>
|
||||
<a href="./">Home</a>
|
||||
<a href="?action=signout">Sign out</a>
|
||||
</nav>
|
||||
8
dev_mvc/view/webcontent/header/header_signedout.php
Normal file
8
dev_mvc/view/webcontent/header/header_signedout.php
Normal 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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user