aboutsummaryrefslogtreecommitdiff
path: root/blog/comment/index.php
blob: 2d5f6a6a0fe803a68adff2a67ef87a3c75989a66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>blog comments</title>
    <link href="/style.css" rel="stylesheet" type="text/css" media="all">
    <link href="comments.css" rel="stylesheet" type="text/css" media="all">
    <style>
      
    </style>
    <?php include($_SERVER['DOCUMENT_ROOT'] . '/seasonal.php'); ?>
  </head>
  <body>
    <?php include($_SERVER['DOCUMENT_ROOT'] . '/nav.php'); ?>
    <h1>blog</h1>
    <h2 id="caption">every comment</h2>
    <nav>
      <a href="feed.php">RSS</a>
    </nav>
    <?php 
      include("../../Parsedown.php");
      $Parsedown = new Parsedown();
      $Parsedown->setSafeMode(true);
      
      $totaloutput = "";
      $postlist = json_decode(file_get_contents("posts.json"));
      foreach($postlist as $post) {
        $output = "";
        $date = date("Y-m-d h:iA", $post->date);
        $name = $post->name;
        $message = $Parsedown->text(html_entity_decode($post->message));
        $entry = $post->entry;

        $output = $output."<hr><article><table><tr><td style='text-align: left;'>".$name." <i>on</i> <a href='/blog/posts/".$entry."/'>".$entry."</a></td><td style='text-align: right;'>".$date."</td></tr><tr><td colspan='2'>".$message."</td></tr></table></article>";
        $totaloutput = $output.$totaloutput;
      }
      echo $totaloutput; ?>
  </body>
</html>