aboutsummaryrefslogtreecommitdiff
path: root/posts/index.php
blob: 1fe640e17723c94ecbc01ccfb67a2f99f750c051 (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
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/x-icon" href="../favicon.ico">
    <title>deep twisty - posts</title>
    <link href="../style.css" rel="stylesheet" type="text/css" media="all">
    <link href="../subpage.css" rel="stylesheet" type="text/css" media="all">
    <style>
      article.post {
        padding: 1rem;
        max-width: 25rem;
        margin: auto;
      }
      h2.datemarker {
        margin-bottom: 0;
        font-size: small; 
      }
      .post p {
        margin-top: 0.1rem;
      }
    </style>
  </head>
 <body>

    <main>
      <h1 id="header"><span id="headerblue">po</span><span id="headergreen">st</span><span id="headeryellow">s</span></h1>
      <p><a class="white-color" style="text-decoration: none; font-size: 1.4em; font-family: var(--hfont);" href="../">home</a><span style="display: inline-block; margin: 0 0.3rem; font-size: 0;"></span><a class="white-color" style="text-decoration: none; font-size: 1.4em; font-family: var(--hfont);" href="https://journal.miso.town/atom?url=https://deeptwisty.com/posts/">feed</a></p><hr>
      <div id="posts">
        <?php
          $infile = fopen("posts.txt", "r") or die("file read error -_-");
          $content = fread($infile,filesize("posts.txt"));
          fclose($infile);
          $post_arr = explode("\n",$content);
          $posts_out = "";
          foreach($post_arr as $p) {
            if(strlen($p) > 3) {
              $date = substr($p, 0, strpos($p, " "));
              $pcont = substr($p, strpos($p, " ") + 1);
              $posts_out = "<article class='post'><h2 class='datemarker'>$date</h2><p>$pcont</p></article>$posts_out";
            }
          }
          echo $posts_out;
        ?>
      </div>
    </main>
    
  </body>

</html>