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