Merge branch 'hendrik-post' into 'master'
Hendrik post See merge request !122
This commit was merged in pull request #126.
This commit is contained in:
52
website/views/post-view.php
Normal file
52
website/views/post-view.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
$postID = $_GET['postID'];
|
||||
$post = selectPostById($postID)->fetch(PDO::FETCH_ASSOC);
|
||||
$fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . ")";
|
||||
|
||||
echo("
|
||||
<div class='post-header header'>
|
||||
<h4>" . $post['title'] . "</h4>
|
||||
<span class='postinfo'>
|
||||
gepost door $fullname,
|
||||
<span class='posttime' title='" . $post['creationdate'] . "'>
|
||||
" . nicetime($post['creationdate']) . "
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class='post-content'>
|
||||
<p>" . $post['content'] . "</p>
|
||||
</div>
|
||||
"); ?>
|
||||
|
||||
<div class='post-comments'>
|
||||
<div class="commentfield">
|
||||
<form name="newcomment" method="post">
|
||||
<textarea placeholder="Laat een reactie achter..."></textarea> <br>
|
||||
<input type="submit" value="Reageer!">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$q = selectCommentsByPostId($postID);
|
||||
while($comment = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
$commentauthor = $comment['fname'] . " " . $comment['lname'] . " (" . $comment['username'] . ")";
|
||||
$commentdate = $comment['creationdate'];
|
||||
$commentnicetime = nicetime($commentdate);
|
||||
$commentcontent = $comment['content'];
|
||||
|
||||
echo("
|
||||
<div class='comment'>
|
||||
<div class='commentinfo'>
|
||||
$commentauthor
|
||||
<span class='commentdate', title='$commentdate'>
|
||||
$commentnicetime
|
||||
</span>
|
||||
</div>
|
||||
<div class='commentcontent'>
|
||||
$commentcontent
|
||||
</div>
|
||||
</div>
|
||||
");
|
||||
} ?>
|
||||
</div>
|
||||
@@ -58,14 +58,32 @@
|
||||
|
||||
while($post = $posts->fetch()) {
|
||||
$nicetime = nicetime($post["creationdate"]);
|
||||
$postID = $post["postID"];
|
||||
echo "
|
||||
<div class='post platform'>
|
||||
<div class='post platform' onclick='requestPost(this)'>
|
||||
<h2>${post["title"]}</h2>
|
||||
<p>${post["content"]}</p>
|
||||
<p class=\"subscript\">${nicetime} geplaatst.</p>
|
||||
<p class=\"subscript\" title='" . $post["creationdate"] ."'>${nicetime} geplaatst.</p>
|
||||
<form>
|
||||
<input type='hidden'
|
||||
name='postID'
|
||||
value='$postID'
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="modal">
|
||||
<div class="modal-content platform">
|
||||
<div class="modal-close">
|
||||
×
|
||||
</div>
|
||||
<div class="modal-response" id="modal-response">
|
||||
<span class="modal-default">Aan het laden...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@ $group_count = countSomeGroups($search)->fetchColumn();
|
||||
</label>
|
||||
<input type="text"
|
||||
name="search"
|
||||
placeholder="zoek"
|
||||
placeholder="Zoek"
|
||||
value=<?php echo "$search";?>
|
||||
>
|
||||
<label for="filter">
|
||||
|
||||
Reference in New Issue
Block a user